A comprehensive parking management system built with Flask backend and VueJS frontend, featuring multi-user support, real-time parking spot management, and automated notifications.
- Multi-user System: Admin and regular user roles with different permissions
- Parking Lot Management: Create, edit, and manage parking lots with configurable spots
- Real-time Booking: Book and release parking spots with automatic allocation
- Cost Calculation: Automatic pricing based on parking duration
- Dashboard Analytics: Comprehensive statistics and reporting
- API Documentation: Interactive Swagger UI for complete API exploration
- JWT Authentication: Secure token-based authentication system
- SQLite Database: Lightweight, file-based database with auto-creation
- Modular Architecture: Clean separation of concerns with Flask application factory pattern
- Daily reminder emails
- Monthly activity reports
- CSV export functionality
- Background job processing (Celery/Redis)
- Flask: Web framework for API development
- SQLAlchemy: ORM for database operations
- SQLite: Database for data persistence
- JWT: Token-based authentication
- Flask-RESTX: API documentation and validation
- VueJS 3: Progressive JavaScript framework
- Vue Router: Client-side routing
- Vuex: State management
- Bootstrap 5: UI framework and styling
- Axios: HTTP client for API communication
Before starting, ensure you have:
- ✅ Python 3.8+ installed
- ✅ Node.js 14+ installed
- ✅ Git (to clone the repository)
# Check Python version
python3 --version
# Should show Python 3.8 or higher
# Check Node.js version
node --version
# Should show Node.js 14 or higher
# Check npm version
npm --versioncd /path/to/your/Parking_Mad2Replace /path/to/your/Parking_Mad2 with the actual path to your project directory.
cd backend
python3 -m venv venv# On macOS/Linux
source venv/bin/activate
# On Windows
# venv\Scripts\activateYou should see (venv) in your terminal prompt.
pip install --upgrade pip
pip install -r requirements.txtExpected output: All Flask dependencies will be installed (Celery/Redis dependencies are commented out).
# Create .env file with default values
cat > .env << 'EOF'
# ===========================================
# PARKING MANAGEMENT SYSTEM - ENVIRONMENT VARIABLES
# ===========================================
# Flask Environment (development, production, testing)
FLASK_ENV=development
# ===========================================
# SECURITY CONFIGURATION (REQUIRED)
# ===========================================
# Change these to secure random strings in production!
SECRET_KEY=2a53d4c08552f639aa232dfaaf09aec805c0dc2a2b520a780e2acec5c3f1b16f
JWT_SECRET_KEY=eda2e2f03960eeb4b115f56ca58eeac7e6616e9b1cab8aa6d6689dc4a069c051
# ===========================================
# DATABASE CONFIGURATION (REQUIRED)
# ===========================================
# SQLite database file path (will be created automatically)
DATABASE_URL=sqlite:///parking_management.db
# ===========================================
# REDIS CONFIGURATION (DISABLED)
# ===========================================
# Redis server for caching and background jobs - DISABLED FOR NOW
# REDIS_URL=redis://localhost:6379/0
# CELERY_BROKER_URL=redis://localhost:6379/0
# CELERY_RESULT_BACKEND=redis://localhost:6379/0
# ===========================================
# ADMIN CREDENTIALS (REQUIRED)
# ===========================================
# Default admin user credentials
ADMIN_USERNAME=admin
[email protected]
ADMIN_PASSWORD=admin123
# ===========================================
# EMAIL CONFIGURATION (DISABLED)
# ===========================================
# For sending notifications and reports - DISABLED FOR NOW
# MAIL_SERVER=smtp.gmail.com
# MAIL_PORT=587
# MAIL_USE_TLS=True
# [email protected]
# MAIL_PASSWORD=your-app-password
EOF# Test if the application can be created
python3 -c "from application import create_app; app = create_app('development'); print('✅ Backend setup successful!')"Expected output: ✅ Backend setup successful!
cd ../frontendnpm installExpected output: All Vue.js dependencies will be installed.
# Test if Vue CLI is working
npm run serve --helpcd backend
source venv/bin/activate
python3 main.pyExpected output:
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5001
* Running on http://[::1]:5001
* Debug mode: on
Admin user created with username: admin, password: admin123
cd frontend
npm run serveExpected output:
App running at:
- Local: http://localhost:8080/
- Network: http://192.168.x.x:8080/
- URL: http://localhost:8080
- Features: User registration, login, parking lot booking, admin dashboard
- URL: http://localhost:5001
- Health Check: http://localhost:5001/api/health
- API Documentation (Swagger): http://localhost:5001/api/docs/
- API JSON Schema: http://localhost:5001/api/swagger.json
- Username:
admin - Password:
admin123 - Email:
[email protected]
- Create a new user account through the registration form on the frontend
-
Authentication System
- User registration and login
- Admin login
- JWT token-based authentication
-
Admin Dashboard
- Create parking lots
- Edit/delete parking lots
- View all users
- View parking statistics
-
User Dashboard
- View available parking lots
- Book parking spots
- Release parking spots
- View booking history
-
Parking Management
- Real-time spot availability
- Automatic spot allocation
- Cost calculation
- Booking history
-
API Documentation
- Interactive Swagger UI
- Complete endpoint documentation
- Request/response examples
- Try-it-out functionality
- Type: SQLite
- File:
backend/parking_management.db - Auto-created: Yes, on first run
- Admin user: Auto-created with default credentials
cd backend
source venv/bin/activate
pip install -r requirements.txt# Find and kill the process using port 5001
lsof -ti:5001 | xargs kill -9cd backend
rm parking_management.db
python main.py# Find and kill the process using port 8080
lsof -ti:8080 | xargs kill -9# Clear npm cache and try again
npm cache clean --force
npm install# Make sure you're in the backend directory
cd backend
source venv/bin/activate
# You should see (venv) in your promptParking_Mad2/
├── backend/
│ ├── application/ # Main Flask application
│ │ ├── __init__.py # App factory
│ │ ├── config.py # Configuration
│ │ ├── models.py # Database models
│ │ ├── database.py # Database setup
│ │ ├── swagger_setup.py # API documentation
│ │ └── routes/ # API routes
│ ├── main.py # Entry point
│ ├── tasks.py # Background tasks (disabled)
│ ├── requirements.txt # Python dependencies
│ ├── .env # Environment variables
│ └── venv/ # Virtual environment
├── frontend/
│ ├── src/ # Vue.js source code
│ ├── public/ # Static files
│ ├── package.json # Node.js dependencies
│ └── node_modules/ # Installed packages
└── README.md # Project documentation
If everything is working correctly, you should see:
- Backend running on http://localhost:5001
- Frontend running on http://localhost:8080
- Database created with admin user
- No error messages in the terminal
- Start the backend in Terminal 1:
cd backend && source venv/bin/activate && python3 main.py - Start the frontend in Terminal 2:
cd frontend && npm run serve - Start Redis server in Terminal 3:
brew services start redis - Start Celery Worker in Terminal 4:
cd backend && source venv/bin/activate && celery -A application.workers.celery worker --loglevel=info - Start Celery Beat (scheduler) in Terminal 5:
cd backend && source venv/bin/activate && celery -A application.workers.celery beat --loglevel=info - Test the application by logging in as admin
- Create a parking lot through the admin dashboard
- Register a new user and test booking functionality
- Explore the features available in both admin and user dashboards
- API Documentation: Interactive Swagger UI at http://localhost:5001/api/docs/
- API Health Check: http://localhost:5001/api/health
- API Schema: JSON schema at http://localhost:5001/api/swagger.json
- Frontend Development: Vue.js app with hot reload enabled
- Database: SQLite database file in
backend/parking_management.db
If you encounter any issues:
- Check the troubleshooting section above
- Verify all prerequisites are installed
- Ensure ports 5001 and 8080 are available
- Check that virtual environment is activated
- Review the terminal output for error messages
The application is now ready to use! 🚀
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profilePUT /api/auth/profile- Update user profilePOST /api/auth/logout- User logout
GET /api/admin/dashboard- Admin dashboard dataGET /api/admin/users- Get all usersGET /api/admin/parking-lots- Get all parking lotsPOST /api/admin/parking-lots- Create parking lotPUT /api/admin/parking-lots/{id}- Update parking lotDELETE /api/admin/parking-lots/{id}- Delete parking lot
GET /api/user/dashboard- User dashboard dataGET /api/user/parking-lots- Get available parking lotsGET /api/user/reservations- Get user reservationsPOST /api/user/reservations- Create reservationPOST /api/user/reservations/{id}/release- Release reservationPOST /api/user/export-csv- Export user data as CSV (disabled)
GET /api/parking/lots- Get all parking lots (public)GET /api/parking/lots/{id}- Get parking lot detailsGET /api/parking/search- Search parking lotsGET /api/parking/stats- Get parking statistics
id: Primary keyusername: Unique usernameemail: Unique email addresspassword_hash: Hashed passwordrole: 'admin' or 'user'is_active: Account statuscreated_at,updated_at: Timestamps
id: Primary keyprime_location_name: Location nameaddress: Full addresspin_code: Postal codeprice_per_hour: Hourly ratenumber_of_spots: Total spotsis_active: Statuscreated_at,updated_at: Timestamps
id: Primary keylot_id: Foreign key to parking lotsspot_number: Spot identifier (e.g., A1, B2)status: 'A' (Available) or 'O' (Occupied)is_active: Statuscreated_at,updated_at: Timestamps
id: Primary keyspot_id: Foreign key to parking spotsuser_id: Foreign key to usersparking_timestamp: Start timeleaving_timestamp: End timeparking_cost: Calculated coststatus: 'active', 'completed', 'cancelled'vehicle_number: Vehicle identifierremarks: Additional notescreated_at,updated_at: Timestamps
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions, please contact the development team or create an issue in the repository.