A comprehensive web-based parking management system built with Flask and Vue.js for the Modern Application Development II (MAD II) project at IITM BS Degree.
- Overview
- Features
- Technology Stack
- Project Structure
- Prerequisites
- Installation
- Configuration
- Usage
- API Endpoints
- Database Models
- Celery Tasks
- Contributing
- License
The Vehicle Parking App is a full-stack web application that manages parking lots, spots, and vehicle reservations. It provides separate interfaces for administrators and regular users, enabling efficient parking management with real-time updates and automated reporting.
- Admin Panel: Manage parking lots, spots, and user accounts
- User Interface: Reserve parking spots, view booking history, and generate reports
- Real-time Updates: Live parking spot availability
- Automated Tasks: Daily reminders and monthly reports
- Export Features: CSV export of parking history
- Create and manage parking lots
- Monitor parking spot availability
- View user statistics and activity
- Generate comprehensive reports
- Manage user accounts
- Browse available parking lots
- Reserve parking spots in real-time
- View booking history
- Receive automated reminders
- Export parking history to CSV
- Access monthly activity reports
- JWT-based authentication
- Redis caching for improved performance
- Celery-based background tasks
- Email notifications
- PDF and CSV report generation
- Framework: Flask (Python)
- Database: SQLite
- Caching: Redis
- Task Queue: Celery
- Authentication: JWT
- Framework: Vue.js 3
- State Management: Vuex
- Routing: Vue Router
- HTTP Client: Axios
- Email Service: Flask-Mail
- PDF Generation: Custom PDF utilities
- Background Processing: Celery with Redis broker
vehicle_parking_app/
βββ frontend/ # Vue.js frontend application
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # Reusable Vue components
β β βββ views/ # Page-level components
β β βββ router/ # Vue Router configuration
β β βββ store/ # Vuex store modules
β β βββ services/ # API communication services
β βββ package.json
β
βββ backend/ # Flask backend application
β βββ models/ # Database models
β βββ routes/ # API route handlers
β βββ services/ # Business logic services
β βββ tasks/ # Celery background tasks
β βββ utils/ # Utility functions
β βββ templates/ # Jinja2 templates
β βββ auth/ # Authentication module
β
βββ migrations/ # Database migrations
βββ scripts/ # Utility scripts
βββ requirements.txt # Python dependencies
βββ run.py # Application entry point
βββ celery_worker.py # Celery worker entry point
βββ README.md # Project documentation
Before running this application, make sure you have the following installed:
- Python 3.8 or higher
- Node.js 14 or higher
- npm or yarn
- Redis server
- Git
git clone https://github.com/22f3003124/vehicle-parking-app.git
cd vehicle-parking-apppython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtpython scripts/create_db.py
python scripts/create_admin.py
python scripts/seed_data.py # Optional: Add test datacd frontendnpm install# On Ubuntu/Debian
sudo apt-get install redis-server
sudo systemctl start redis-server
# On macOS
brew install redis
brew services start redis
# On Windows
# Download and install Redis from official websiteCreate a .env file in the root directory:
# Database
DATABASE_URL=sqlite:///parking_app.db
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
# JWT
JWT_SECRET_KEY=your-secret-key-here
# Email Configuration
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
MAIL_USE_TLS=True
[email protected]
MAIL_PASSWORD=your-app-password
# Flask
FLASK_ENV=development
FLASK_DEBUG=TrueUpdate frontend/vue.config.js for API base URL:
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:5000',
changeOrigin: true
}
}
}
}redis-servercelery -A celery_worker.celery worker --loglevel=infopython run.pycd frontend
npm run serve- Frontend: http://localhost:8080
- Backend API: http://localhost:5000
- Admin Panel: http://localhost:8080/admin
- User Dashboard: http://localhost:8080/user
- Username: admin
- Password: admin123
- Username: testuser
- Password: test123
POST /api/auth/login- User loginPOST /api/auth/register- User registrationPOST /api/auth/logout- User logout
GET /api/admin/parking-lots- Get all parking lotsPOST /api/admin/parking-lots- Create new parking lotPUT /api/admin/parking-lots/{id}- Update parking lotDELETE /api/admin/parking-lots/{id}- Delete parking lotGET /api/admin/users- Get all usersGET /api/admin/statistics- Get system statistics
GET /api/user/parking-lots- Get available parking lotsPOST /api/user/reservations- Create reservationGET /api/user/reservations- Get user reservationsPUT /api/user/reservations/{id}- Update reservationDELETE /api/user/reservations/{id}- Cancel reservationGET /api/user/export-history- Export parking history
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(64), unique=True)
password = db.Column(db.String(128))
fullname = db.Column(db.String(128))
email = db.Column(db.String(128), unique=True)
address = db.Column(db.String(256))
pin_code = db.Column(db.String(10))
is_admin = db.Column(db.Boolean, default=False)class ParkingLot(db.Model):
id = db.Column(db.Integer, primary_key=True)
prime_location_name = db.Column(db.String(128))
price = db.Column(db.Float)
address = db.Column(db.String(256))
pin_code = db.Column(db.String(10))
number_of_spots = db.Column(db.Integer)class ParkingSpot(db.Model):
id = db.Column(db.Integer, primary_key=True)
lot_id = db.Column(db.Integer, db.ForeignKey('parking_lot.id'))
status = db.Column(db.String(1), default='A') # 'A' for available, 'O' for occupied
spot_number = db.Column(db.Integer)class Reservation(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
spot_id = db.Column(db.Integer, db.ForeignKey('parking_spot.id'))
vehicle_number = db.Column(db.String(20))
parking_timestamp = db.Column(db.DateTime, default=datetime.utcnow)
leaving_timestamp = db.Column(db.DateTime, nullable=True)
parking_cost = db.Column(db.Float, nullable=True)@celery.task
def send_daily_reminders():
"""Send daily reminders to users who haven't visited or booked parking recently"""@celery.task
def generate_monthly_reports():
"""Generate and send monthly activity reports to all users"""@celery.task
def export_user_parking_history(user_id):
"""Export user's parking history to CSV"""- Fork the repository
- Create a 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
- Follow PEP 8 for Python code
- Use ESLint configuration for JavaScript/Vue.js
- Write unit tests for new features
- Update documentation for API changes
- Ensure all tests pass before submitting PR
This project is created for educational purposes as part of the MAD II project at IITM BS Degree program.
- Author: Student ID 22f3003124
- Institution: Indian Institute of Technology Madras (IITM)
- Course: Modern Application Development II (MAD II)
This project is developed as part of the Modern Application Development II course curriculum, demonstrating:
- Full-stack web development skills
- RESTful API design
- Modern frontend frameworks
- Database design and management
- Background task processing
- Caching strategies
- Authentication and authorization
- Automated testing and deployment
Note: This application is developed for academic purposes and may require additional security enhancements for production use.