# raj-priyanshu45/todo-app architecture

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

- Interactive diagram: https://gitdiagram.com/raj-priyanshu45/todo-app
- Repository: https://github.com/raj-priyanshu45/todo-app

## Overview

This Spring MVC application supports account signup and login, email-based OTP password recovery, and authenticated todo management. A browser submits requests through Spring Security and the controllers; controllers coordinate persistence or OTP verification and return JSP views or redirects. The todo path is directly supported by sampled controller, service, and repository code. Signup, reset, and authentication behavior is also sampled, but repository interfaces and application configuration are not, so database links represent their JPA persistence role and framework wiring is not expanded beyond the evidence.

Main entry points: [`src/main/java/com/spring_web/web_project/Controller/Login.java`](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/Login.java) (Login controller), [`src/main/java/com/spring_web/web_project/Repo/UserRepo.java`](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/UserRepo.java) (User repository), [`src/main/java/com/spring_web/web_project/Controller/TodoController.java`](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/TodoController.java) (Todo controller), [`src/main/java/com/spring_web/web_project/Security/SpringSecurity.java`](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Security/SpringSecurity.java) (Security configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_hello_controller["Hello controller<br/>[Hello.java]"]
  node_jsp_views["JSP views"]
end

subgraph group_accounts["Accounts and security"]
  node_login_controller["Login controller<br/>[Login.java]"]
  node_security["Security configuration"]
  node_login_service["Login service<br/>[LoginService.java]"]
  node_user_repo["User repository<br/>[UserRepo.java]"]
  node_app_user["User entity<br/>[AppUser.java]"]
  node_password_encoder["Password encoder<br/>[PassEncoder.java]"]
end

subgraph group_recovery["Password recovery"]
  node_otp_service["OTP service<br/>[OtpGenrator.java]"]
  node_pass_repo["OTP repository<br/>[PassRepo.java]"]
  node_reset_entity["OTP entity<br/>[ResestPass.java]"]
end

subgraph group_todos["Todo management"]
  node_todo_controller["Todo controller"]
  node_todo_service["Todo service<br/>[TodoService.java]"]
  node_todo_repo["Todo repository"]
  node_todo_entity["Todo entity<br/>[Todo.java]"]
end

node_browser(("Browser"))
node_database[("Application database")]

node_browser -->|"sends requests"| node_security
node_security -->|"permits requests"| node_login_controller
node_security -->|"protects routes"| node_todo_controller
node_login_controller -->|"selects views"| node_jsp_views
node_todo_controller -->|"selects views"| node_jsp_views
node_hello_controller -->|"selects view"| node_jsp_views
node_browser -->|"requests pages"| node_login_controller
node_browser -->|"requests todos"| node_todo_controller
node_login_controller -->|"reads and saves users"| node_user_repo
node_login_controller -->|"encodes passwords"| node_password_encoder
node_login_service -->|"loads user"| node_user_repo
node_user_repo -->|"persists"| node_app_user
node_user_repo -->|"reads and writes"| node_database
node_login_controller -->|"requests OTP actions"| node_otp_service
node_otp_service -->|"reads and saves OTP"| node_pass_repo
node_pass_repo -->|"persists"| node_reset_entity
node_pass_repo -->|"reads and writes"| node_database
node_todo_controller -->|"manages todos"| node_todo_service
node_todo_service -->|"queries and saves"| node_todo_repo
node_todo_repo -->|"persists"| node_todo_entity
node_todo_repo -->|"reads and writes"| node_database

click node_login_controller "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/Login.java"
click node_todo_controller "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/TodoController.java"
click node_hello_controller "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/Hello.java"
click node_jsp_views "https://github.com/raj-priyanshu45/todo-app/tree/main/src/main/resources/META-INF/resources/WEB-INF/jsp"
click node_security "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Security/SpringSecurity.java"
click node_login_service "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/LoginService.java"
click node_user_repo "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/UserRepo.java"
click node_app_user "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/AppUser.java"
click node_password_encoder "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/PassEncoder.java"
click node_otp_service "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/OtpGenrator.java"
click node_pass_repo "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/PassRepo.java"
click node_reset_entity "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/ResestPass.java"
click node_todo_service "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/TodoService.java"
click node_todo_repo "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/TodoRepository.java"
click node_todo_entity "https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/Todo.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_hello_controller,node_jsp_views,node_browser toneBlue
class node_login_controller,node_security,node_login_service,node_user_repo,node_app_user,node_password_encoder,node_database toneAmber
class node_otp_service,node_pass_repo,node_reset_entity toneMint
class node_todo_controller,node_todo_service,node_todo_repo,node_todo_entity toneRose
```

## Components

### Web interface

- [Hello controller](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/Hello.java): `src/main/java/com/spring_web/web_project/Controller/Hello.java`
- [JSP views](https://github.com/raj-priyanshu45/todo-app/tree/main/src/main/resources/META-INF/resources/WEB-INF/jsp): `src/main/resources/META-INF/resources/WEB-INF/jsp`

### Accounts and security

- [Login controller](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/Login.java): `src/main/java/com/spring_web/web_project/Controller/Login.java`
- [Security configuration](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Security/SpringSecurity.java): `src/main/java/com/spring_web/web_project/Security/SpringSecurity.java`
- [Login service](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/LoginService.java): `src/main/java/com/spring_web/web_project/Service/LoginService.java`
- [User repository](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/UserRepo.java): `src/main/java/com/spring_web/web_project/Repo/UserRepo.java`
- [User entity](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/AppUser.java): `src/main/java/com/spring_web/web_project/Repo/AppUser.java`
- [Password encoder](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/PassEncoder.java): `src/main/java/com/spring_web/web_project/Service/PassEncoder.java`

### Password recovery

- [OTP service](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/OtpGenrator.java): `src/main/java/com/spring_web/web_project/Service/OtpGenrator.java`
- [OTP repository](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/PassRepo.java): `src/main/java/com/spring_web/web_project/Repo/PassRepo.java`
- [OTP entity](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/ResestPass.java): `src/main/java/com/spring_web/web_project/Repo/ResestPass.java`

### Todo management

- [Todo controller](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Controller/TodoController.java): `src/main/java/com/spring_web/web_project/Controller/TodoController.java`
- [Todo service](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Service/TodoService.java): `src/main/java/com/spring_web/web_project/Service/TodoService.java`
- [Todo repository](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/TodoRepository.java): `src/main/java/com/spring_web/web_project/Repo/TodoRepository.java`
- [Todo entity](https://github.com/raj-priyanshu45/todo-app/blob/main/src/main/java/com/spring_web/web_project/Repo/Todo.java): `src/main/java/com/spring_web/web_project/Repo/Todo.java`

### Other components

- **Browser**
- **Application database**

## Connections

- Browser → Security configuration: sends requests
- Security configuration → Login controller: permits requests
- Security configuration → Todo controller: protects routes
- Login controller → JSP views: selects views
- Todo controller → JSP views: selects views
- Hello controller → JSP views: selects view
- Browser → Login controller: requests pages
- Browser → Todo controller: requests todos
- Login controller → User repository: reads and saves users
- Login controller → Password encoder: encodes passwords
- Login service → User repository: loads user
- User repository → User entity: persists
- User repository → Application database: reads and writes
- Login controller → OTP service: requests OTP actions
- OTP service → OTP repository: reads and saves OTP
- OTP repository → OTP entity: persists
- OTP repository → Application database: reads and writes
- Todo controller → Todo service: manages todos
- Todo service → Todo repository: queries and saves
- Todo repository → Todo entity: persists
- Todo repository → Application database: reads and writes
