# zomarrd/pifinalbackend architecture

> Architecture diagram of the GitHub repository zomarrd/pifinalbackend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zomarrd/pifinalbackend
- Repository: https://github.com/zomarrd/pifinalbackend

## Overview

This is a small Express REST API for student records, supporting list, lookup, create, update, and delete operations. Requests enter through the versioned student routes, pass through controller and service layers, and reach SQLite persistence; responses and HTTP errors are handled by the controller. Startup mounts the routes, initializes and seeds the table, and starts listening. The README is empty, so capabilities and relationships are based on the sampled source; the external client link is unverified.

Main entry points: [`src/v1/routes/studentRoutes.js`](https://github.com/zomarrd/pifinalbackend/blob/master/src/v1/routes/studentRoutes.js) (Student Routes), [`src/index.js`](https://github.com/zomarrd/pifinalbackend/blob/master/src/index.js) (Server Startup), [`src/controllers/studentController.js`](https://github.com/zomarrd/pifinalbackend/blob/master/src/controllers/studentController.js) (Student Controller), [`src/services/studentService.js`](https://github.com/zomarrd/pifinalbackend/blob/master/src/services/studentService.js) (Student Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_startup["Server Startup<br/>[index.js]"]
  node_routes["Student Routes<br/>[studentRoutes.js]"]
  node_controller["Student Controller"]
end

subgraph group_domain["Student Operations"]
  node_service["Student Service<br/>[studentService.js]"]
end

subgraph group_storage["SQLite Storage"]
  node_model["Student Queries<br/>[Student.js]"]
  node_sqlite[("SQLite Database<br/>[sqliteDB.js]")]
end

node_client(("API Client"))

node_client -.->|"sends requests"| node_routes
node_startup -->|"mounts routes"| node_routes
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"calls operations"| node_service
node_service -->|"delegates operations"| node_model
node_model -->|"queries data"| node_sqlite
node_startup -->|"creates and seeds table"| node_sqlite

click node_startup "https://github.com/zomarrd/pifinalbackend/blob/master/src/index.js"
click node_routes "https://github.com/zomarrd/pifinalbackend/blob/master/src/v1/routes/studentRoutes.js"
click node_controller "https://github.com/zomarrd/pifinalbackend/blob/master/src/controllers/studentController.js"
click node_service "https://github.com/zomarrd/pifinalbackend/blob/master/src/services/studentService.js"
click node_model "https://github.com/zomarrd/pifinalbackend/blob/master/src/database/Student.js"
click node_sqlite "https://github.com/zomarrd/pifinalbackend/blob/master/src/database/sqliteDB.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_startup,node_routes,node_controller,node_client toneBlue
class node_service toneAmber
class node_model,node_sqlite toneMint
```

## Components

### HTTP API

- [Server Startup](https://github.com/zomarrd/pifinalbackend/blob/master/src/index.js): `src/index.js`
- [Student Routes](https://github.com/zomarrd/pifinalbackend/blob/master/src/v1/routes/studentRoutes.js): `src/v1/routes/studentRoutes.js`
- [Student Controller](https://github.com/zomarrd/pifinalbackend/blob/master/src/controllers/studentController.js): `src/controllers/studentController.js`

### Student Operations

- [Student Service](https://github.com/zomarrd/pifinalbackend/blob/master/src/services/studentService.js): `src/services/studentService.js`

### SQLite Storage

- [Student Queries](https://github.com/zomarrd/pifinalbackend/blob/master/src/database/Student.js): `src/database/Student.js`
- [SQLite Database](https://github.com/zomarrd/pifinalbackend/blob/master/src/database/sqliteDB.js): `src/database/sqliteDB.js`

### Other components

- **API Client**

## Connections

- API Client → Student Routes: sends requests
- Server Startup → Student Routes: mounts routes (evidence: `src/index.js`)
- Student Routes → Student Controller: dispatches requests (evidence: `src/v1/routes/studentRoutes.js`)
- Student Controller → Student Service: calls operations (evidence: `src/controllers/studentController.js`)
- Student Service → Student Queries: delegates operations (evidence: `src/services/studentService.js`)
- Student Queries → SQLite Database: queries data (evidence: `src/database/Student.js`)
- Server Startup → SQLite Database: creates and seeds table (evidence: `src/index.js`)
