How shuklavedant01/classmates works
Project type and purpose
• This is a full-stack web application (“CLASSMATES” aka “djob”) composed of a Nuxt.js 3 frontend and a Django REST Framework backend.
• Purpose: allow students to register, create/edit/delete project listings, search/filter projects, and request contributions via email.
File structure
• Top-level:
– djob_frontend/: Nuxt.js app with directories for pages, components, layouts, assets, stores, configuration files (nuxt.config.ts, tailwind.config.js), environment settings (.env).
– djob_backend/: Django project with the main settings module (djob_backend/djob_backend), one app (“job”) implementing models, serializers, views, URLs, forms, tests, migrations; requirements.txt, Procfile, SQLite dev DB, staticfiles for admin and DRF.
• Patterns:
– Frontend: file-based routing (pages/), state management in Pinia (stores/), component hierarchy.
– Backend: standard Django MVC (models → views/serializers → URLs), RESTful API endpoints.
README for architecture insights
• Tech stack call-out confirms Nuxt.js, Tailwind, Pinia on frontend; Django + DRF on backend; MySQL in production.
• Feature list outlines core user flows and data entities (users, projects, categories).
• Contribution flow indicates an external email service integration.
Main components and interactions
a. Frontend Layer (Nuxt.js 3)
– Browser client (desktop/mobile)
– Pages & Components (e.g., Login.vue, browse/[id].vue, createjob.vue)
– State Store (Pinia for user/session data)
– HTTP client (Axios) for API calls
b. API Layer
– Django REST Framework endpoints in job/views.py and job/serializers.py
– URL dispatcher (djob_backend/urls.py)
– Authentication middleware (token-based via DRF)
c. Business Logic Layer (Django)
– job app: validation, business rules for project creation/editing
– Django admin module for admin-approved listings
– Email sending component (uses SMTP or third-party API) for contribution requests
d. Data Layer
– Database (MySQL in prod; SQLite in dev) with tables for users, projects, categories, requests
e. External Services
– Email/SMTP service (e.g., SendGrid, Mailgun)
– (Optional) CDN for static assets or third-party auth providers
Relationships and data flow
1. User Interaction (Frontend):
• User navigates to Nuxt.js site → triggers page/component logic → form inputs validated in Vue → Axios POST/GET to Django API.
2. Business Logic (Backend):
• Django receives request → URL router → job.views handles logic → serializers validate/transform data → database CRUD operations → prepares JSON response → sends back to Nuxt.
3. Data Handling (Database):
• MySQL stores user credentials, project records, metadata, categories.
• Django ORM manages schema migrations and queries for quick access and consistency.
4. Email Flow:
• On “Contribute” action, backend composes email and dispatches via SMTP service → student’s email client.
Architectural patterns and principles
• Layered architecture: presentation (Nuxt), application/API (DRF), data (MySQL)
• MVC within Django (models → views → templates—but here templates are replaced by API)
• State management separation (Pinia store decouples UI and data logic)
• RESTful resource design (job endpoints follow standard CRUD operations)
• Token-based stateless authentication