This project is a RESTful API built with Node.js, Express, TypeScript, and PostgreSQL. It follows a three-layer architecture and does not use any ORM for database interactions. The API provides endpoints for managing users, products, categories, orders, and carts.
- User authentication (login, signup)
- Product management (CRUD operations)
- Category management
- Order processing
- Cart management
- Database migration and seeding
- Node.js
- Express
- TypeScript
- PostgreSQL
express-api
├── src
│ ├── config
│ ├── controllers
│ ├── db
│ ├── interfaces
│ ├── middleware
│ ├── repositories
│ ├── routes
│ ├── services
│ ├── utils
│ ├── app.ts
│ └── server.ts
├── .env.example
├── .gitignore
├── package.json
└── tsconfig.json
-
Clone the repository:
git clone <repository-url> cd express-api -
Install dependencies:
npm install -
Create a
.envfile based on the.env.examplefile and configure your database connection. -
Create the database:
npm run create-db -
Run migrations:
npm run migrate -
Seed the database:
npm run seed -
Start the server:
npm run start
Refer to the individual controller files for detailed API endpoint documentation.
This project is licensed under the MIT License.