You can access the Swagger documentation at http://localhost:3003/api after installing and starting the project.
Here're some of the used tecnologies:
- Typescript
- NestJS
- PrismaORM
- Mongo
- Redis
- Docker
- Jest
- Swagger
- ESLint
Here're some of the features:
- NestJS application with Prisma ORM for database interactions.
- Mongo database initialized as service.
- Redis database used for rate limit storing.
- Dockerized application services for easy deployment.
- Authentication module with Passport JWT for authentication with token.
- CRUD operations for managing private and public data.
- Rate Limite module for ip and token rate limiting.
- All services covered by unit test by using Jest.
- API documentation using Swagger.
- ESLint and Prettier configurations for code formatting.
Before you begin, ensure you have met the following requirements:
- Node.js installed (version ^16.0.0)
- Docker installed
- Set environment folder and files
1. Clone the repository:
git clone https://github.com/enescloud/outvio-nest-app.git
2. Install Project
yarn install
3. Set Environment Files
mv env1.example .env
mkdir env
mv env2.example env/.env.dev
4. Give Permissons To Our Script File
chmod +x scripts/init-all-services.sh
5. Build and Initialize All Services(Redis, Mongo)
./scripts/init-all-services.sh
6. Run Tests
yarn test
7. Start Application
yarn start:debug
You can use Prisma Stuido for checking data on UI
npx prisma studio
You can use Redis CLI for checking data on cli
docker exec -it redis redis-cli
KEYS *
Concurrency Note: In the project, Node.js's robust event loop and Redis's "Fixed Window" algorithm have been harnessed to ensure the safe and efficient handling of concurrent operations. Node.js's event-driven architecture facilitates the management of multiple operations happening simultaneously, while Redis's Fixed Window mechanism controls the rate at which requests are permitted, preventing overloading of shared resources. This combination effectively safeguards against concurrency issues, ensuring data integrity and resource protection.