How abdelrahmantarek790/tahyamisrsite works
Project Type and Purpose
• This is a full-stack “Platform” solution composed of:
a) A React/Vite “client” web app with SSR and SEO support
b) A Flutter “mobile” application for iOS/Android/Linux/Windows/macOS
c) A Node.js/Express “backend API” monolith backed by MongoDB
• Purpose: Provide a unified Students Union platform for Admin, Volunteers, and Students, supporting user management, events, news, media, positions, join-requests, push notifications, file uploads, and role-based access control.
File Structure Analysis
• Top-level folders:
• client/ – React SSR + static assets + Docker/Nginx deployment
• mobile/ – Flutter multi-platform app with feature modules
• config/, controllers/, models/, routes/, middleware/, utils/ – Node.js API monolith
• uploads/ – file storage for images/videos
• Config files: .env.example, Dockerfiles, nginx.conf, seed.js, server.js
• Patterns:
• Frontends (client & mobile) are separate consumers of the same API
• API layer follows MVC-like organization: routes → controllers → models (Mongoose)
• Middleware layer for auth, error handling, CORS, Helmet
• Utility layer for file upload (Multer), validation (Joi), Firebase notifications
Key README Insights
• Backend stack: Express, MongoDB, Mongoose, JWT, Multer, Firebase Admin, Joi, Helmet, CORS, bcryptjs
• Features: CRUD for users/positions/news/events/media, role-targeted push notifications, governorate filtering
• Deployment: .env config, Docker support for client, seed script for initial data
Main Components
• Presentation Layer
• Web Client (React SSR + CSR)
• Mobile Client (Flutter)
• API Layer (Node.js/Express Monolith)
• HTTP Router (routes/*.js)
• Controllers (controllers/*.js)
• Middleware (auth.js, error.js, CORS, Helmet)
• Services & Utilities (Joi validation, Multer uploads, Firebase SDK)
• Data Layer
• MongoDB (hosted or local) accessed via Mongoose ODM (models/*.js)
• File Storage (local uploads folder)
• External Services
• Firebase Cloud Messaging (Push Notifications)
• Optional: Nginx as reverse proxy for web client
Relationships and Data Flows
• Web & Mobile clients → HTTP(S) → API endpoints (/api/v1/*)
• API middleware applies CORS, auth (JWT), input validation
• Controllers orchestrate business logic and call:
• Mongoose models → MongoDB
• Multer → store files to uploads/
• Firebase Admin SDK → send push notifications
• API → responses (JSON, status codes) → clients
• Database seeding via seed.js
• Deployment:
• Client Docker → static assets served via Nginx
• Backend Node process → listens on PORT
• Mobile app deployed to app stores
Architectural Patterns & Principles
• Layered architecture (Presentation → API → Data)
• Separation of concerns (routes vs controllers vs models)
• Stateless RESTful API with JWT auth
• Feature-based modularization in mobile Flutter app
• SSR for web SEO + client hydration
• Centralized error handling & input validation