# himanshuxreal/feedvote architecture

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

- Interactive diagram: https://gitdiagram.com/himanshuxreal/feedvote
- Repository: https://github.com/himanshuxreal/feedvote

## Overview

FeedVote lets team or classroom users register, submit ideas, vote on others’ ideas, and view a ranked leaderboard. The Streamlit interface makes HTTP requests to a FastAPI application; route handlers validate requests and delegate persistence and vote-counting operations to CRUD functions backed by SQLAlchemy models and a configured database. The excerpts show the API and data layer directly; the frontend excerpt is partial, so its complete page behavior is based on README documentation.

Main entry points: [`backend/app/main.py`](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/crud.py`](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/crud.py) (CRUD operations), [`backend/app/routes/users.py`](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/users.py) (User routes), [`backend/app/routes/feedback.py`](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/feedback.py) (Feedback routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_streamlit_ui["Streamlit app<br/>[app.py]"]
end

subgraph group_api["API workflows"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_user_routes["User routes<br/>[users.py]"]
  node_feedback_routes["Feedback routes<br/>[feedback.py]"]
  node_vote_routes["Vote routes<br/>[vote.py]"]
end

subgraph group_domain["Domain and persistence"]
  node_request_schemas["Request schemas<br/>[schemas.py]"]
  node_crud_ops["CRUD operations<br/>[crud.py]"]
  node_orm_models["User, idea, vote<br/>[models.py]"]
  node_db_session["DB sessions<br/>[database.py]"]
  node_relational_db[("Relational database<br/>[database.py]")]
end

node_team_user(("Team member"))

node_team_user -->|"uses"| node_streamlit_ui
node_streamlit_ui -->|"HTTP requests"| node_api_app
node_api_app -->|"dispatches"| node_user_routes
node_api_app -->|"dispatches"| node_feedback_routes
node_api_app -->|"dispatches"| node_vote_routes
node_user_routes -->|"validates"| node_request_schemas
node_feedback_routes -->|"validates"| node_request_schemas
node_vote_routes -->|"validates"| node_request_schemas
node_user_routes -->|"calls"| node_crud_ops
node_feedback_routes -->|"calls"| node_crud_ops
node_vote_routes -->|"calls"| node_crud_ops
node_user_routes -->|"opens session"| node_db_session
node_feedback_routes -->|"opens session"| node_db_session
node_vote_routes -->|"opens session"| node_db_session
node_crud_ops -->|"queries and updates"| node_orm_models
node_crud_ops -->|"reads and writes"| node_relational_db
node_db_session -->|"connects"| node_relational_db
node_api_app -->|"creates tables"| node_relational_db

click node_streamlit_ui "https://github.com/himanshuxreal/feedvote/blob/main/frontend/app.py"
click node_api_app "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/main.py"
click node_user_routes "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/users.py"
click node_feedback_routes "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/feedback.py"
click node_vote_routes "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/vote.py"
click node_request_schemas "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/schemas.py"
click node_crud_ops "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/crud.py"
click node_orm_models "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/models.py"
click node_db_session "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/database.py"
click node_relational_db "https://github.com/himanshuxreal/feedvote/blob/main/backend/app/database.py"

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_streamlit_ui toneBlue
class node_api_app,node_user_routes,node_feedback_routes,node_vote_routes toneAmber
class node_request_schemas,node_crud_ops,node_orm_models,node_db_session,node_relational_db toneMint
class node_team_user toneIndigo
```

## Components

### User interface

- [Streamlit app](https://github.com/himanshuxreal/feedvote/blob/main/frontend/app.py): `frontend/app.py`

### API workflows

- [FastAPI app](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/main.py): `backend/app/main.py`
- [User routes](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/users.py): `backend/app/routes/users.py`
- [Feedback routes](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/feedback.py): `backend/app/routes/feedback.py`
- [Vote routes](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/routes/vote.py): `backend/app/routes/vote.py`

### Domain and persistence

- [Request schemas](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [CRUD operations](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/crud.py): `backend/app/crud.py`
- [User, idea, vote](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/models.py): `backend/app/models.py`
- [DB sessions](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/database.py): `backend/app/database.py`
- [Relational database](https://github.com/himanshuxreal/feedvote/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Team member**

## Connections

- Team member → Streamlit app: uses
- Streamlit app → FastAPI app: HTTP requests
- FastAPI app → User routes: dispatches
- FastAPI app → Feedback routes: dispatches
- FastAPI app → Vote routes: dispatches
- User routes → Request schemas: validates
- Feedback routes → Request schemas: validates
- Vote routes → Request schemas: validates
- User routes → CRUD operations: calls
- Feedback routes → CRUD operations: calls
- Vote routes → CRUD operations: calls
- User routes → DB sessions: opens session
- Feedback routes → DB sessions: opens session
- Vote routes → DB sessions: opens session
- CRUD operations → User, idea, vote: queries and updates
- CRUD operations → Relational database: reads and writes
- DB sessions → Relational database: connects
- FastAPI app → Relational database: creates tables
