Rentify is a backend API for a car rental system, built using NestJS and PostgreSQL.
API Docs .
Report Bug .
Request Feature
Rentify is a backend API for a car rental system built with NestJS and PostgreSQL, inspired by the RentX app. It provides essential endpoints for managing car rentals, focusing on robust features like user management, authentication, and rental operations. Rentify is designed to streamline the backend processes required for a modern car rental service.
- User Management: Handles user and admin accounts, supporting creation, updates, and role-based access.
- Authentication: Secures the API with JWT-based access and refresh token mechanisms.
- Brands: Provides endpoints to manage and retrieve car brands for easy categorization and filtering.
- Car Management: Includes CRUD operations for cars, managing details like availability, pricing, and specifications.
- Locations: Manages pickup and dropoff points for rented cars, offering flexibility for users.
- Discounts: Enables management of promotional discounts to enhance customer engagement.
- Orders: Handles rental bookings, including order creation, status tracking, and related operations.
- NodeJS
- NestJS
- TypeScript
- PostgreSQL
- Redis
- TypeORM
- JWT (JSON Web Tokens)
- bcryptjs
- multer
- Jest
- npm
- Postman
- Swagger
- Docker
To get a local copy up and running follow these simple steps.
- NodeJS
- npm
- PostgreSQL
- Redis
- Docker (optional)
git clone https://github.com/MUSTAFA-Hamzawy/Rentify.git
then, Move to the project directory
-
Create a copy of the
.env.example
file and name it.env
:cp .env.example .env
-
Update the .env file with the following configurations:
- JWT_ACCESS_TOKEN_KEY: Generate a secure hexadecimal key using this command ( or use any way you prefer )
openssl rand -hex 32
-
JWT_REFRESH_TOKEN_KEY: Generate another secure hexadecimal key using the same command.
-
OTP_SECRET_KEY: Generate yet another secure hexadecimal key using the same command.
-
SMTP_MAIL : write your smtp email that will be used to send emails for users
-
APP_PASSWORD : you can generate app passwrod for gmail account from here : https://knowledge.workspace.google.com/kb/how-to-create-app-passwords-000009237
Set up and run the application using Docker containers
docker-compose -f docker-compose.yml -f docker-compose-prod.yml up -d
NOTE: the container will run on port 4000, you can adjust it from the file docker-compose.yml
- Create a new database
- setup "src/database/db.config.json" file based on your db configurations
- Install dependecies & seeding database
npm install -g @nestjs/cli
npm install
npm run migration:run
npm run seed
- Start Running
npm start
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or
- Directly create a pull request after you edit the files with necessary changes.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
See LICENSE for more information.