https://github.com/shehara-r-001/nestjs-template
This is a boilerplate template for building scalable applications using NestJS.
https://github.com/shehara-r-001/nestjs-template
ioredis nestjs passport swagger swc typeorm typescript
Last synced: 7 months ago
JSON representation
This is a boilerplate template for building scalable applications using NestJS.
- Host: GitHub
- URL: https://github.com/shehara-r-001/nestjs-template
- Owner: Shehara-r-001
- License: mit
- Created: 2025-01-30T10:40:38.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-25T15:33:21.000Z (8 months ago)
- Last Synced: 2025-02-25T16:31:50.299Z (8 months ago)
- Topics: ioredis, nestjs, passport, swagger, swc, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NestJS Template
This is a boilerplate template for building scalable applications using [NestJS](https://nestjs.com/). It includes essential configurations and a structured project setup to kickstart your development.
## 📌 Features
- 🏎 **SWC** - Faster TypeScript compilation using `swc`
- 📂 **Organized Folder Structure** - Clean modular architecture
- 🔥 **Redis Caching** - Integrated Redis support with `ioredis`
- 📖 **Swagger API Documentation** - Auto-generated API docs using `@nestjs/swagger`
- ✅ **Linting & Formatting** - Pre-configured ESLint and Prettier---
## Folder Structure
This project follows a modular structure to maintain scalability and separation of concerns:
```
src/
│-- app/
│ │-- core/ (Configurations, decorators, filters, guards, and interceptors)
│ │-- features/ (Feature modules, controllers, and services)
│ │-- shared/ (Common utilities, models, pipes, and services)
│ │-- app.module.ts (Main application module)
│ │-- main.ts (Bootstrap file)
│-- test/ (Testing-related files)
│-- .env (Environment variables)
│-- .env.example (Example environment file)
│-- .gitignore (Git ignore file)
│-- README.md (Project documentation)
```## Getting Started
### Prerequisites
Ensure you have the following installed:
- [Node.js](https://nodejs.org/) (Latest LTS recommended)
- [npm](https://www.npmjs.com/)
- [Docker](https://www.docker.com/) (Optional, for Redis)### Installation
Clone the repository:
```sh
git clone https://github.com/Shehara-r-001/nestjs-template.git
cd nestjs-template
```Install dependencies:
```sh
npm install
```### Environment Variables
Copy the example `.env.example` file and configure it:
```sh
cp .env.example .env
```Update the `.env` file with the required values.
### Running the App
Start the development server:
```sh
npm run start:dev
```The server will run at `http://localhost:/api/v1`.
### Running with Docker (Optional)
To run Redis using Docker:
```sh
docker run --name redis -p 6379:6379 -d redis
```## Scripts
- `start` - Run the application
- `start:dev` - Run the application in development mode
- `build` - Build the application
- `test` - Run unit tests## License
This project is licensed under the [MIT License](LICENSE).
---
Made by Shehara Ranathisara(https://github.com/Shehara-r-001)