Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xen0xys/nestjs-template
This is a basic template for building a RESTful API using Node.js and NestJS. It provides a structured starting point for your API development, with essential components and best practices.
https://github.com/xen0xys/nestjs-template
Last synced: 20 days ago
JSON representation
This is a basic template for building a RESTful API using Node.js and NestJS. It provides a structured starting point for your API development, with essential components and best practices.
- Host: GitHub
- URL: https://github.com/xen0xys/nestjs-template
- Owner: Xen0Xys
- License: gpl-3.0
- Created: 2023-12-24T09:24:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-04T09:29:35.000Z (2 months ago)
- Last Synced: 2024-12-16T13:16:33.800Z (25 days ago)
- Language: TypeScript
- Size: 750 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NestJS-Template
## Overview
NestJS-Template is a boilerplate project for building scalable and maintainable APIs using NestJS and Prisma. This template provides a solid foundation with a modular architecture, pre-configured Prisma integration, and essential features to help you quickly start your project.
## Features
- **NestJS**: A progressive Node.js framework for building efficient and reliable server-side applications.
- **Prisma**: A modern ORM that simplifies database access with type safety and auto-generated queries.
- **Modular Architecture**: Encourages separation of concerns and promotes code reusability.
- **Environment Configuration**: Easy management of environment-specific variables.
- **Pre-configured Auth Module**: Includes JWT-based authentication and role-based authorization.
- **Swagger Integration**: Auto-generated API documentation with Swagger.
- **Validation & Error Handling**: Centralized validation and error handling for better maintainability.
- **Testing Setup**: Unit and e2e tests configured using Jest.## Getting Started
### Prerequisites
- Node.js (v16 or higher)
- npm (v7 or higher) or yarn
- PostgreSQL (or any other supported database)### Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/NestJS-Template.git
cd NestJS-Template
```
2. Install dependencies:
```bash
pnpm install
```
3. Set up the database:
- Create a .env file in the root directory from the .env.example file and update the database credentials.
- Run the Prisma migration to create the database schema:
```bash
pnpx prisma migrate dev
```
### Running the Application
- Start the development server:
```bash
pnpm run start:dev
```
- The application will be running at `http://localhost:3000`.### Swagger API Documentation
- After starting the server, access the API documentation at `http://localhost:3000/api`.## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.### Future features
- Implement proper testing
- Implement Websockets example## License
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.