Disclaimer: This
README.mdfile was generated by an LLM (Large Language Model).
A pragmatic foundation for building maintainable REST APIs with Node.js, Express, and TypeScript.
- Scalable Architecture: A modular, feature-based structure that grows with your project.
- TypeScript by Default: Enjoy the benefits of static typing for more robust and maintainable code.
- Best Practices: Built-in best practices for configuration management, routing, and more.
- Developer-Friendly: Comes with hot-reloading for a smooth development experience.
- Linter & Formatter: Integrated with BiomeJS for clean and consistent code.
- Ready to Deploy: Includes scripts for building and starting a production-ready server.
-
Clone the repository:
git clone https://github.com/poschuler/pragmatic-nodejs-api.git
-
Navigate to the project directory:
cd pragmatic-nodejs-api -
Install the dependencies:
npm install
-
Development Mode: To start the server in development mode with hot-reloading, run:
npm run dev
The server will be available at
http://localhost:3000. -
Production Mode: To build and start the application in production mode, run:
npm run start
npm run dev: Starts the application in development mode with hot-reloading.npm run build: Compiles the TypeScript code to JavaScript in thedistdirectory.npm run start: Builds and starts the production version of the application.npm run biome:lint: Lints the codebase for errors.npm run biome:lint:fix: Lints and fixes the codebase.npm run biome:format: Formats the codebase.npm run biome:format:fix: Formats and writes the changes to the codebase.
The project follows a feature-oriented directory structure, making it easy to navigate and scale.
src/
├── app.ts # Main application entry point
├── server.ts # Core Server class (Express wrapper)
├── routes.ts # Main application router
│
├── config/
│ └── config.ts # Environment variable management
│
└── features/ # Example feature module
└── products
├── products-controller.ts
└── products-routes.ts
- Runtime: Node.js
- Framework: Express.js
- Language: TypeScript
- Transpiler/Runner: tsx
- Linter/Formatter: BiomeJS
Contributions are welcome! Please read our AGENTS.md for guidelines on how to collaborate with the project, especially when using AI agents.
This project is licensed under the MIT License. See the LICENSE file for details.