# adambudzinak/asos_projekt architecture

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

- Interactive diagram: https://gitdiagram.com/adambudzinak/asos_projekt
- Repository: https://github.com/adambudzinak/asos_projekt

## Overview

InstaLite is a photo-sharing social application: users register or sign in, then browse feeds and profiles, follow people, and interact with photos through comments, reactions, and reposts. The React client calls an Express API; protected routes dispatch to domain controllers, which use Prisma for persistence. The README documents PostgreSQL as the database. The graph preserves the documented product areas, but some frontend-to-API links are dashed because the excerpts do not establish their implementation-level wiring.

Main entry points: [`backend/src/user/router.ts`](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/router.ts) (User API routes), [`backend/src/server.ts`](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/server.ts) (Express server), [`frontend/src/common/PhotoModal.tsx`](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/PhotoModal.tsx) (Photo interactions), [`frontend/src/user/profile/Profile.tsx`](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/profile/Profile.tsx) (Profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App session<br/>[App.tsx]"]
  node_authui["Sign in and register<br/>[AuthScreen.tsx]"]
  node_home["Home navigation<br/>[HomeScreen.tsx]"]
  node_feedui["Feed browser<br/>[Feed.tsx]"]
  node_peopleui["People search<br/>[People.tsx]"]
  node_profileui["Profile<br/>[Profile.tsx]"]
  node_otherprofile["User profile<br/>[UserProfile.tsx]"]
  node_photomodal["Photo interactions<br/>[PhotoModal.tsx]"]
  node_followersui["Followers view<br/>[FollowersModal.tsx]"]
  node_reactionsui["Reaction details<br/>[ReactionsModal.tsx]"]
  node_uploadui["Photo upload<br/>[UploadModal.tsx]"]
  node_httpclient["HTTP client<br/>[CrossOrigin.tsx]"]
end

subgraph group_api["API and identity"]
  node_server["Express server<br/>[server.ts]"]
  node_guest["Guest authentication<br/>[guest.ts]"]
  node_authlogic["Token and passwords<br/>[auth.ts]"]
  node_protection["Route protection<br/>[protect-route.ts]"]
  node_router["User API routes<br/>[router.ts]"]
end

subgraph group_social["Social activity"]
  node_users["User and avatar<br/>[user.ts]"]
  node_follows["Follow relations<br/>[follow.ts]"]
  node_comments["Photo comments<br/>[comment.ts]"]
  node_reactions["Photo reactions<br/>[reaction.ts]"]
  node_reposts["Photo reposts<br/>[repost.ts]"]
end

subgraph group_media["Photos and feeds"]
  node_photos["Photo management<br/>[photo.ts]"]
  node_feedapi["Feeds and tags<br/>[feed.ts]"]
  node_uploadmiddleware["Upload handling<br/>[multer-config.ts]"]
end

subgraph group_storage["Persistence"]
  node_prisma["Prisma client<br/>[database.ts]"]
  node_postgres[("PostgreSQL")]
end

node_person(("User"))

node_person -->|"uses"| node_app
node_app -->|"shows signed out"| node_authui
node_app -->|"shows signed in"| node_home
node_authui -->|"submits credentials"| node_httpclient
node_home -->|"renders"| node_feedui
node_home -->|"renders"| node_peopleui
node_home -->|"renders"| node_profileui
node_feedui -->|"opens photo"| node_photomodal
node_peopleui -->|"opens profile"| node_otherprofile
node_otherprofile -->|"opens photo"| node_photomodal
node_profileui -->|"opens photo"| node_photomodal
node_profileui -->|"opens upload"| node_uploadui
node_photomodal -->|"opens details"| node_reactionsui
node_photomodal -->|"requests photo actions"| node_httpclient
node_feedui -->|"requests feeds"| node_httpclient
node_profileui -->|"requests profile data"| node_httpclient
node_otherprofile -->|"shows followers"| node_followersui
node_server -->|"routes sign-in"| node_guest
node_server -->|"protects API"| node_protection
node_server -->|"mounts API"| node_router
node_protection -->|"permits requests"| node_router
node_guest -->|"uses auth helpers"| node_authlogic
node_router -->|"dispatches user routes"| node_users
node_router -->|"dispatches follow routes"| node_follows
node_router -->|"dispatches photo routes"| node_photos
node_router -->|"handles uploads"| node_uploadmiddleware
node_router -->|"dispatches comment routes"| node_comments
node_router -->|"dispatches repost routes"| node_reposts
node_router -->|"dispatches feed routes"| node_feedapi
node_router -->|"dispatches reaction routes"| node_reactions
node_users -->|"queries data"| node_prisma
node_follows -->|"queries data"| node_prisma
node_feedapi -->|"queries data"| node_prisma
node_reactions -->|"queries data"| node_prisma
node_prisma -.->|"persists records"| node_postgres
node_authui -.->|"calls auth endpoints"| node_server
node_feedui -.->|"calls feed endpoints"| node_server
node_profileui -.->|"calls profile endpoints"| node_server
node_photomodal -.->|"calls photo endpoints"| node_server

click node_app "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/index/AuthScreen.tsx"
click node_home "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/home-screen/HomeScreen.tsx"
click node_feedui "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/feed/Feed.tsx"
click node_peopleui "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/people/People.tsx"
click node_profileui "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/profile/Profile.tsx"
click node_otherprofile "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/people/UserProfile.tsx"
click node_photomodal "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/PhotoModal.tsx"
click node_followersui "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/FollowersModal.tsx"
click node_reactionsui "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/ReactionsModal.tsx"
click node_uploadui "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/UploadModal.tsx"
click node_httpclient "https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/auth/CrossOrigin.tsx"
click node_server "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/server.ts"
click node_guest "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/index/controller/guest.ts"
click node_authlogic "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/index/controller/auth.ts"
click node_protection "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/index/middleware/protect-route.ts"
click node_router "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/router.ts"
click node_users "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/user.ts"
click node_follows "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/follow.ts"
click node_comments "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/comment.ts"
click node_reactions "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/reaction.ts"
click node_reposts "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/repost.ts"
click node_photos "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/photo.ts"
click node_feedapi "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/feed.ts"
click node_uploadmiddleware "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/middleware/multer-config.ts"
click node_prisma "https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/database.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_authui,node_home,node_feedui,node_peopleui,node_profileui,node_otherprofile,node_photomodal,node_followersui,node_reactionsui,node_uploadui,node_httpclient,node_person toneBlue
class node_server,node_guest,node_authlogic,node_protection,node_router toneAmber
class node_users,node_follows,node_comments,node_reactions,node_reposts toneMint
class node_photos,node_feedapi,node_uploadmiddleware toneRose
class node_prisma,node_postgres toneIndigo
```

## Components

### Web client

- [App session](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign in and register](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/index/AuthScreen.tsx): `frontend/src/index/AuthScreen.tsx`
- [Home navigation](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/home-screen/HomeScreen.tsx): `frontend/src/user/home-screen/HomeScreen.tsx`
- [Feed browser](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/feed/Feed.tsx): `frontend/src/user/feed/Feed.tsx`
- [People search](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/people/People.tsx): `frontend/src/user/people/People.tsx`
- [Profile](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/profile/Profile.tsx): `frontend/src/user/profile/Profile.tsx`
- [User profile](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/user/people/UserProfile.tsx): `frontend/src/user/people/UserProfile.tsx`
- [Photo interactions](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/PhotoModal.tsx): `frontend/src/common/PhotoModal.tsx`
- [Followers view](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/FollowersModal.tsx): `frontend/src/common/FollowersModal.tsx`
- [Reaction details](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/ReactionsModal.tsx): `frontend/src/common/ReactionsModal.tsx`
- [Photo upload](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/common/UploadModal.tsx): `frontend/src/common/UploadModal.tsx`
- [HTTP client](https://github.com/adambudzinak/asos_projekt/blob/main/frontend/src/auth/CrossOrigin.tsx): `frontend/src/auth/CrossOrigin.tsx`

### API and identity

- [Express server](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Guest authentication](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/index/controller/guest.ts): `backend/src/index/controller/guest.ts`
- [Token and passwords](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/index/controller/auth.ts): `backend/src/index/controller/auth.ts`
- [Route protection](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/index/middleware/protect-route.ts): `backend/src/index/middleware/protect-route.ts`
- [User API routes](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/router.ts): `backend/src/user/router.ts`

### Social activity

- [User and avatar](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/user.ts): `backend/src/user/controller/user.ts`
- [Follow relations](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/follow.ts): `backend/src/user/controller/follow.ts`
- [Photo comments](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/comment.ts): `backend/src/user/controller/comment.ts`
- [Photo reactions](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/reaction.ts): `backend/src/user/controller/reaction.ts`
- [Photo reposts](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/repost.ts): `backend/src/user/controller/repost.ts`

### Photos and feeds

- [Photo management](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/photo.ts): `backend/src/user/controller/photo.ts`
- [Feeds and tags](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/controller/feed.ts): `backend/src/user/controller/feed.ts`
- [Upload handling](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/user/middleware/multer-config.ts): `backend/src/user/middleware/multer-config.ts`

### Persistence

- [Prisma client](https://github.com/adambudzinak/asos_projekt/blob/main/backend/src/database.ts): `backend/src/database.ts`
- **PostgreSQL**

### Other components

- **User**

## Connections

- User → App session: uses (evidence: `frontend/src/App.tsx`)
- App session → Sign in and register: shows signed out (evidence: `frontend/src/App.tsx`)
- App session → Home navigation: shows signed in (evidence: `frontend/src/App.tsx`)
- Sign in and register → HTTP client: submits credentials (evidence: `frontend/src/index/AuthScreen.tsx`)
- Home navigation → Feed browser: renders (evidence: `frontend/src/user/home-screen/HomeScreen.tsx`)
- Home navigation → People search: renders (evidence: `frontend/src/user/home-screen/HomeScreen.tsx`)
- Home navigation → Profile: renders (evidence: `frontend/src/user/home-screen/HomeScreen.tsx`)
- Feed browser → Photo interactions: opens photo (evidence: `frontend/src/user/feed/Feed.tsx`)
- People search → User profile: opens profile (evidence: `frontend/src/user/people/People.tsx`)
- User profile → Photo interactions: opens photo (evidence: `frontend/src/user/people/UserProfile.tsx`)
- Profile → Photo interactions: opens photo (evidence: `frontend/src/user/profile/Profile.tsx`)
- Profile → Photo upload: opens upload (evidence: `frontend/src/user/profile/Profile.tsx`)
- Photo interactions → Reaction details: opens details (evidence: `frontend/src/common/PhotoModal.tsx`)
- Photo interactions → HTTP client: requests photo actions (evidence: `frontend/src/common/PhotoModal.tsx`)
- Feed browser → HTTP client: requests feeds (evidence: `frontend/src/user/feed/Feed.tsx`)
- Profile → HTTP client: requests profile data (evidence: `frontend/src/user/profile/Profile.tsx`)
- User profile → Followers view: shows followers (evidence: `frontend/src/user/people/UserProfile.tsx`)
- Express server → Guest authentication: routes sign-in (evidence: `backend/src/server.ts`)
- Express server → Route protection: protects API (evidence: `backend/src/server.ts`)
- Express server → User API routes: mounts API (evidence: `backend/src/server.ts`)
- Route protection → User API routes: permits requests (evidence: `backend/src/server.ts`)
- Guest authentication → Token and passwords: uses auth helpers (evidence: `backend/src/index/controller/guest.ts`)
- User API routes → User and avatar: dispatches user routes (evidence: `backend/src/user/router.ts`)
- User API routes → Follow relations: dispatches follow routes (evidence: `backend/src/user/router.ts`)
- User API routes → Photo management: dispatches photo routes (evidence: `backend/src/user/router.ts`)
- User API routes → Upload handling: handles uploads (evidence: `backend/src/user/router.ts`)
- User API routes → Photo comments: dispatches comment routes (evidence: `backend/src/user/router.ts`)
- User API routes → Photo reposts: dispatches repost routes (evidence: `backend/src/user/router.ts`)
- User API routes → Feeds and tags: dispatches feed routes (evidence: `backend/src/user/router.ts`)
- User API routes → Photo reactions: dispatches reaction routes (evidence: `backend/src/user/router.ts`)
- User and avatar → Prisma client: queries data (evidence: `backend/src/user/controller/user.ts`)
- Follow relations → Prisma client: queries data (evidence: `backend/src/user/controller/follow.ts`)
- Feeds and tags → Prisma client: queries data (evidence: `backend/src/user/controller/feed.ts`)
- Photo reactions → Prisma client: queries data (evidence: `backend/src/user/controller/reaction.ts`)
- Prisma client → PostgreSQL: persists records (evidence: `README.md`)
- Sign in and register → Express server: calls auth endpoints
- Feed browser → Express server: calls feed endpoints
- Profile → Express server: calls profile endpoints
- Photo interactions → Express server: calls photo endpoints
