1.0.5 • Published 10 months ago

@notamans/create-node-express-starter v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

node-express-starter

A basic Node.js and Express.js starter project.

Getting Started

Generate boilerplate using: npx @notamans/create-node-express-starter <PROJECT_NAME>

API URL: http://localhost:3000

Features

  • Node.js and Express.js for building web applications
  • TypeScript for type safety and maintainability
  • dotenv for environment variable management
  • Proper directory structure
  • Jest for unit testing and integration testing
  • ESLint and Prettier for code linting and formatting
  • Winston for logging
  • Custom global error handler. Removes the need for redundant try/catch blocks.

Project Structure

The project is organized into the following directories:

  • src: Source code for the application
    • server.ts: Main entry point for the server
    • controllers/: Controller logic
    • errors/: Custom errors for consistency
    • middlewares/: Express middlewares
    • routes/: API routes
    • services/: Business logic for the application
  • dist: Compiled JavaScript code for production
  • tests: Unit tests and integration tests for the application

Scripts

The following scripts are available:

  • npm run dev: Start the development server
  • npm run build: Compile the code for production
  • npm run start: Start the production server
  • npm run test: Run unit tests and integration tests
  • npm run lint: Run ESLint for code linting and formatting

Environment Variables

The following environment variables are used:

  • Server
    • PORT: Port number for the server (default: 3000)
    • NODE_ENV: Node environment (default: development)
  • Logging
    • LOG_LEVEL: Logger log level. For example, "info", "debug", etc.
    • LOG_TO_CONSOLE
    • LOG_TO_FILE
    • LOG_TO_GRAFANA
    • GRAFANA_HOST
    • GRAFANA_PORT

Contributing

Contributions are welcome! Please submit a pull request with your changes.

1.0.5

10 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.6

11 months ago

0.0.1

11 months ago