This is an extended example project showcasing the usage of NestJS with Sequelize for database operations, including authentication, authorization, database relations, and Swagger documentation. This project is useful for beginners looking to understand these concepts in a practical scenario.
- RESTful API endpoints for managing users, posts, and comments.
- JWT-based authentication and authorization middleware.
- Sequelize models for user, post, and comment entities with relationships.
- Express middleware for error handling.
- Swagger documentation for API endpoints.
- Node.js and npm installed on your machine.
- PostgreSQL database server running locally or remotely.
- Basic knowledge of NestJS, Sequelize, and Swagger.
-
Clone the repository:
git clone https://github.com/yvexeldev/delivery-nest.git
-
Install dependencies:
cd delivery-nest npm install
-
Set up the database:
- Create a PostgreSQL database.
- Copy the
.env.example
file to.env
and update the database connection string.
-
Start the server:
npm run start:dev
-
View Swagger documentation:
Open your browser and navigate to
http://localhost:<PORT>/api/docs
.
- All endpoints you can at
http://localhost:<PORT>/api/docs
- NestJS - A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- Sequelize - A promise-based Node.js ORM for PostgreSQL, MySQL, SQLite, and MSSQL.
- PostgreSQL - A powerful, open-source object-relational database system.
- Swagger - A tool for API documentation.
Contributions are welcome! Feel free to open an issue or submit a pull request.