A TypeScript Express.js backend application for the Brinate Car Rental platform.
- Express.js - Fast, unopinionated web framework
- TypeScript - Type-safe JavaScript
- CORS - Cross-Origin Resource Sharing support
- Environment Configuration - Zod-validated environment variables
- Development Tools - ESLint, Prettier, and TypeScript compiler
- Node.js (v20 or higher)
- npm
-
Clone the repository
-
Install dependencies:
npm install
-
Copy the example environment file:
cp .env.example .env
-
Configure your environment variables in
.env:NODE_ENV=development PORT=3000 ORIGINS=http://localhost:3000,http://localhost:3001
| Variable | Description | Default | Required |
|---|---|---|---|
NODE_ENV |
Environment mode | development |
No |
PORT |
Server port | 5000 |
No |
ORIGINS |
CORS allowed origins (comma-separated) | - | Yes |
npm run dev- Start development server with hot reloadnpm run build- Build the project for productionnpm run start- Start production servernpm run start:prod- Build and start production servernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint errorsnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run clean- Remove build directorynpm run type-check- Run TypeScript type checking
Start the development server:
npm run devThe server will start on the configured port (default: 3000) with hot reload enabled.
Build and start the production server:
npm run start:prodsrc/
├── app.ts # Express app configuration
├── server.ts # Server entry point
└── config/
├── index.ts # Main config export
└── env/
└── index.ts # Environment variable validation
ISC