# ahmedrah33m/midano3 architecture

> Architecture diagram of the GitHub repository ahmedrah33m/midano3, 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/ahmedrah33m/midano3
- Repository: https://github.com/ahmedrah33m/midano3

## Overview

Midan is presented as an Iraqi economic and professional platform, with a premium mobile design system and a substantial set of prototype screens. Its documented user journey spans onboarding and authentication into social discovery, professional networking, jobs, market information, learning, events, and wallet features. The tree also shows Next.js API routes and a Python API service; sampled Next.js handlers directly use shared authentication helpers and the database. UI-to-API wiring and Python service internals were not sampled, so those links are not asserted.

Main entry points: [`src/lib/auth.ts`](https://github.com/ahmedrah33m/midano3/blob/main/src/lib/auth.ts) (Auth helpers), [`src/lib/db.ts`](https://github.com/ahmedrah33m/midano3/blob/main/src/lib/db.ts) (Application database), [`src/app/api/posts/feed/route.ts`](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/posts/feed/route.ts) (Feed & post API), [`src/app/api/posts/[id]/route.ts`](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/posts/%5Bid%5D/route.ts) (Post detail API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Mobile Experience"]
  node_app["App entry<br/>[page.tsx]"]
  node_viewer["Prototype viewer"]
  node_screenauth["Onboarding &amp; auth"]
  node_screenfeed["Feed screens<br/>[home-feed.tsx]"]
  node_screenprofile["Profile screens"]
  node_screensjobs["Jobs &amp; experts"]
  node_screeneconomy["Economic screens"]
  node_midanui["Midan UI kit<br/>[index.tsx]"]
end

subgraph group_community["Community &amp; Careers"]
  node_feedapi["Feed &amp; post API<br/>[route.ts]"]
  node_postdetail["Post detail API<br/>[route.ts]"]
  node_profileapi["Profile API<br/>[route.ts]"]
  node_jobsapi["Jobs API<br/>[route.ts]"]
  node_expertsapi["Experts API<br/>[route.ts]"]
  node_notificationsapi["Notifications API<br/>[route.ts]"]
end

subgraph group_economy["Economy &amp; Learning"]
  node_economicapi["Market dashboard API<br/>[route.ts]"]
  node_eventsapi["Events API<br/>[route.ts]"]
  node_coursesapi["Courses API<br/>[route.ts]"]
  node_walletapi["Wallet API<br/>[route.ts]"]
end

subgraph group_services["API &amp; Data"]
  node_authapi["Authentication API<br/>[route.ts]"]
  node_authlib["Auth helpers<br/>[auth.ts]"]
  node_db[("Application database<br/>[db.ts]")]
end

node_user(("Platform user"))

node_user -->|"opens"| node_app
node_authapi -->|"uses helpers"| node_authlib
node_feedapi -->|"uses helpers"| node_authlib
node_postdetail -->|"uses helpers"| node_authlib
node_profileapi -->|"uses helpers"| node_authlib
node_jobsapi -->|"formats results"| node_authlib
node_notificationsapi -->|"uses helpers"| node_authlib
node_economicapi -->|"formats results"| node_authlib
node_eventsapi -->|"formats results"| node_authlib
node_coursesapi -->|"formats results"| node_authlib
node_walletapi -->|"uses helpers"| node_authlib
node_feedapi -->|"reads and writes"| node_db
node_postdetail -->|"reads and updates"| node_db
node_profileapi -->|"reads and writes"| node_db
node_jobsapi -->|"reads"| node_db
node_expertsapi -->|"reads"| node_db
node_notificationsapi -->|"reads and updates"| node_db
node_economicapi -->|"reads"| node_db
node_eventsapi -->|"reads"| node_db
node_coursesapi -->|"reads"| node_db
node_walletapi -->|"reads"| node_db

click node_app "https://github.com/ahmedrah33m/midano3/blob/main/src/app/page.tsx"
click node_viewer "https://github.com/ahmedrah33m/midano3/blob/main/src/components/showcase/prototype-viewer.tsx"
click node_screenauth "https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/onboarding-auth.tsx"
click node_screenfeed "https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/home-feed.tsx"
click node_screenprofile "https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/profile-company-job-expert.tsx"
click node_screensjobs "https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/jobs-experts-extra.tsx"
click node_screeneconomy "https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/dashboard-investment-training-events.tsx"
click node_midanui "https://github.com/ahmedrah33m/midano3/blob/main/src/components/midan-ui/index.tsx"
click node_authapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/auth/login/route.ts"
click node_authlib "https://github.com/ahmedrah33m/midano3/blob/main/src/lib/auth.ts"
click node_feedapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/posts/feed/route.ts"
click node_postdetail "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/posts/%5Bid%5D/route.ts"
click node_profileapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/users/me/route.ts"
click node_jobsapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/jobs/route.ts"
click node_expertsapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/experts/route.ts"
click node_notificationsapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/notifications/route.ts"
click node_economicapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/economic/dashboard/route.ts"
click node_eventsapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/events/route.ts"
click node_coursesapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/courses/route.ts"
click node_walletapi "https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/wallet/route.ts"
click node_db "https://github.com/ahmedrah33m/midano3/blob/main/src/lib/db.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_app,node_viewer,node_screenauth,node_screenfeed,node_screenprofile,node_screensjobs,node_screeneconomy,node_midanui,node_user toneBlue
class node_feedapi,node_postdetail,node_profileapi,node_jobsapi,node_expertsapi,node_notificationsapi toneAmber
class node_economicapi,node_eventsapi,node_coursesapi,node_walletapi toneMint
class node_authapi,node_authlib,node_db toneRose
```

## Components

### Mobile Experience

- [App entry](https://github.com/ahmedrah33m/midano3/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Prototype viewer](https://github.com/ahmedrah33m/midano3/blob/main/src/components/showcase/prototype-viewer.tsx): `src/components/showcase/prototype-viewer.tsx`
- [Onboarding & auth](https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/onboarding-auth.tsx): `src/components/screens/onboarding-auth.tsx`
- [Feed screens](https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/home-feed.tsx): `src/components/screens/home-feed.tsx`
- [Profile screens](https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/profile-company-job-expert.tsx): `src/components/screens/profile-company-job-expert.tsx`
- [Jobs & experts](https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/jobs-experts-extra.tsx): `src/components/screens/jobs-experts-extra.tsx`
- [Economic screens](https://github.com/ahmedrah33m/midano3/blob/main/src/components/screens/dashboard-investment-training-events.tsx): `src/components/screens/dashboard-investment-training-events.tsx`
- [Midan UI kit](https://github.com/ahmedrah33m/midano3/blob/main/src/components/midan-ui/index.tsx): `src/components/midan-ui/index.tsx`

### Community & Careers

- [Feed & post API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/posts/feed/route.ts): `src/app/api/posts/feed/route.ts`
- [Post detail API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/posts/%5Bid%5D/route.ts): `src/app/api/posts/[id]/route.ts`
- [Profile API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/users/me/route.ts): `src/app/api/users/me/route.ts`
- [Jobs API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/jobs/route.ts): `src/app/api/jobs/route.ts`
- [Experts API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/experts/route.ts): `src/app/api/experts/route.ts`
- [Notifications API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/notifications/route.ts): `src/app/api/notifications/route.ts`

### Economy & Learning

- [Market dashboard API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/economic/dashboard/route.ts): `src/app/api/economic/dashboard/route.ts`
- [Events API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/events/route.ts): `src/app/api/events/route.ts`
- [Courses API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/courses/route.ts): `src/app/api/courses/route.ts`
- [Wallet API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/wallet/route.ts): `src/app/api/wallet/route.ts`

### API & Data

- [Authentication API](https://github.com/ahmedrah33m/midano3/blob/main/src/app/api/auth/login/route.ts): `src/app/api/auth/login/route.ts`
- [Auth helpers](https://github.com/ahmedrah33m/midano3/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Application database](https://github.com/ahmedrah33m/midano3/blob/main/src/lib/db.ts): `src/lib/db.ts`

### Other components

- **Platform user**

## Connections

- Platform user → App entry: opens
- Authentication API → Auth helpers: uses helpers
- Feed & post API → Auth helpers: uses helpers
- Post detail API → Auth helpers: uses helpers
- Profile API → Auth helpers: uses helpers
- Jobs API → Auth helpers: formats results
- Notifications API → Auth helpers: uses helpers
- Market dashboard API → Auth helpers: formats results
- Events API → Auth helpers: formats results
- Courses API → Auth helpers: formats results
- Wallet API → Auth helpers: uses helpers
- Feed & post API → Application database: reads and writes
- Post detail API → Application database: reads and updates
- Profile API → Application database: reads and writes
- Jobs API → Application database: reads
- Experts API → Application database: reads
- Notifications API → Application database: reads and updates
- Market dashboard API → Application database: reads
- Events API → Application database: reads
- Courses API → Application database: reads
- Wallet API → Application database: reads
