https://github.com/aya8merai/th-nestjs-e-commerce-api
A NestJS e-commerce backend API built with TypeScript and PostgreSQL, developed as a training project for the TECH HUB Full Stack Bootcamp.
https://github.com/aya8merai/th-nestjs-e-commerce-api
api backend-api database e-commerce-project nestjs postgresql
Last synced: 2 months ago
JSON representation
A NestJS e-commerce backend API built with TypeScript and PostgreSQL, developed as a training project for the TECH HUB Full Stack Bootcamp.
- Host: GitHub
- URL: https://github.com/aya8merai/th-nestjs-e-commerce-api
- Owner: aya8merai
- Created: 2025-09-11T02:32:10.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-11T02:45:33.000Z (10 months ago)
- Last Synced: 2025-09-11T06:03:11.721Z (10 months ago)
- Topics: api, backend-api, database, e-commerce-project, nestjs, postgresql
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
A progressive Node.js framework for building efficient and scalable server-side applications.
# NestJS E-commerce API
## Description
A scalable e-commerce backend API built with NestJS, TypeScript, and PostgreSQL. This project provides essential e-commerce functionality with role-based user management and product categorization.
## Features
- User Management with Role-Based Access Control (SUPER_ADMIN, ADMIN, CUSTOMER)
- Category Management
- Data Validation using class-validator
- PostgreSQL Integration with TypeORM
- Password Hashing with bcrypt
- Pagination Support
- Error Handling with Custom Exceptions
## Prerequisites
- Node.js
- PostgreSQL
- npm
## Project Setup
```bash
$ npm install
```
## Database Configuration
Update database credentials in `src/app.module.ts`:
```typescript
TypeOrmModule.forRoot({
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'your_username',
password: 'your_password',
database: 'your_database',
autoLoadEntities: true,
synchronize: true,
})
```
## Running the Project
```bash
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
```
## API Endpoints
### Users
- `POST /users` - Create user
- `GET /users` - Get all users (DESC order with pagination)
- `GET /users/:id` - Get one user
- `PUT /users/:id` - Update user's info
- `DELETE /users/:id` - Delete user
### Categories
- `POST /categories` - Create category
- `GET /categories` - Get all categories (ASC order with pagination)
- `GET /categories/:id` - Get one category
- `PUT /categories/:id` - Update category's info
- `DELETE /categories/:id` - Delete category