A comprehensive IoT-based smart parking solution that enables real-time parking spot management, vehicle tracking, and entrance/exit monitoring. The system integrates hardware sensors, cloud backend services, and a modern web interface to optimize parking operations.
- Project Overview
- Features
- Tech Stack
- How to Run
- Folder Structure
- API Documentation
- Contributing
- Contributors
Smart Parking System is a full-stack IoT application designed to streamline parking management. It features:
- Real-time parking spot occupancy tracking using IoT sensors
- User authentication and authorization with JWT tokens
- MQTT-based communication between hardware devices and backend
- RESTful API for vehicle and parking management
- Interactive web dashboard for users and administrators
- RFID integration for vehicle identification
The system consists of three main components: Backend API (Go), Frontend (React + TypeScript), and Hardware (ESP32).
- โ User authentication and registration with secure password hashing
- โ Real-time parking spot status monitoring
- โ Vehicle management and tracking
- โ Entrance/Exit logging and auditing
- โ User ban/unban functionality with IP logging
- โ JWT-based authorization
- ๐ก MQTT connectivity for IoT devices
- ๐ RFID reader integration for vehicle identification
- ๐ฎ Servo motor control for barrier management
- ๐ก LED indicators for status visualization
- ๐ Ultrasonic sensors for occupancy detection
- ๐บ LCD display for user feedback
- ๐จ Modern, responsive UI with Tailwind CSS
- ๐ Secure login and signup pages
- ๐ Parking spot schematic visualization
- ๐ Vehicle search and management
- ๐ Entrance/exit logging dashboard
- ๐ฎ Interactive mini-games for user engagement
- ๐ฌ Smooth animations with Framer Motion
- Language: Go 1.24.4
- Framework: Gin Web Framework
- Database: PostgreSQL
- Cache: Redis
- Message Broker: EMQX (MQTT)
- Authentication: JWT (golang-jwt/jwt)
- Encryption: golang.org/x/crypto
- ORM: GORM
- Dependency Injection: Google Wire
- Framework: React 19
- Language: TypeScript 5.8
- Build Tool: Vite 7
- Styling: Tailwind CSS 4
- HTTP Client: Axios
- Animation: Framer Motion
- Icons: Lucide React
- Notifications: React Toastify
- Linting: ESLint
- Platform: ESP32 / ESP32-S3
- Framework: Arduino
- Development: PlatformIO
- Libraries: Arduino JSON, MQTT 2.5.2
- Containerization: Docker & Docker Compose
- Web Server: Caddy
- Package Registry: GitHub Container Registry (ghcr.io)
cd API
docker-compose up -dThis will start:
- Backend API on
http://localhost:8080 - EMQX Broker on
mqtt://localhost:1883 - EMQX Dashboard on
http://localhost:18083 - PostgreSQL on
localhost:5432 - Redis on
localhost:6379
cd Frontend
docker-compose up -dThis will start:
- Frontend Web Server on
http://localhost:3000
cd API/BackEnd
go run cmd/server/main.gocd FrontEnd
npm run devFrontend will be available at http://localhost:5173
Backend:
cd API/BackEnd
go build -o smartparking cmd/server/main.go
./smartparkingFrontend:
cd FrontEnd
npm run build
npm run previewBackend Only:
cd API/BackEnd
docker build -t smartparking:latest .
docker run -p 8080:8080 smartparking:latestFrontend Only:
cd FrontEnd
docker build -t smartparking-frontend:latest .
docker run -p 3000:3000 smartparking-frontend:latestsmart-parking/
โโโ README.md # Project documentation
โโโ API/ # Backend & Infrastructure
โ โโโ docker-compose.yml # Docker services configuration
โ โโโ BackEnd/ # Go backend application
โ โ โโโ dockerfile # Backend container image
โ โ โโโ go.mod # Go module definitions
โ โ โโโ cmd/
โ โ โ โโโ server/
โ โ โ โโโ main.go # Application entry point
โ โ โโโ internal/
โ โ โโโ config/ # Configuration management
โ โ โโโ db/ # Database connection & migrations
โ โ โ โโโ migration/
โ โ โ โโโ init.sql # Database schema
โ โ โโโ delivery/
โ โ โ โโโ http/ # HTTP handlers & routes
โ โ โ โโโ mqtt/ # MQTT client & handlers
โ โ โโโ di/ # Dependency injection setup
โ โ โโโ domain/ # Business domain models
โ โ โโโ dto/ # Data transfer objects
โ โ โโโ jwt/ # JWT utilities
โ โ โโโ middleware/ # HTTP middleware
โ โ โโโ repository/ # Data access layer
โ โ โ โโโ postgres/ # PostgreSQL repositories
โ โ โ โโโ redis/ # Redis repositories
โ โ โโโ usecase/ # Business logic layer
โ โ
โโโ FrontEnd/ # React frontend application
โ โโโ dockerfile # Frontend container image
โ โโโ docker-compose.yml # Frontend services
โ โโโ nginx.conf # Nginx configuration
โ โโโ package.json # NPM dependencies
โ โโโ vite.config.ts # Vite build configuration
โ โโโ tsconfig.json # TypeScript configuration
โ โโโ index.html # HTML entry point
โ โโโ public/ # Static assets
โ โ โโโ Chopping/ # Chopping mini-game
โ โ โโโ RepairKit/ # RepairKit mini-game
โ โโโ src/
โ โโโ main.tsx # React app entry point
โ โโโ App.tsx # Root component
โ โโโ api.ts # API client setup
โ โโโ index.css # Global styles
โ โโโ components/
โ โโโ Auth/ # Login/Signup components
โ โโโ CRUD/ # CRUD operation components
โ โโโ EntranceExit/ # Entry/exit logging components
โ โโโ VehicleSearch/ # Vehicle search components
โ โโโ minigame/ # Mini-game components
โ โโโ Navbar.tsx # Navigation bar
โ โโโ Footer.tsx # Footer component
โ โโโ Schematic.tsx # Parking spot visualization
โ โโโ AccessDenied.tsx # Access denied page
โ
โโโ Hardware/ # ESP32 firmware
โ โโโ platformio.ini # PlatformIO configuration
โ โโโ include/ # Header files
โ โ โโโ config.h # Configuration settings
โ โ โโโ esp32.h / esp32_s3.h # Platform definitions
โ โ โโโ Led/ # LED control headers
โ โ โโโ motors/ # Motor control headers
โ โ โโโ MQTT/ # MQTT client headers
โ โ โโโ RFID/ # RFID reader headers
โ โ โโโ sensors/ # Sensor headers
โ โโโ src/ # Source code
โ โ โโโ main.cpp # Firmware entry point
โ โ โโโ esp32.cpp / esp32_s3.cpp # Platform initialization
โ โ โโโ Lcd/ # LCD display implementation
โ โ โโโ Led/ # LED control implementation
โ โ โโโ motors/ # Motor control implementation
โ โ โโโ MQTT/ # MQTT implementation
โ โ โโโ RFID/ # RFID reader implementation
โ โ โโโ sensors/ # Sensor implementations
โ โโโ test/ # Test files
- POST
/v1/signup- Register a new user - POST
/v1/login- User login
- GET
/v1/ps- Get all parking spots
- GET
/v1/vehicles- Get users vehicles - GET
/v1/vehicles/:id- Get vehicle info - POST
/v1/vehicles- Register a new vehicle - PUT
/v1/vehicles/:id- Update a vehicle info - DELETE
/v1/vehicles/:id- Delete vehicle
- GET
/v1/ee- Get entry/exit logs - GET
/v1/ee/:id- Get entry/exit log info - GET
/v1/ee/vehicle/:id- Get vehicle entrance/exit log
- POST
/v1/gate/control- control entrance/exit gate
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Copyright (c) 2026 NiflheimDevs
See LICENSE for details.
For issues, questions, or suggestions, please create an issue in the repository or contact the development team.