# suyogshelke/project-civicsystem architecture

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

- Interactive diagram: https://gitdiagram.com/suyogshelke/project-civicsystem
- Repository: https://github.com/suyogshelke/project-civicsystem

## Overview

CivicSystem is a Java web application for civic-complaint intake and resolution. Citizens register or sign in, submit complaints, track them, and can leave feedback; administrators assign officers, who update complaint status. The graph separates user-facing JSPs, servlet workflows, persistence, and connection configuration. The README documents the full product workflow and database tables; sampled code confirms selected registration, login, submission, update, and feedback behavior, so unsampled wiring is shown only where supported by that documented workflow.

Main entry points: [`src/main/java/com/civic/util/DBConnection.java`](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/util/DBConnection.java) (DB connection), [`src/main/webapp/citizen`](https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/citizen) (Citizen pages), [`src/main/webapp/officer`](https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/officer) (Officer pages), [`src/main/webapp/admin`](https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/admin) (Admin pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_views["Web views"]
  node_citizen_views["Citizen pages"]
  node_admin_views["Admin pages"]
  node_officer_views["Officer pages"]
end

subgraph group_workflows["Servlet workflows"]
  node_register["Registration"]
  node_citizen_login["Citizen login"]
  node_complaint_submit["Complaint intake"]
  node_feedback["Complaint feedback"]
  node_admin_login["Admin login"]
  node_assignment["Officer assignment"]
  node_officer_login["Officer login"]
  node_status_update["Status update"]
  node_status_action["Status action"]
end

subgraph group_persistence["Persistence"]
  node_citizen_dao["Citizen DAO<br/>[CitizenDAO.java]"]
  node_citizen_model["Citizen model<br/>[Citizen.java]"]
  node_database[("Civic database")]
end

subgraph group_configuration["Database access"]
  node_db_connection["DB connection<br/>[DBConnection.java]"]
end

node_citizen(("Citizen"))
node_admin(("Administrator"))
node_officer(("Officer"))
node_mysql[("MySQL")]

node_citizen -->|"uses"| node_citizen_views
node_citizen_views -->|"registers"| node_register
node_register -->|"creates"| node_citizen_model
node_register -->|"registers"| node_citizen_dao
node_citizen_dao -->|"connects via"| node_db_connection
node_citizen_dao -->|"checks and writes"| node_database
node_citizen_views -->|"signs in"| node_citizen_login
node_citizen_login -->|"connects via"| node_db_connection
node_citizen_login -->|"authenticates"| node_database
node_citizen_views -->|"submits complaint"| node_complaint_submit
node_complaint_submit -->|"connects via"| node_db_connection
node_complaint_submit -->|"stores complaint"| node_database
node_citizen_views -->|"sends feedback"| node_feedback
node_feedback -->|"connects via"| node_db_connection
node_feedback -->|"stores feedback"| node_database
node_admin -->|"uses"| node_admin_views
node_admin_views -->|"signs in"| node_admin_login
node_admin_views -->|"assigns officer"| node_assignment
node_officer -->|"uses"| node_officer_views
node_officer_views -->|"signs in"| node_officer_login
node_officer_views -->|"updates complaint"| node_status_update
node_officer_views -->|"updates status"| node_status_action
node_status_update -->|"connects via"| node_db_connection
node_status_update -->|"updates and records"| node_database
node_status_action -->|"connects via"| node_db_connection
node_status_action -->|"updates status"| node_database
node_assignment -->|"connects via"| node_db_connection
node_assignment -->|"assigns officer"| node_database
node_db_connection -->|"opens connection"| node_mysql

click node_citizen_views "https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/citizen"
click node_admin_views "https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/admin"
click node_officer_views "https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/officer"
click node_register "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/CitizenRegisterServlet.java"
click node_citizen_login "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/CitizenLoginServlet.java"
click node_complaint_submit "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/SubmitComplaintServlet.java"
click node_feedback "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/FeedbackServlet.java"
click node_admin_login "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/AdminLoginServlet.java"
click node_assignment "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/AssignOfficerServlet.java"
click node_officer_login "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/OfficerLoginServlet.java"
click node_status_update "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/UpdateComplaintServlet.java"
click node_status_action "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/UpdateStatusServlet.java"
click node_citizen_dao "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/dao/CitizenDAO.java"
click node_citizen_model "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/model/Citizen.java"
click node_db_connection "https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/util/DBConnection.java"

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_citizen_views,node_admin_views,node_officer_views toneBlue
class node_register,node_citizen_login,node_complaint_submit,node_feedback,node_admin_login,node_assignment,node_officer_login,node_status_update,node_status_action,node_mysql toneAmber
class node_citizen_dao,node_citizen_model,node_database toneMint
class node_db_connection toneRose
class node_citizen,node_admin,node_officer toneIndigo
```

## Components

### Web views

- [Citizen pages](https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/citizen): `src/main/webapp/citizen`
- [Admin pages](https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/admin): `src/main/webapp/admin`
- [Officer pages](https://github.com/suyogshelke/project-civicsystem/tree/main/src/main/webapp/officer): `src/main/webapp/officer`

### Servlet workflows

- [Registration](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/CitizenRegisterServlet.java): `src/main/java/com/civic/controller/CitizenRegisterServlet.java`
- [Citizen login](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/CitizenLoginServlet.java): `src/main/java/com/civic/controller/CitizenLoginServlet.java`
- [Complaint intake](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/SubmitComplaintServlet.java): `src/main/java/com/civic/controller/SubmitComplaintServlet.java`
- [Complaint feedback](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/FeedbackServlet.java): `src/main/java/com/civic/controller/FeedbackServlet.java`
- [Admin login](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/AdminLoginServlet.java): `src/main/java/com/civic/controller/AdminLoginServlet.java`
- [Officer assignment](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/AssignOfficerServlet.java): `src/main/java/com/civic/controller/AssignOfficerServlet.java`
- [Officer login](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/OfficerLoginServlet.java): `src/main/java/com/civic/controller/OfficerLoginServlet.java`
- [Status update](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/UpdateComplaintServlet.java): `src/main/java/com/civic/controller/UpdateComplaintServlet.java`
- [Status action](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/controller/UpdateStatusServlet.java): `src/main/java/com/civic/controller/UpdateStatusServlet.java`

### Persistence

- [Citizen DAO](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/dao/CitizenDAO.java): `src/main/java/com/civic/dao/CitizenDAO.java`
- [Citizen model](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/model/Citizen.java): `src/main/java/com/civic/model/Citizen.java`
- **Civic database**

### Database access

- [DB connection](https://github.com/suyogshelke/project-civicsystem/blob/main/src/main/java/com/civic/util/DBConnection.java): `src/main/java/com/civic/util/DBConnection.java`

### Other components

- **Citizen**
- **Administrator**
- **Officer**
- **MySQL**

## Connections

- Citizen → Citizen pages: uses
- Citizen pages → Registration: registers
- Registration → Citizen model: creates
- Registration → Citizen DAO: registers
- Citizen DAO → DB connection: connects via
- Citizen DAO → Civic database: checks and writes
- Citizen pages → Citizen login: signs in
- Citizen login → DB connection: connects via
- Citizen login → Civic database: authenticates
- Citizen pages → Complaint intake: submits complaint
- Complaint intake → DB connection: connects via
- Complaint intake → Civic database: stores complaint
- Citizen pages → Complaint feedback: sends feedback
- Complaint feedback → DB connection: connects via
- Complaint feedback → Civic database: stores feedback
- Administrator → Admin pages: uses
- Admin pages → Admin login: signs in
- Admin pages → Officer assignment: assigns officer
- Officer → Officer pages: uses
- Officer pages → Officer login: signs in
- Officer pages → Status update: updates complaint
- Officer pages → Status action: updates status
- Status update → DB connection: connects via
- Status update → Civic database: updates and records
- Status action → DB connection: connects via
- Status action → Civic database: updates status
- Officer assignment → DB connection: connects via
- Officer assignment → Civic database: assigns officer
- DB connection → MySQL: opens connection
