# pranali-5/certificate-portal architecture

> Architecture diagram of the GitHub repository pranali-5/certificate-portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pranali-5/certificate-portal
- Repository: https://github.com/pranali-5/certificate-portal

## Overview

Civicert is a provisional-certificate application portal. Applicants authenticate, enter application details, upload required PDFs, review and submit, then download a generated acknowledgment; they can revisit applications and documents on the dashboard. The backend owns authenticated application workflows, persistence, upload verification, receipt generation, and notifications. The README documents the major integrations and flow; sampled source confirms several route and service calls, while unsampled implementation details are represented only where documented.

Main entry points: [`backend/src/server.ts`](https://github.com/pranali-5/certificate-portal/blob/main/backend/src/server.ts) (Express routes), [`frontend/src/components/ApplicationForm.tsx`](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/ApplicationForm.tsx) (Application form), [`frontend/src/components/Dashboard.tsx`](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/Dashboard.tsx) (Dashboard), [`frontend/src/app/page.tsx`](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/app/page.tsx) (Session view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Applicant portal"]
  node_portal["Session view<br/>[page.tsx]"]
  node_auth["Sign-in<br/>[AuthScreen.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_form["Application form"]
  node_docinput["Document upload<br/>[DocumentInput.tsx]"]
  node_apihelper["Download helpers<br/>[api.ts]"]
  node_brand["Brand display<br/>[Brand.tsx]"]
  node_authfields["Auth fields<br/>[Field.tsx]"]
  node_forminput["Form fields<br/>[FormInput.tsx]"]
  node_reviewline["Review rows<br/>[ReviewLine.tsx]"]
  node_types["Frontend types<br/>[types.ts]"]
end

subgraph group_api["Application API"]
  node_server["Express routes<br/>[server.ts]"]
  node_config["Runtime config<br/>[config.ts]"]
  node_errors["Error handling<br/>[errors.ts]"]
end

subgraph group_services["Document services"]
  node_certificate["Receipt generation<br/>[certificate.ts]"]
  node_email["Email notifications<br/>[email.ts]"]
end

node_applicant(("Applicant"))
node_database[("PostgreSQL<br/>[schema.prisma]")]
node_s3[("Private S3")]
node_ses["Amazon SES"]

node_applicant -->|"uses"| node_portal
node_portal -->|"checks session"| node_server
node_portal -->|"shows unauthenticated"| node_auth
node_portal -->|"shows authenticated"| node_dashboard
node_auth -->|"auth requests"| node_server
node_auth -->|"renders"| node_authfields
node_dashboard -->|"loads applications"| node_server
node_dashboard -->|"opens"| node_form
node_dashboard -->|"downloads files"| node_apihelper
node_dashboard -->|"renders"| node_brand
node_form -->|"creates and submits"| node_server
node_form -->|"renders upload controls"| node_docinput
node_form -->|"renders fields"| node_forminput
node_form -->|"renders review"| node_reviewline
node_form -->|"requests receipt"| node_apihelper
node_docinput -->|"requests upload URL"| node_server
node_docinput -->|"uploads PDF"| node_s3
node_apihelper -->|"requests download URL"| node_server
node_server -->|"uses clients"| node_config
node_server -->|"uses handlers"| node_errors
node_server -->|"reads and writes"| node_database
node_server -->|"signs and verifies uploads"| node_s3
node_server -->|"generates receipt"| node_certificate
node_server -->|"sends notifications"| node_email
node_certificate -->|"stores PDF"| node_s3
node_email -->|"sends email"| node_ses

click node_portal "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/app/page.tsx"
click node_auth "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/AuthScreen.tsx"
click node_dashboard "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/Dashboard.tsx"
click node_form "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/ApplicationForm.tsx"
click node_docinput "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/DocumentInput.tsx"
click node_apihelper "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/lib/api.ts"
click node_brand "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/Brand.tsx"
click node_authfields "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/Field.tsx"
click node_forminput "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/FormInput.tsx"
click node_reviewline "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/ReviewLine.tsx"
click node_types "https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/types.ts"
click node_server "https://github.com/pranali-5/certificate-portal/blob/main/backend/src/server.ts"
click node_config "https://github.com/pranali-5/certificate-portal/blob/main/backend/src/config.ts"
click node_errors "https://github.com/pranali-5/certificate-portal/blob/main/backend/src/errors.ts"
click node_database "https://github.com/pranali-5/certificate-portal/blob/main/backend/prisma/schema.prisma"
click node_certificate "https://github.com/pranali-5/certificate-portal/blob/main/backend/src/services/certificate.ts"
click node_email "https://github.com/pranali-5/certificate-portal/blob/main/backend/src/services/email.ts"

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_portal,node_auth,node_dashboard,node_form,node_docinput,node_apihelper,node_brand,node_authfields,node_forminput,node_reviewline,node_types toneBlue
class node_server,node_config,node_errors,node_database,node_s3 toneAmber
class node_certificate,node_email toneMint
class node_applicant,node_ses toneIndigo
```

## Components

### Applicant portal

- [Session view](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Sign-in](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/AuthScreen.tsx): `frontend/src/components/AuthScreen.tsx`
- [Dashboard](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/Dashboard.tsx): `frontend/src/components/Dashboard.tsx`
- [Application form](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/ApplicationForm.tsx): `frontend/src/components/ApplicationForm.tsx`
- [Document upload](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/DocumentInput.tsx): `frontend/src/components/DocumentInput.tsx`
- [Download helpers](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Brand display](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/Brand.tsx): `frontend/src/components/Brand.tsx`
- [Auth fields](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/Field.tsx): `frontend/src/components/Field.tsx`
- [Form fields](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/FormInput.tsx): `frontend/src/components/FormInput.tsx`
- [Review rows](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/components/ReviewLine.tsx): `frontend/src/components/ReviewLine.tsx`
- [Frontend types](https://github.com/pranali-5/certificate-portal/blob/main/frontend/src/types.ts): `frontend/src/types.ts`

### Application API

- [Express routes](https://github.com/pranali-5/certificate-portal/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Runtime config](https://github.com/pranali-5/certificate-portal/blob/main/backend/src/config.ts): `backend/src/config.ts`
- [Error handling](https://github.com/pranali-5/certificate-portal/blob/main/backend/src/errors.ts): `backend/src/errors.ts`

### Document services

- [Receipt generation](https://github.com/pranali-5/certificate-portal/blob/main/backend/src/services/certificate.ts): `backend/src/services/certificate.ts`
- [Email notifications](https://github.com/pranali-5/certificate-portal/blob/main/backend/src/services/email.ts): `backend/src/services/email.ts`

### Other components

- **Applicant**
- [PostgreSQL](https://github.com/pranali-5/certificate-portal/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`
- **Private S3**
- **Amazon SES**

## Connections

- Applicant → Session view: uses (evidence: `README.md`)
- Session view → Express routes: checks session (evidence: `frontend/src/app/page.tsx`)
- Session view → Sign-in: shows unauthenticated (evidence: `frontend/src/app/page.tsx`)
- Session view → Dashboard: shows authenticated (evidence: `frontend/src/app/page.tsx`)
- Sign-in → Express routes: auth requests (evidence: `frontend/src/components/AuthScreen.tsx`)
- Sign-in → Auth fields: renders (evidence: `frontend/src/components/AuthScreen.tsx`)
- Dashboard → Express routes: loads applications (evidence: `frontend/src/components/Dashboard.tsx`)
- Dashboard → Application form: opens (evidence: `frontend/src/components/Dashboard.tsx`)
- Dashboard → Download helpers: downloads files (evidence: `frontend/src/components/Dashboard.tsx`)
- Dashboard → Brand display: renders (evidence: `frontend/src/components/Dashboard.tsx`)
- Application form → Express routes: creates and submits (evidence: `frontend/src/components/ApplicationForm.tsx`)
- Application form → Document upload: renders upload controls (evidence: `frontend/src/components/ApplicationForm.tsx`)
- Application form → Form fields: renders fields (evidence: `frontend/src/components/ApplicationForm.tsx`)
- Application form → Review rows: renders review (evidence: `frontend/src/components/ApplicationForm.tsx`)
- Application form → Download helpers: requests receipt (evidence: `frontend/src/components/ApplicationForm.tsx`)
- Document upload → Express routes: requests upload URL (evidence: `README.md`)
- Document upload → Private S3: uploads PDF (evidence: `README.md`)
- Download helpers → Express routes: requests download URL (evidence: `frontend/src/lib/api.ts`)
- Express routes → Runtime config: uses clients (evidence: `backend/src/server.ts`)
- Express routes → Error handling: uses handlers (evidence: `backend/src/server.ts`)
- Express routes → PostgreSQL: reads and writes (evidence: `README.md`)
- Express routes → Private S3: signs and verifies uploads (evidence: `backend/src/server.ts`)
- Express routes → Receipt generation: generates receipt (evidence: `backend/src/server.ts`)
- Express routes → Email notifications: sends notifications (evidence: `backend/src/server.ts`)
- Receipt generation → Private S3: stores PDF (evidence: `backend/src/services/certificate.ts`)
- Email notifications → Amazon SES: sends email (evidence: `backend/src/services/email.ts`)
