How mharfe23/restaurant-django-rest-api works
Project Type and Purpose
• This is a backend‐only RESTful web service for a restaurant ordering system, built with Django and Django REST Framework. It exposes JSON endpoints for menu browsing, cart management, order placement, and role‐based user management (customers, managers, delivery crew). Authentication and user registration are handled by Djoser.
File Structure
• Top-level “LittleLemon” directory: Django project configuration (settings.py, asgi.py, wsgi.py, urls.py).
• “LittleLemonAPI” app directory:
• models.py – data schema for MenuItem, Category, CartItem, Order, etc.
• serializers.py – DTOs converting models ↔ JSON.
• views.py – DRF viewsets and APIViews implementing business logic.
• permissions.py – custom role‐based access control.
• urls.py – app-specific route definitions (prefixed under /api/).
• migrations/ – database evolution scripts.
• manage.py & db.sqlite3 for local development.
Extract Additional Insights from README
• REST endpoints are all under /api/, auth endpoints under /auth/ (provided by Djoser).
• Role-based access control: three Django Group roles.
• Key features: filtering/search/pagination, rate-limiting, CRUD on menu/categories/orders, cart operations, user group management via admin or group endpoints.
Elements
– Clear rectangular blocks for each component (Client, API Gateway, Views, Serializers, Models, Database, Admin Panel)
• Blue: External actors (Web/Mobile)
• Green: Application layers (Gateway, Views, Serializers)
• Orange: Data layer (Models, Database)
• Purple: Auth services (Djoser token endpoints)
– Annotation of role-based branches in the Views layer (e.g., Customer vs. Manager vs. Delivery Crew)