# shuklavedant01/classmates architecture

> Architecture diagram of the GitHub repository shuklavedant01/classmates, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shuklavedant01/classmates
- Repository: https://github.com/shuklavedant01/classmates

## Overview

##### 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

## Diagram (Mermaid)

```mermaid
flowchart TB
  %% Frontend Layer
  subgraph "Frontend Layer"
    direction TB
    Browser["Browser Client"]:::frontend
    subgraph "Nuxt.js Pages"
      direction TB
      Login["Login Page"]:::frontend
      BrowseList["Browse Projects Page"]:::frontend
      BrowseDetail["Browse Project Detail Page"]:::frontend
      CreateJob["Create Project Page"]:::frontend
      EditJob["Edit Project Page"]:::frontend
      MyJobs["My Projects Page"]:::frontend
      Signup["Signup Page"]:::frontend
    end
    JobComp["Project Card Component"]:::frontend
    Layout["Layout (default.vue)"]:::frontend
    Store["State Store (Pinia)"]:::frontend
    Axios["HTTP Client (Axios)"]:::frontend
  end

  %% Backend Layer
  subgraph "Backend Layer"
    direction TB
    URLProject["Project-level URLs"]:::backend
    URLJob["Job App URLs"]:::backend
    Views["DRF Views/Serializers"]:::backend
    Serializers["Serializers"]:::backend
    Models["Data Models (User,Project,Category,Request)"]:::backend
    Forms["Forms/Business Logic"]:::backend
    Admin["Admin Module"]:::backend
    Migrations["Migrations"]:::backend
    Settings["Settings"]:::backend
    WSGI["WSGI (wsgi.py)"]:::backend
    ASGI["ASGI (asgi.py)"]:::backend
    DevDB["SQLite Dev DB"]:::backend
    Procfile["Procfile"]:::backend
    Requirements["Requirements"]:::backend
    EmailModule["Email Service Module"]:::backend
  end

  %% Database Layer
  Database["MySQL Database"]:::database

  %% External Services
  External["SMTP/Email Service"]:::external

  %% Connections - Frontend Flow
  Browser --> Login
  Browser --> BrowseList
  Browser --> BrowseDetail
  Browser --> CreateJob
  Browser --> EditJob
  Browser --> MyJobs
  Browser --> Signup
  Browser --> JobComp
  Browser --> Layout
  Browser --> Store
  Login -->|uses| Axios
  BrowseList -->|fetch projects| Axios
  BrowseDetail -->|fetch project detail| Axios
  CreateJob -->|submit new project| Axios
  EditJob -->|submit edits| Axios
  MyJobs -->|fetch my projects| Axios
  Signup -->|register user| Axios
  Axios -->|"HTTP calls"| URLProject

  %% Connections - Backend Flow
  URLProject --> URLJob
  URLJob --> Views
  Views --> Serializers
  Views --> Models
  Views --> Forms
  Views --> Admin
  Views -->|"DB queries"| Database
  Views --> EmailModule

  %% Config and Dev DB
  Settings --> WSGI
  Settings --> ASGI
  Settings --> DevDB
  Settings --> Migrations
  Settings --> Procfile
  Settings --> Requirements

  %% Email flow
  EmailModule -->|"SMTP send"| External

  %% Styles
  classDef frontend fill:#D6EAF8,stroke:#2980B9,stroke-width:1px
  classDef backend fill:#D5F5E3,stroke:#27AE60,stroke-width:1px
  classDef database fill:#F9E79F,stroke:#B7950B,stroke-width:1px
  classDef external fill:#E8DAEF,stroke:#8E44AD,stroke-width:1px

  %% Click Events Frontend
  click Login "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/pages/login.vue"
  click BrowseList "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/pages/browse/index.vue"
  click BrowseDetail "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/pages/browse/[id].vue"
  click CreateJob "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/pages/createjob.vue"
  click EditJob "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/pages/editjob/[id].vue"
  click MyJobs "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/pages/myjobs.vue"
  click Signup "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/pages/signup.vue"
  click JobComp "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/components/job.vue"
  click Layout "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/layouts/default.vue"
  click Store "https://github.com/shuklavedant01/classmates/blob/master/djob_frontend/stores/user.js"

  %% Click Events Backend
  click URLProject "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/djob_backend/urls.py"
  click URLJob "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/job/urls.py"
  click Models "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/job/models.py"
  click Serializers "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/job/serializers.py"
  click Views "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/job/views.py"
  click Forms "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/job/forms.py"
  click Admin "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/job/admin.py"
  click Migrations "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/job/migrations/0001_initial.py"
  click Settings "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/djob_backend/settings.py"
  click WSGI "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/djob_backend/wsgi.py"
  click ASGI "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/djob_backend/asgi.py"
  click DevDB "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/db.sqlite3"
  click Procfile "https://github.com/shuklavedant01/classmates/tree/master/djob_backend/Procfile"
  click Requirements "https://github.com/shuklavedant01/classmates/blob/master/djob_backend/requirements.txt"
```
