How mohamedamine050/findini works
1. Overall shape
- This repo is a two-tier crowdfunding system called Findini:
- a Node.js/Express backend API in backend/
- a React Native + Expo mobile app in Frontend/ and a near-duplicate copy in my-app/
- The mobile app consumes the API over HTTP; the backend owns authentication, persistence, and file uploads.
2. Backend boundary
- backend/server.js is the entry point.
- backend/config/db.js connects the app to MySQL.
- The backend is organized in classic layers: routes → controllers → middleware → storage.
3. API surface
- Routes are split by domain:
- routes/auth.js for signup/login/profile
- routes/user.js for user administration
- routes/categories.js for project categories
- routes/projects.js for crowdfunding projects
- This means the main backend architecture is a REST API centered on users, categories, and projects.
4. Business logic layer
- Controllers in backend/controllers/ contain the application rules:
- authController.js handles registration, login, logout, and profile updates
- categoryController.js manages category CRUD
- projectController.js manages project listing/creation
- userController.js handles user listing/deletion
- The controllers are the main place where database and authentication logic meet.
5. Security and request flow
- backend/middleware/authenticate.js protects private endpoints with JWT-based auth.
- bcryptjs is used for password hashing per the README.
- The expected flow is: login/register → issue JWT → client stores token → authenticated requests include that token for protected routes.
6. File upload and static content
- backend/middleware/upload.js handles multipart uploads, likely using Multer.
- Uploaded images are stored under backend/public/uploads/ and are meant to be served back as static assets.
- This is important architecturally because project/category images are not just metadata; they are a separate file-storage concern.
7. Frontend app structure
- The mobile app is split into:
- screnn/ for user-facing screens
- screenadmin/ for administrator screens
- navigation/ for tab/navigation composition
- App.js and index.js are the entry points, with MainTabNavigator.js defining the main app flow.
8. Client-side feature areas
- User screens cover:
- login/register
- home
- category browsing
- profile
- donation history
- support, terms, privacy
- Admin screens cover:
- category management
- project list/status
- user list
- adding categories
- This implies a role-based UI split even though both roles live in the same mobile codebase.
9. Client-server data flow
- The app likely uses Axios to call the backend endpoints listed in the README.
- Auth state is probably persisted with AsyncStorage.
- Image selection/upload on the client is supported by expo-image-picker, then sent to the backend upload middleware.
- Categories and projects flow from MySQL → controllers → JSON API → mobile screens.
10. Duplicate mobile app folder
- Frontend/ and my-app/ appear to contain the same React Native project structure and screen set.
- For architecture-diagram purposes, treat this as either a duplicated app snapshot or an alternate working copy; the functional architecture is the same.
11. Operational assets
- backend/public/uploads/ contains persisted uploaded media on the server side.
- The mobile app also has local public/ image folders for bundled assets and category artwork.
- demo_mobile.mp4, the GitHub Action workflow, and untitled1.ipynb are ancillary and do not change the runtime architecture.
12. What to diagram
- The key diagram should show:
- mobile client UI split into user/admin screens
- REST calls into the Express backend
- auth middleware on protected routes
- controllers using MySQL
- upload middleware writing files to public/uploads
- The main trust boundary is between the mobile app and the backend API; the main data boundary is between the API and MySQL/file storage.
Main entry points: db.js MySQL · server.js Server entry · projectController.js Project controller · authenticate.js Auth middleware
Components 19
Mobile client
React Native + Expo app; `my-app/` is a near-duplicate working copy of `Frontend/`.
- Mobile app · Primary React Native app; duplicated in `Frontend/` and `my-app/`.
Frontend/App.js - App entry · Application entrypoint for the mobile runtime.
Frontend/index.js - Main nav · Primary tab/navigation composition.
Frontend/navigation/MainTabNavigator.js - User screens · Login, register, home, profile, categories, and support/legal screens.
Frontend/screnn - Admin screens · Category, project, and user management screens.
Frontend/screenadmin - API access · Client-side HTTP calls, token handling, and upload requests.
Backend API
Express REST service with layered routing, controllers, auth, and upload handling.
- Server entry · Backend application startup and route mounting.
backend/server.js - Auth routes · Signup, login, profile, and session endpoints.
backend/routes/auth.js - User routes · User administration endpoints.
backend/routes/user.js - Category routes · Category CRUD endpoints.
backend/routes/categories.js - Project routes · Crowdfunding project endpoints.
backend/routes/projects.js - Auth controller · Registration, login, logout, and profile updates.
backend/controllers/authController.js - User controller · User listing and deletion logic.
backend/controllers/userController.js - Category controller · Category CRUD and related rules.
backend/controllers/categoryController.js - Project controller · Project listing and creation logic.
backend/controllers/projectController.js - Auth middleware · JWT-based protection for private endpoints.
backend/middleware/authenticate.js - Upload middleware · Multipart image handling, likely via Multer.
backend/middleware/upload.js
Data & files
MySQL persistence and server-side uploaded media.
- MySQL · Primary relational datastore.
backend/config/db.js - File uploads · Server-side persisted uploaded media served as static assets.
backend/public/uploads
Connections 29
- App entry → Mobile app: starts · Bootstraps the mobile app.
- Mobile app → Main nav: uses · Defines primary app navigation.
- Main nav → User screens: routes to · User-facing flows.
- Main nav → Admin screens: routes to · Admin-facing flows.
- User screens → API access: calls · User screens fetch and submit backend data.
- Admin screens → API access: calls · Admin screens manage categories, projects, and users.
- API access → Auth routes: HTTP · Auth-related requests.
- API access → Category routes: HTTP · Category requests.
- API access → Project routes: HTTP · Project requests.
- API access → User routes: HTTP · User administration requests.
- Server entry → Auth routes: mounts · Registers route modules.
- Server entry → User routes: mounts · Registers route modules.
- Server entry → Category routes: mounts · Registers route modules.
- Server entry → Project routes: mounts · Registers route modules.
- Auth routes → Auth controller: delegates · Route handlers forward to business logic.
- User routes → User controller: delegates · Route handlers forward to business logic.
- Category routes → Category controller: delegates · Route handlers forward to business logic.
- Project routes → Project controller: delegates · Route handlers forward to business logic.
- Auth controller → Auth middleware: protected by · Private auth/profile flows require JWT validation.
- User controller → Auth middleware: protected by · Admin user management is guarded.
- Category controller → Auth middleware: protected by · Category management is guarded.
- Project controller → Auth middleware: protected by · Project management may require authenticated access.
- Auth controller → MySQL: reads/writes · User records and credentials.
- User controller → MySQL: reads/writes · User administration data.
- Category controller → MySQL: reads/writes · Category records.
- Project controller → MySQL: reads/writes · Project and crowdfunding data.
- Project controller → Upload middleware: uses · Project assets are uploaded as multipart content.
- Upload middleware → File uploads: stores · Writes image files to server-side upload storage.
- MySQL → File uploads: separate from · Database data and file storage are distinct concerns.