# richardadeniji/kre8new architecture

> Architecture diagram of the GitHub repository richardadeniji/kre8new, 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/richardadeniji/kre8new
- Repository: https://github.com/richardadeniji/kre8new
- Video tour (about a minute): https://gitdiagram.com/richardadeniji/kre8new/video

## Overview

KRE8 is a freelancer and creator marketplace. Users authenticate, build profiles and portfolios, discover or post gigs, apply and manage applications, then communicate and receive updates; admins oversee users and platform metrics. The React app routes users to these experiences, while the shared API client and Express backend connect them to marketplace services and PostgreSQL. The README documents further portfolio, real-time messaging, analytics and OAuth capabilities; sampled code confirms the routing, API methods, server entry point and file-storage integration, but not all wiring or implementation details.

Main entry points: [`backend/server.js`](https://github.com/richardadeniji/kre8new/blob/master/backend/server.js) (Express API server), [`src/App.js`](https://github.com/richardadeniji/kre8new/blob/master/src/App.js) (React app router), [`shared/api/client.js`](https://github.com/richardadeniji/kre8new/blob/master/shared/api/client.js) (Shared API client), [`backend/routes/auth.js`](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/auth.js) (Authentication API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["React app router<br/>[App.js]"]
  node_authpage["Sign in and signup<br/>[AuthPage.jsx]"]
  node_profileui["Profile and portfolio<br/>[Profile.js]"]
  node_gigbrowse["Browse gigs<br/>[GigsPage.js]"]
  node_gigdetail["Gig details<br/>[GigDetails.js]"]
  node_gigcreate["Create gig<br/>[CreateGigPage.js]"]
  node_applications["Application management"]
  node_adminui["Admin dashboard<br/>[AdminDashboard.js]"]
end

subgraph group_identity["Accounts and profiles"]
  node_usercontext["User state<br/>[UserContext.js]"]
  node_authroutes["Authentication API<br/>[auth.js]"]
  node_userroutes["User and profile API<br/>[users.js]"]
end

subgraph group_marketplace["Gig marketplace"]
  node_gigroutes["Gig and application API<br/>[gigs.js]"]
  node_savedroutes["Saved gigs API<br/>[savedGigs.js]"]
end

subgraph group_collaboration["Collaboration"]
  node_messageroutes["Messaging API<br/>[messages.js]"]
  node_notifyroutes["Notifications API<br/>[notifications.js]"]
  node_notificationstate["Notification state"]
end

subgraph group_platform["Platform services"]
  node_adminroutes["Administration API<br/>[admin.js]"]
  node_statsroutes["Metrics API<br/>[stats.js]"]
  node_server["Express API server<br/>[server.js]"]
  node_client["Shared API client<br/>[client.js]"]
  node_database[("PostgreSQL")]
  node_storage[("Cloudflare R2")]
  node_storage_service["File storage service<br/>[storage.js]"]
end

node_creators(("Creators and clients"))
node_google(("Google OAuth"))
node_resend(("Resend email"))

node_creators -->|"use marketplace"| node_app
node_app -->|"routes to"| node_authpage
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_gigbrowse
node_app -->|"routes to"| node_gigdetail
node_app -->|"routes to"| node_gigcreate
node_app -->|"routes to"| node_applications
node_app -->|"routes to"| node_adminui
node_authpage -->|"updates account state"| node_usercontext
node_profileui -->|"requests profile data"| node_client
node_gigbrowse -->|"requests gigs"| node_client
node_gigdetail -->|"requests gig details"| node_client
node_gigcreate -->|"submits gig"| node_client
node_applications -->|"manages applications"| node_client
node_adminui -->|"requests admin data"| node_client
node_client -->|"sends API requests"| node_server
node_server -->|"dispatches auth"| node_authroutes
node_server -->|"dispatches users"| node_userroutes
node_server -->|"dispatches gigs"| node_gigroutes
node_server -->|"dispatches saved gigs"| node_savedroutes
node_server -->|"dispatches messages"| node_messageroutes
node_server -->|"dispatches notifications"| node_notifyroutes
node_server -->|"dispatches admin"| node_adminroutes
node_server -->|"dispatches metrics"| node_statsroutes
node_authroutes -->|"reads and writes"| node_database
node_userroutes -->|"reads and writes"| node_database
node_gigroutes -->|"reads and writes"| node_database
node_savedroutes -->|"reads and writes"| node_database
node_messageroutes -->|"reads and writes"| node_database
node_notifyroutes -->|"reads and writes"| node_database
node_adminroutes -->|"reads and writes"| node_database
node_statsroutes -->|"queries metrics"| node_database
node_authroutes -.->|"OAuth authentication"| node_google
node_userroutes -->|"uploads profile files"| node_storage_service
node_storage_service -->|"uploads and deletes"| node_storage
node_notificationstate -->|"loads notifications"| node_client
node_notifyroutes -.->|"sends email"| node_resend

click node_app "https://github.com/richardadeniji/kre8new/blob/master/src/App.js"
click node_authpage "https://github.com/richardadeniji/kre8new/blob/master/src/pages/AuthPage.jsx"
click node_profileui "https://github.com/richardadeniji/kre8new/blob/master/src/pages/Profile.js"
click node_gigbrowse "https://github.com/richardadeniji/kre8new/blob/master/src/pages/GigsPage.js"
click node_gigdetail "https://github.com/richardadeniji/kre8new/blob/master/src/pages/GigDetails.js"
click node_gigcreate "https://github.com/richardadeniji/kre8new/blob/master/src/pages/CreateGigPage.js"
click node_applications "https://github.com/richardadeniji/kre8new/blob/master/src/pages/ApplicationManagement.js"
click node_adminui "https://github.com/richardadeniji/kre8new/blob/master/src/pages/AdminDashboard.js"
click node_usercontext "https://github.com/richardadeniji/kre8new/blob/master/src/context/UserContext.js"
click node_authroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/auth.js"
click node_userroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/users.js"
click node_gigroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/gigs.js"
click node_savedroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/savedGigs.js"
click node_messageroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/messages.js"
click node_notifyroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/notifications.js"
click node_notificationstate "https://github.com/richardadeniji/kre8new/blob/master/src/context/NotificationContext.js"
click node_adminroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/admin.js"
click node_statsroutes "https://github.com/richardadeniji/kre8new/blob/master/backend/routes/stats.js"
click node_server "https://github.com/richardadeniji/kre8new/blob/master/backend/server.js"
click node_client "https://github.com/richardadeniji/kre8new/blob/master/shared/api/client.js"
click node_storage_service "https://github.com/richardadeniji/kre8new/blob/master/backend/services/storage.js"

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_authpage,node_profileui,node_gigbrowse,node_gigdetail,node_gigcreate,node_applications,node_adminui,node_creators toneBlue
class node_usercontext,node_authroutes,node_userroutes toneAmber
class node_gigroutes,node_savedroutes toneMint
class node_messageroutes,node_notifyroutes,node_notificationstate toneRose
class node_adminroutes,node_statsroutes,node_server,node_client,node_database,node_storage,node_storage_service,node_google,node_resend toneIndigo
```

## Components

### Web experience

- [React app router](https://github.com/richardadeniji/kre8new/blob/master/src/App.js): `src/App.js`
- [Sign in and signup](https://github.com/richardadeniji/kre8new/blob/master/src/pages/AuthPage.jsx): `src/pages/AuthPage.jsx`
- [Profile and portfolio](https://github.com/richardadeniji/kre8new/blob/master/src/pages/Profile.js): `src/pages/Profile.js`
- [Browse gigs](https://github.com/richardadeniji/kre8new/blob/master/src/pages/GigsPage.js): `src/pages/GigsPage.js`
- [Gig details](https://github.com/richardadeniji/kre8new/blob/master/src/pages/GigDetails.js): `src/pages/GigDetails.js`
- [Create gig](https://github.com/richardadeniji/kre8new/blob/master/src/pages/CreateGigPage.js): `src/pages/CreateGigPage.js`
- [Application management](https://github.com/richardadeniji/kre8new/blob/master/src/pages/ApplicationManagement.js): `src/pages/ApplicationManagement.js`
- [Admin dashboard](https://github.com/richardadeniji/kre8new/blob/master/src/pages/AdminDashboard.js): `src/pages/AdminDashboard.js`

### Accounts and profiles

- [User state](https://github.com/richardadeniji/kre8new/blob/master/src/context/UserContext.js): `src/context/UserContext.js`
- [Authentication API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/auth.js): `backend/routes/auth.js`
- [User and profile API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/users.js): `backend/routes/users.js`

### Gig marketplace

- [Gig and application API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/gigs.js): `backend/routes/gigs.js`
- [Saved gigs API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/savedGigs.js): `backend/routes/savedGigs.js`

### Collaboration

- [Messaging API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/messages.js): `backend/routes/messages.js`
- [Notifications API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/notifications.js): `backend/routes/notifications.js`
- [Notification state](https://github.com/richardadeniji/kre8new/blob/master/src/context/NotificationContext.js): `src/context/NotificationContext.js`

### Platform services

- [Administration API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/admin.js): `backend/routes/admin.js`
- [Metrics API](https://github.com/richardadeniji/kre8new/blob/master/backend/routes/stats.js): `backend/routes/stats.js`
- [Express API server](https://github.com/richardadeniji/kre8new/blob/master/backend/server.js): `backend/server.js`
- [Shared API client](https://github.com/richardadeniji/kre8new/blob/master/shared/api/client.js): `shared/api/client.js`
- **PostgreSQL**
- **Cloudflare R2**
- [File storage service](https://github.com/richardadeniji/kre8new/blob/master/backend/services/storage.js): `backend/services/storage.js`

### Other components

- **Creators and clients**
- **Google OAuth**
- **Resend email**

## Connections

- Creators and clients → React app router: use marketplace
- React app router → Sign in and signup: routes to
- React app router → Profile and portfolio: routes to
- React app router → Browse gigs: routes to
- React app router → Gig details: routes to
- React app router → Create gig: routes to
- React app router → Application management: routes to
- React app router → Admin dashboard: routes to
- Sign in and signup → User state: updates account state
- Profile and portfolio → Shared API client: requests profile data
- Browse gigs → Shared API client: requests gigs
- Gig details → Shared API client: requests gig details
- Create gig → Shared API client: submits gig
- Application management → Shared API client: manages applications
- Admin dashboard → Shared API client: requests admin data
- Shared API client → Express API server: sends API requests
- Express API server → Authentication API: dispatches auth
- Express API server → User and profile API: dispatches users
- Express API server → Gig and application API: dispatches gigs
- Express API server → Saved gigs API: dispatches saved gigs
- Express API server → Messaging API: dispatches messages
- Express API server → Notifications API: dispatches notifications
- Express API server → Administration API: dispatches admin
- Express API server → Metrics API: dispatches metrics
- Authentication API → PostgreSQL: reads and writes
- User and profile API → PostgreSQL: reads and writes
- Gig and application API → PostgreSQL: reads and writes
- Saved gigs API → PostgreSQL: reads and writes
- Messaging API → PostgreSQL: reads and writes
- Notifications API → PostgreSQL: reads and writes
- Administration API → PostgreSQL: reads and writes
- Metrics API → PostgreSQL: queries metrics
- Authentication API → Google OAuth: OAuth authentication
- User and profile API → File storage service: uploads profile files
- File storage service → Cloudflare R2: uploads and deletes
- Notification state → Shared API client: loads notifications
- Notifications API → Resend email: sends email
