# suhas-developer07/printpoint architecture

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

- Interactive diagram: https://gitdiagram.com/suhas-developer07/printpoint
- Repository: https://github.com/suhas-developer07/printpoint

## Overview

Kiosk Server is a campus printing and notes backend. A student authenticates, creates an upload session, uploads to object storage, confirms print settings and price, pays, then retrieves the paid job at a kiosk by token; a kiosk can report completion. Separate journeys support notes publishing and browsing, department-admin management, and print/revenue reporting. The graph reflects the documented layered design and sampled wiring; some route families and integrations are supported by the README rather than fully sampled source.

Main entry points: [`internal/app/app.go`](https://github.com/suhas-developer07/printpoint/blob/main/internal/app/app.go) (App wiring), [`internal/routes/router.go`](https://github.com/suhas-developer07/printpoint/blob/main/internal/routes/router.go) (API routes), [`internal/service/file_service.go`](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/file_service.go) (Upload and print workflow), [`internal/service/payment_service.go`](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/payment_service.go) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_main["HTTP server<br/>[main.go]"]
  node_bootstrap["App wiring<br/>[app.go]"]
  node_router["API routes<br/>[router.go]"]
  node_auth["User authentication<br/>[user_service.go]"]
  node_userhandler["User endpoints<br/>[user_handler.go]"]
  node_userrepo["User records<br/>[user_repo.go]"]
  node_jwt["JWT verification<br/>[jwt.go]"]
end

subgraph group_print["Print jobs"]
  node_filehandler["File and kiosk API<br/>[file_handler.go]"]
  node_fileservice["Upload and print workflow<br/>[file_service.go]"]
  node_filerepo["Print session records<br/>[file_repo.go]"]
  node_pricing["Print pricing<br/>[pricing.go]"]
end

subgraph group_payments["Payments"]
  node_paymenthandler["Payment endpoints<br/>[payment_handler.go]"]
  node_paymentservice["Payment processing<br/>[payment_service.go]"]
  node_paymentrepo["Payment records<br/>[payment_repo.go]"]
end

subgraph group_notes["Notes catalog"]
  node_noteshandler["Notes API<br/>[notes_handler.go]"]
  node_notesservice["Notes catalog and printing<br/>[notes_service.go]"]
  node_notesrepo["Notes records<br/>[notes_repo.go]"]
end

subgraph group_admin["Administration"]
  node_deptservice["Department admin"]
  node_depthandler["Department admin API"]
  node_adminhandler["Reporting API<br/>[admin_handler.go]"]
  node_adminservice["Print reporting<br/>[admin_service.go]"]
  node_adminrepo["Report queries<br/>[admin_repo.go]"]
end

node_operator(("Student / kiosk"))
node_razorpay["Razorpay"]
node_s3["Object storage<br/>[s3.go]"]
node_database[("PostgreSQL")]

node_main -->|"initializes"| node_bootstrap
node_main -->|"serves routes"| node_router
node_bootstrap -->|"constructs"| node_userhandler
node_bootstrap -->|"constructs"| node_filehandler
node_bootstrap -->|"constructs"| node_paymenthandler
node_bootstrap -->|"constructs"| node_noteshandler
node_bootstrap -->|"constructs"| node_depthandler
node_bootstrap -->|"constructs"| node_adminhandler
node_bootstrap -->|"connects"| node_database
node_router -->|"routes requests"| node_filehandler
node_router -->|"routes requests"| node_noteshandler
node_router -.->|"routes requests"| node_paymenthandler
node_router -.->|"routes sign-in"| node_userhandler
node_router -->|"routes reports"| node_adminhandler
node_operator -->|"calls API"| node_router
node_userhandler -->|"delegates to"| node_auth
node_auth -->|"accesses users"| node_userrepo
node_auth -->|"issues tokens"| node_jwt
node_router -->|"authenticates requests"| node_jwt
node_filehandler -->|"delegates to"| node_fileservice
node_fileservice -->|"persists sessions"| node_filerepo
node_fileservice -->|"verifies uploads"| node_s3
node_fileservice -->|"calculates price"| node_pricing
node_fileservice -->|"writes transactions"| node_database
node_operator -->|"uploads and retrieves"| node_filehandler
node_paymenthandler -.->|"delegates to"| node_paymentservice
node_paymentservice -->|"records payment"| node_paymentrepo
node_paymentservice -->|"loads sessions"| node_filerepo
node_paymentservice -->|"promotes files"| node_s3
node_paymentservice -->|"creates orders"| node_razorpay
node_razorpay -.->|"sends webhook"| node_paymenthandler
node_noteshandler -->|"delegates to"| node_notesservice
node_notesservice -->|"reads and writes"| node_notesrepo
node_notesservice -->|"stores notes"| node_s3
node_notesservice -->|"creates print sessions"| node_filerepo
node_depthandler -->|"delegates to"| node_deptservice
node_deptservice -->|"accesses admin data"| node_adminrepo
node_adminhandler -->|"delegates to"| node_adminservice
node_adminservice -->|"queries reports"| node_adminrepo
node_adminrepo -->|"queries"| node_database

click node_main "https://github.com/suhas-developer07/printpoint/blob/main/main.go"
click node_bootstrap "https://github.com/suhas-developer07/printpoint/blob/main/internal/app/app.go"
click node_router "https://github.com/suhas-developer07/printpoint/blob/main/internal/routes/router.go"
click node_auth "https://github.com/suhas-developer07/printpoint/blob/main/internal/service/user_service.go"
click node_userhandler "https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/user_handler.go"
click node_userrepo "https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/user_repo.go"
click node_jwt "https://github.com/suhas-developer07/printpoint/blob/main/pkg/jwt/jwt.go"
click node_filehandler "https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/file_handler.go"
click node_fileservice "https://github.com/suhas-developer07/printpoint/blob/main/internal/service/file_service.go"
click node_filerepo "https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/file_repo.go"
click node_pricing "https://github.com/suhas-developer07/printpoint/blob/main/pkg/utils/pricing.go"
click node_paymenthandler "https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/payment_handler.go"
click node_paymentservice "https://github.com/suhas-developer07/printpoint/blob/main/internal/service/payment_service.go"
click node_paymentrepo "https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/payment_repo.go"
click node_s3 "https://github.com/suhas-developer07/printpoint/blob/main/pkg/s3/s3.go"
click node_noteshandler "https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/notes_handler.go"
click node_notesservice "https://github.com/suhas-developer07/printpoint/blob/main/internal/service/notes_service.go"
click node_notesrepo "https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/notes_repo.go"
click node_deptservice "https://github.com/suhas-developer07/printpoint/blob/main/internal/service/dept_admin_service.go"
click node_depthandler "https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/dept_admin_handler.go"
click node_adminhandler "https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/admin_handler.go"
click node_adminservice "https://github.com/suhas-developer07/printpoint/blob/main/internal/service/admin_service.go"
click node_adminrepo "https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/admin_repo.go"

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_main,node_bootstrap,node_router,node_auth,node_userhandler,node_userrepo,node_jwt toneBlue
class node_filehandler,node_fileservice,node_filerepo,node_pricing,node_s3,node_database toneAmber
class node_paymenthandler,node_paymentservice,node_paymentrepo toneMint
class node_noteshandler,node_notesservice,node_notesrepo toneRose
class node_deptservice,node_depthandler,node_adminhandler,node_adminservice,node_adminrepo,node_operator,node_razorpay toneIndigo
```

## Components

### Server runtime

- [HTTP server](https://github.com/suhas-developer07/printpoint/blob/main/main.go): `main.go`
- [App wiring](https://github.com/suhas-developer07/printpoint/blob/main/internal/app/app.go): `internal/app/app.go`
- [API routes](https://github.com/suhas-developer07/printpoint/blob/main/internal/routes/router.go): `internal/routes/router.go`
- [User authentication](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/user_service.go): `internal/service/user_service.go`
- [User endpoints](https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/user_handler.go): `internal/handler/user_handler.go`
- [User records](https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/user_repo.go): `internal/repository/user_repo.go`
- [JWT verification](https://github.com/suhas-developer07/printpoint/blob/main/pkg/jwt/jwt.go): `pkg/jwt/jwt.go`

### Print jobs

- [File and kiosk API](https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/file_handler.go): `internal/handler/file_handler.go`
- [Upload and print workflow](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/file_service.go): `internal/service/file_service.go`
- [Print session records](https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/file_repo.go): `internal/repository/file_repo.go`
- [Print pricing](https://github.com/suhas-developer07/printpoint/blob/main/pkg/utils/pricing.go): `pkg/utils/pricing.go`

### Payments

- [Payment endpoints](https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/payment_handler.go): `internal/handler/payment_handler.go`
- [Payment processing](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/payment_service.go): `internal/service/payment_service.go`
- [Payment records](https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/payment_repo.go): `internal/repository/payment_repo.go`

### Notes catalog

- [Notes API](https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/notes_handler.go): `internal/handler/notes_handler.go`
- [Notes catalog and printing](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/notes_service.go): `internal/service/notes_service.go`
- [Notes records](https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/notes_repo.go): `internal/repository/notes_repo.go`

### Administration

- [Department admin](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/dept_admin_service.go): `internal/service/dept_admin_service.go`
- [Department admin API](https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/dept_admin_handler.go): `internal/handler/dept_admin_handler.go`
- [Reporting API](https://github.com/suhas-developer07/printpoint/blob/main/internal/handler/admin_handler.go): `internal/handler/admin_handler.go`
- [Print reporting](https://github.com/suhas-developer07/printpoint/blob/main/internal/service/admin_service.go): `internal/service/admin_service.go`
- [Report queries](https://github.com/suhas-developer07/printpoint/blob/main/internal/repository/admin_repo.go): `internal/repository/admin_repo.go`

### Other components

- **Student / kiosk**
- **Razorpay**
- [Object storage](https://github.com/suhas-developer07/printpoint/blob/main/pkg/s3/s3.go): `pkg/s3/s3.go`
- **PostgreSQL**

## Connections

- HTTP server → App wiring: initializes (evidence: `main.go`)
- HTTP server → API routes: serves routes (evidence: `main.go`)
- App wiring → User endpoints: constructs (evidence: `internal/app/app.go`)
- App wiring → File and kiosk API: constructs (evidence: `internal/app/app.go`)
- App wiring → Payment endpoints: constructs (evidence: `internal/app/app.go`)
- App wiring → Notes API: constructs (evidence: `internal/app/app.go`)
- App wiring → Department admin API: constructs (evidence: `internal/app/app.go`)
- App wiring → Reporting API: constructs (evidence: `internal/app/app.go`)
- App wiring → PostgreSQL: connects (evidence: `internal/app/app.go`)
- API routes → File and kiosk API: routes requests (evidence: `internal/routes/router.go`)
- API routes → Notes API: routes requests (evidence: `internal/routes/router.go`)
- API routes → Payment endpoints: routes requests
- API routes → User endpoints: routes sign-in
- API routes → Reporting API: routes reports (evidence: `internal/routes/router.go`)
- Student / kiosk → API routes: calls API
- User endpoints → User authentication: delegates to (evidence: `internal/handler/user_handler.go`)
- User authentication → User records: accesses users (evidence: `internal/service/user_service.go`)
- User authentication → JWT verification: issues tokens (evidence: `internal/service/user_service.go`)
- API routes → JWT verification: authenticates requests (evidence: `internal/routes/router.go`)
- File and kiosk API → Upload and print workflow: delegates to (evidence: `internal/handler/file_handler.go`)
- Upload and print workflow → Print session records: persists sessions (evidence: `internal/service/file_service.go`)
- Upload and print workflow → Object storage: verifies uploads (evidence: `internal/service/file_service.go`)
- Upload and print workflow → Print pricing: calculates price (evidence: `internal/service/file_service.go`)
- Upload and print workflow → PostgreSQL: writes transactions (evidence: `internal/service/file_service.go`)
- Student / kiosk → File and kiosk API: uploads and retrieves
- Payment endpoints → Payment processing: delegates to
- Payment processing → Payment records: records payment (evidence: `internal/service/payment_service.go`)
- Payment processing → Print session records: loads sessions (evidence: `internal/service/payment_service.go`)
- Payment processing → Object storage: promotes files (evidence: `internal/service/payment_service.go`)
- Payment processing → Razorpay: creates orders (evidence: `internal/service/payment_service.go`)
- Razorpay → Payment endpoints: sends webhook
- Notes API → Notes catalog and printing: delegates to (evidence: `internal/handler/notes_handler.go`)
- Notes catalog and printing → Notes records: reads and writes (evidence: `internal/service/notes_service.go`)
- Notes catalog and printing → Object storage: stores notes (evidence: `internal/service/notes_service.go`)
- Notes catalog and printing → Print session records: creates print sessions (evidence: `internal/service/notes_service.go`)
- Department admin API → Department admin: delegates to (evidence: `internal/handler/dept_admin_handler.go`)
- Department admin → Report queries: accesses admin data (evidence: `internal/service/dept_admin_service.go`)
- Reporting API → Print reporting: delegates to (evidence: `internal/handler/admin_handler.go`)
- Print reporting → Report queries: queries reports (evidence: `internal/service/admin_service.go`)
- Report queries → PostgreSQL: queries (evidence: `internal/repository/admin_repo.go`)
