A robust NestJS-based backend application for managing parking lots, including features for cameras, gates, payments, and subscriptions.
- Parking Lot Management: Manage parking spots, pricing, and locations.
- Gate Control: Simulate entry and exit gates with device integration.
- Camera Events: Handle license plate recognition events (ALPR).
- Ticket System: Issue and track parking tickets.
- Payments: Process payments for parking sessions.
- Subscriptions: Manage monthly, yearly, and lifetime parking subscriptions.
- Cars: Register and manage vehicles.
- Framework: NestJS
- Database: PostgreSQL
- ORM: Prisma
- Documentation: Swagger (OpenAPI)
- Containerization: Docker & Docker Compose
- Package Manager: pnpm
- Node.js (v20+)
- Docker & Docker Compose
- pnpm (
npm install -g pnpm)
-
Clone the repository:
git clone https://github.com/KPR23/parking-management-api cd parking-management-api -
Install dependencies:
make install # or pnpm install -
Set up environment variables: Copy
.env.exampleto.env(if available) or ensure the following variables are set:DATABASE_URL="postgresql://postgres:postgres@localhost:5432/nest_db?schema=public"
Start the database and application using Docker Compose:
make up
# or
docker-compose up -d-
Start the database (if not using Docker for the app):
docker-compose up -d db
-
Run database migrations:
pnpm prisma migrate dev
-
Start the application:
pnpm run start:dev
Once the application is running, you can access the Swagger API documentation at:
This project includes a Makefile for common tasks:
| Command | Description |
|---|---|
make install |
Install dependencies |
make up |
Start services (Docker) |
make down |
Stop services |
make logs |
View application logs |
make db-studio |
Open Prisma Studio to view data |
make lint |
Run linter |
make build |
Build the project |