Case Study
Project Case Study
Challenges, solutions, outcomes, technical highlights, architecture, and project scale.
⚡
Challenges
- Need for authentication system without traditional password (SMS login)
- Managing multilingual content and Jalali dates alongside Gregorian dates
- Complexity of shopping cart management and price synchronization
- Need for table reservation system with Jalali calendar
- Transportation and multi-city management
- Payment integration and order tracking
💡
Solutions
- Using custom authentication system based on mobile number and SMS OTP
- Implementing custom User model inheriting from AbstractUser
- Using persiantools library for Jalali and Gregorian date conversion
- Designing Commodity, Cart, Reservation, and Transport models for data management
- Implementing AJAX system for seamless server communication
- Using pymysql for MySQL connection
- Designing custom admin panel with different access levels (admin, user)
📚
Outcomes
- Complete and operational cafe management system
- Dedicated user panel for customers and administrators
- Secure and fast SMS authentication system
- Complete management of products, orders, and reservations
- Full Jalali calendar support in all sections
- Responsive and mobile-friendly design
🔧
Technical Highlights
- Django 5.0.1 and Python 3
- MySQL database with pymysql
- Custom User model (AUTH_USER_MODEL)
- SMS-based authentication with Ghasedak API
- Jalali date conversion with persiantools
- Extensive AJAX system with JSON
- Multi-App design (store_account, store_profile)
- Access level management (user, admin, superuser)
- Paginator for pagination
- Product image upload and management
🏗️
Architecture
Cafe Negar is built on Django's MVT (Model-View-Template) architecture and consists of two main applications:
1. store_account: Responsible for user management, authentication, and registration
- Custom User model with mobile, access_level, user_image fields
- SMS and password login system
- Registration with mobile number verification
2. store_profile: Responsible for profile, products, orders management
- Commodity model for products
- Cart model for shopping cart
- Reservation model for table reservations
- Transport model for cities management
The project runs in DEBUG mode and uses SQLite for development and MySQL for production.
📐
Project Scale
- 2 main applications (store_account, store_profile)
- More than 8 data models (User, Commodity, Cart, Reservation, Transport, ImageFile, Comments, Keyword)
- More than 15 pages and HTML templates
- More than 20 views and endpoints
- Complete SMS authentication system
- Dedicated admin panel
- Shopping cart and orders system
- Table reservation system