# mia-svilkovic/groovecrew architecture

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

- Interactive diagram: https://gitdiagram.com/mia-svilkovic/groovecrew
- Repository: https://github.com/mia-svilkovic/groovecrew

## Overview

##### Main Components Identification
The system consists of these primary components:

a) Frontend Layer (React-based):
- User Interface Components
- Authentication System
- Forms Management
- Context Management

b) Backend Layer (Django-based):
- REST API
- Database Models
- Authentication Services
- Business Logic

**┌─ Frontend Layer ─────────────┐      ┌─ Backend Layer ──────────┐**
- ┌─ React Components ───────┐ │      │ ┌─ Django REST API ────┐ │
- Authentication         │ │      │ │- User Management     │ │
- Forms                  │ │ ←──→ │ │- Vinyl Records API   │ │
- Navigation            │ │      │ │- Trading System      │ │
- User Context          │ │      │ │- Authentication      │ │
- ┘ │      │ └────────────────────┘  │
- ┘      └────────────────────────┘

##### Specific Implementation Details

Technical aspects:

Frontend:
- Vite as build tool
- React components structure
- Context API for state management
- CSS modules for styling

Backend:
- Django REST framework
- PostgreSQL database
- Authentication middleware
- API endpoints structure

##### Additional Elements

- Environment configurations
- Development/Production setup
- API endpoints mapping
- Database schema reference
- Authentication flow
- State management flow

Level 1: High-level architecture
- Frontend, Backend, Database interaction

Level 2: Component breakdown
- Individual React components
- Django API structure
- Database models

Level 3: Detailed flows
- Authentication process
- Record trading flow
- User interaction patterns

##### Important Notes

- Keep the main user flows (vinyl trading) prominent
- Security measures
- Scalability considerations
- Deployment architecture
- Document API integration points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    classDef auth fill:#e74c3c,stroke:#c0392b,color:white
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef docs fill:#9b59b6,stroke:#8e44ad,color:white

    %% Frontend Layer
    subgraph Frontend
        FBuild["Vite Build Config"]:::config
        click FBuild "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/frontend/vite.config.js"
        
        subgraph FComponents
            Auth["Authentication Component"]:::frontend
            click Auth "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/frontend/src/components/Authentication.jsx"
            
            Forms["Forms Management"]:::frontend
            click Forms "https://github.com/mia-svilkovic/GrooveCrew/tree/master/izvorni_kod/frontend/src/components/forms/"
            
            Nav["Navigation Components"]:::frontend
            click Nav "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/frontend/src/components/Header.jsx"
            
            Context["User Context"]:::frontend
            click Context "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/frontend/src/contexts/UserContext.jsx"
        end
    end

    %% Backend Layer
    subgraph Backend
        BConfig["Django Settings"]:::config
        click BConfig "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/backend/backend/settings.py"
        
        BAPI["REST API"]:::backend
        click BAPI "https://github.com/mia-svilkovic/GrooveCrew/tree/master/izvorni_kod/backend/api/"
        
        BModels["Database Models"]:::backend
        click BModels "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/backend/api/models.py"
        
        BSerializers["API Serializers"]:::backend
        click BSerializers "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/backend/api/serializers.py"
        
        BViews["API Views/Endpoints"]:::backend
        click BViews "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/backend/api/views.py"
        
        BUrls["URL Configuration"]:::backend
        click BUrls "https://github.com/mia-svilkovic/GrooveCrew/blob/master/izvorni_kod/backend/api/urls.py"
    end

    %% Database Layer
    subgraph Database
        DB[(PostgreSQL)]:::database
    end

    %% Documentation
    subgraph Documentation
        SysArch["System Architecture"]:::docs
        click SysArch "https://github.com/mia-svilkovic/GrooveCrew/blob/master/dokumentacija/arhitektura_sustava/dijagrami.excalidraw"
        
        DBSchema["Database Schema"]:::docs
        click DBSchema "https://github.com/mia-svilkovic/GrooveCrew/blob/master/dokumentacija/baza_podataka/er_dijagram.erdplus"
        
        Deploy["Deployment Architecture"]:::docs
        click Deploy "https://github.com/mia-svilkovic/GrooveCrew/tree/master/dokumentacija/uml/dijagram_razmjestaja/"
    end

    %% Relationships
    Auth <--> Context
    Forms <--> Context
    Nav <--> Context
    Context <--> BAPI
    BAPI <--> BModels
    BAPI <--> BSerializers
    BAPI <--> BViews
    BViews <--> BUrls
    BModels <--> DB
    BConfig --> BAPI
    FBuild --> FComponents

    %% Legend
    subgraph Legend
        F["Frontend"]:::frontend
        B["Backend"]:::backend
        D["Database"]:::database
        A["Authentication"]:::auth
        C["Configuration"]:::config
        Doc["Documentation"]:::docs
    end
```
