# bultut-yegon/funding_backend architecture

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

- Interactive diagram: https://gitdiagram.com/bultut-yegon/funding_backend
- Repository: https://github.com/bultut-yegon/funding_backend

## Overview

Funding Platform is a FastAPI service for discovering funding opportunities and matching them to user profiles. Users register, maintain profiles, browse and save opportunities, and receive recommendations; administrators have separate management endpoints. The app also schedules opportunity collection and user notifications. The excerpts show application startup and router registration, plus authentication, enrichment, and notification behavior. Other API and service connections are based on the source index, so uncertain internal links are omitted or marked unverified.

Main entry points: [`app/main.py`](https://github.com/bultut-yegon/funding_backend/blob/main/app/main.py) (FastAPI app), [`app/db/database.py`](https://github.com/bultut-yegon/funding_backend/blob/main/app/db/database.py) (SQL database), [`app/api/auth.py`](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/auth.py) (Authentication), [`app/services/scheduler.py`](https://github.com/bultut-yegon/funding_backend/blob/main/app/services/scheduler.py) (Task scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_app["FastAPI app<br/>[main.py]"]
end

subgraph group_users["User features"]
  node_auth["Authentication<br/>[auth.py]"]
  node_security["Token security<br/>[security.py]"]
  node_profiles["User profiles<br/>[profile.py]"]
  node_bookmarks["Bookmarks<br/>[bookmarks.py]"]
  node_notifications_api["Notifications API<br/>[notifications.py]"]
  node_analytics["Analytics API<br/>[analytics.py]"]
  node_proposals["Proposals API<br/>[proposals.py]"]
  node_admin["Admin API<br/>[admin.py]"]
end

subgraph group_opportunities["Opportunity matching"]
  node_opportunity_api["Opportunity browsing<br/>[opportunities.py]"]
  node_recommendation_api["Recommendations API<br/>[recommendations.py]"]
  node_predictor["Predictor API<br/>[predictor.py]"]
  node_recommender["Recommendation engine<br/>[recommender.py]"]
  node_classifier["Classifier<br/>[classifier.py]"]
end

subgraph group_operations["Background operations"]
  node_scraper["Opportunity scraper<br/>[scraper.py]"]
  node_enrichment["Opportunity enrichment<br/>[enrichment.py]"]
  node_scheduler["Task scheduler<br/>[scheduler.py]"]
  node_notification_service["Email notifications"]
  node_email_service["Reset email<br/>[email_service.py]"]
end

subgraph group_data["Persistence"]
  node_database[("SQL database<br/>[database.py]")]
  node_user_model["User records<br/>[user.py]"]
  node_session_model["User sessions<br/>[user_session.py]"]
  node_opportunity_model["Opportunity records<br/>[opportunity.py]"]
  node_profile_model["Profile records<br/>[profile.py]"]
  node_bookmark_model["Bookmark records<br/>[bookmark.py]"]
  node_notification_model["Notification records<br/>[notification.py]"]
  node_recommendation_model["Recommendation records<br/>[recommendation.py]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_app
node_app -->|"registers router"| node_auth
node_app -->|"registers router"| node_opportunity_api
node_app -->|"registers router"| node_recommendation_api
node_app -->|"registers router"| node_notifications_api
node_app -->|"registers router"| node_profiles
node_app -->|"registers router"| node_bookmarks
node_app -->|"registers router"| node_proposals
node_app -->|"registers router"| node_admin
node_app -->|"registers router"| node_predictor
node_app -->|"registers router"| node_analytics
node_app -->|"starts scheduler"| node_scheduler
node_auth -->|"uses token helpers"| node_security
node_auth -->|"sends reset email"| node_email_service
node_scraper -.->|"enriches listings"| node_enrichment
node_notification_service -->|"gets matches"| node_recommender
node_notification_service -->|"creates notifications"| node_notification_model
node_scheduler -.->|"uses scraper"| node_scraper
node_scheduler -.->|"uses notifier"| node_notification_service
node_database -->|"provides ORM base"| node_opportunity_model
node_database -->|"provides ORM base"| node_profile_model
node_database -->|"provides ORM base"| node_user_model
node_database -->|"provides ORM base"| node_session_model
node_database -->|"provides ORM base"| node_bookmark_model
node_database -->|"provides ORM base"| node_notification_model
node_database -->|"provides ORM base"| node_recommendation_model

click node_app "https://github.com/bultut-yegon/funding_backend/blob/main/app/main.py"
click node_auth "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/auth.py"
click node_security "https://github.com/bultut-yegon/funding_backend/blob/main/app/core/security.py"
click node_profiles "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/profile.py"
click node_bookmarks "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/bookmarks.py"
click node_notifications_api "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/notifications.py"
click node_analytics "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/analytics.py"
click node_proposals "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/proposals.py"
click node_admin "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/admin.py"
click node_opportunity_api "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/opportunities.py"
click node_recommendation_api "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/recommendations.py"
click node_predictor "https://github.com/bultut-yegon/funding_backend/blob/main/app/api/predictor.py"
click node_recommender "https://github.com/bultut-yegon/funding_backend/blob/main/app/ml/recommender.py"
click node_classifier "https://github.com/bultut-yegon/funding_backend/blob/main/app/ml/classifier.py"
click node_scraper "https://github.com/bultut-yegon/funding_backend/blob/main/app/services/scraper.py"
click node_enrichment "https://github.com/bultut-yegon/funding_backend/blob/main/app/ml/enrichment.py"
click node_scheduler "https://github.com/bultut-yegon/funding_backend/blob/main/app/services/scheduler.py"
click node_notification_service "https://github.com/bultut-yegon/funding_backend/blob/main/app/services/notification_service.py"
click node_email_service "https://github.com/bultut-yegon/funding_backend/blob/main/app/services/email_service.py"
click node_database "https://github.com/bultut-yegon/funding_backend/blob/main/app/db/database.py"
click node_user_model "https://github.com/bultut-yegon/funding_backend/blob/main/app/models/user.py"
click node_session_model "https://github.com/bultut-yegon/funding_backend/blob/main/app/models/user_session.py"
click node_opportunity_model "https://github.com/bultut-yegon/funding_backend/blob/main/app/models/opportunity.py"
click node_profile_model "https://github.com/bultut-yegon/funding_backend/blob/main/app/models/profile.py"
click node_bookmark_model "https://github.com/bultut-yegon/funding_backend/blob/main/app/models/bookmark.py"
click node_notification_model "https://github.com/bultut-yegon/funding_backend/blob/main/app/models/notification.py"
click node_recommendation_model "https://github.com/bultut-yegon/funding_backend/blob/main/app/models/recommendation.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_app,node_client toneBlue
class node_auth,node_security,node_profiles,node_bookmarks,node_notifications_api,node_analytics,node_proposals,node_admin toneAmber
class node_opportunity_api,node_recommendation_api,node_predictor,node_recommender,node_classifier toneMint
class node_scraper,node_enrichment,node_scheduler,node_notification_service,node_email_service toneRose
class node_database,node_user_model,node_session_model,node_opportunity_model,node_profile_model,node_bookmark_model,node_notification_model,node_recommendation_model toneIndigo
```

## Components

### API entry

- [FastAPI app](https://github.com/bultut-yegon/funding_backend/blob/main/app/main.py): `app/main.py`

### User features

- [Authentication](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/auth.py): `app/api/auth.py`
- [Token security](https://github.com/bultut-yegon/funding_backend/blob/main/app/core/security.py): `app/core/security.py`
- [User profiles](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/profile.py): `app/api/profile.py`
- [Bookmarks](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/bookmarks.py): `app/api/bookmarks.py`
- [Notifications API](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/notifications.py): `app/api/notifications.py`
- [Analytics API](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/analytics.py): `app/api/analytics.py`
- [Proposals API](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/proposals.py): `app/api/proposals.py`
- [Admin API](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/admin.py): `app/api/admin.py`

### Opportunity matching

- [Opportunity browsing](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/opportunities.py): `app/api/opportunities.py`
- [Recommendations API](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/recommendations.py): `app/api/recommendations.py`
- [Predictor API](https://github.com/bultut-yegon/funding_backend/blob/main/app/api/predictor.py): `app/api/predictor.py`
- [Recommendation engine](https://github.com/bultut-yegon/funding_backend/blob/main/app/ml/recommender.py): `app/ml/recommender.py`
- [Classifier](https://github.com/bultut-yegon/funding_backend/blob/main/app/ml/classifier.py): `app/ml/classifier.py`

### Background operations

- [Opportunity scraper](https://github.com/bultut-yegon/funding_backend/blob/main/app/services/scraper.py): `app/services/scraper.py`
- [Opportunity enrichment](https://github.com/bultut-yegon/funding_backend/blob/main/app/ml/enrichment.py): `app/ml/enrichment.py`
- [Task scheduler](https://github.com/bultut-yegon/funding_backend/blob/main/app/services/scheduler.py): `app/services/scheduler.py`
- [Email notifications](https://github.com/bultut-yegon/funding_backend/blob/main/app/services/notification_service.py): `app/services/notification_service.py`
- [Reset email](https://github.com/bultut-yegon/funding_backend/blob/main/app/services/email_service.py): `app/services/email_service.py`

### Persistence

- [SQL database](https://github.com/bultut-yegon/funding_backend/blob/main/app/db/database.py): `app/db/database.py`
- [User records](https://github.com/bultut-yegon/funding_backend/blob/main/app/models/user.py): `app/models/user.py`
- [User sessions](https://github.com/bultut-yegon/funding_backend/blob/main/app/models/user_session.py): `app/models/user_session.py`
- [Opportunity records](https://github.com/bultut-yegon/funding_backend/blob/main/app/models/opportunity.py): `app/models/opportunity.py`
- [Profile records](https://github.com/bultut-yegon/funding_backend/blob/main/app/models/profile.py): `app/models/profile.py`
- [Bookmark records](https://github.com/bultut-yegon/funding_backend/blob/main/app/models/bookmark.py): `app/models/bookmark.py`
- [Notification records](https://github.com/bultut-yegon/funding_backend/blob/main/app/models/notification.py): `app/models/notification.py`
- [Recommendation records](https://github.com/bultut-yegon/funding_backend/blob/main/app/models/recommendation.py): `app/models/recommendation.py`

### Other components

- **API client**

## Connections

- API client → FastAPI app: sends requests (evidence: `app/main.py`)
- FastAPI app → Authentication: registers router (evidence: `app/main.py`)
- FastAPI app → Opportunity browsing: registers router (evidence: `app/main.py`)
- FastAPI app → Recommendations API: registers router (evidence: `app/main.py`)
- FastAPI app → Notifications API: registers router (evidence: `app/main.py`)
- FastAPI app → User profiles: registers router (evidence: `app/main.py`)
- FastAPI app → Bookmarks: registers router (evidence: `app/main.py`)
- FastAPI app → Proposals API: registers router (evidence: `app/main.py`)
- FastAPI app → Admin API: registers router (evidence: `app/main.py`)
- FastAPI app → Predictor API: registers router (evidence: `app/main.py`)
- FastAPI app → Analytics API: registers router (evidence: `app/main.py`)
- FastAPI app → Task scheduler: starts scheduler (evidence: `app/main.py`)
- Authentication → Token security: uses token helpers (evidence: `app/api/auth.py`)
- Authentication → Reset email: sends reset email (evidence: `app/api/auth.py`)
- Opportunity scraper → Opportunity enrichment: enriches listings (evidence: `app/services/scraper.py`)
- Email notifications → Recommendation engine: gets matches (evidence: `app/services/notification_service.py`)
- Email notifications → Notification records: creates notifications (evidence: `app/services/notification_service.py`)
- Task scheduler → Opportunity scraper: uses scraper (evidence: `app/services/scheduler.py`)
- Task scheduler → Email notifications: uses notifier (evidence: `app/services/scheduler.py`)
- SQL database → Opportunity records: provides ORM base (evidence: `app/models/opportunity.py`)
- SQL database → Profile records: provides ORM base (evidence: `app/models/profile.py`)
- SQL database → User records: provides ORM base (evidence: `app/models/user.py`)
- SQL database → User sessions: provides ORM base (evidence: `app/models/user_session.py`)
- SQL database → Bookmark records: provides ORM base (evidence: `app/models/bookmark.py`)
- SQL database → Notification records: provides ORM base (evidence: `app/models/notification.py`)
- SQL database → Recommendation records: provides ORM base (evidence: `app/models/recommendation.py`)
