How edizo-io/main_website works
Purpose and entry points
This is a three-part Edizo-style site platform: a public marketing/application portal, an authenticated admin CMS, and a Node backend API. Public and admin SPAs boot from client/src/main.jsx and admin/src/main.jsx; the API server entry point is backend/index.js.
Public client
The public Vite/React application composes landing-page sections and routed content for services, projects, internships, contact, and user dashboard flows. Its top-level route/application shell is client/src/App.jsx; page-level experiences live under client/src/pages/Home.jsx, client/src/pages/ServicesPage.jsx, and client/src/pages/InternshipApplication.jsx. Shared site state, including content and authentication boundaries, is represented by client/src/context/SiteContext.jsx and client/src/context/AuthContext.jsx.
Admin CMS
A separate Vite/React admin SPA manages site content and operational records. Authentication and protected-admin state originate in admin/src/context/AuthContext.jsx, while layout/navigation is centralized in admin/src/layouts/AdminLayout.jsx. The principal management surfaces cover home/about/contact/portfolio content, services, internships, applications, requests, users, and settings; representative paths are admin/src/pages/ManageHomeView.jsx, admin/src/pages/ServicesView.jsx, and admin/src/pages/InternshipApplicationsView.jsx.
API and authorization boundary
The backend exposes domain-specific HTTP route modules, with route-to-controller separation for CMS content, portfolio, media, analytics, settings, contacts, services, internships/jobs, and users. Core API assembly is backend/index.js; administrative endpoints are grouped in backend/routes/adminRoutes.js; authorization is enforced through backend/middleware/authMiddleware.js. Controllers such as backend/controllers/pagesController.js, backend/controllers/mediaController.js, and backend/controllers/siteSettingsController.js form the API-facing content boundary consumed by the two SPAs.
Content and operational data flow
Admin users authenticate, then create or update CMS entities and operational records through admin API routes. The backend persists those changes; the public client retrieves the resulting page, portfolio, service, internship, and site-setting data for display and application/contact flows. Public submissions enter dedicated backend routes including backend/routes/contactRoutes.js, backend/routes/internshipRoutes.js, and backend/routes/serviceRoutes.js; admin views provide the review side of those workflows.
Persistence, media, and lifecycle
The backend has an explicit relational database layer in backend/db.js, with initial schema and subsequent CMS/portfolio upgrades in backend/schema.sql, backend/migrations/cms_upgrade.sql, and backend/migrate_portfolio.js. Seed and migration scripts support content/database bootstrapping. Media is a first-class backend concern via backend/routes/mediaRoutes.js and backend/controllers/mediaController.js, rather than being solely static client assets.
Runtime and deployment shape
Both frontends are Vite-based Node projects (client/vite.config.js, admin/vite.config.js) deployed independently from the backend Node service. Production environment files exist for each frontend. Repository-level operational scripts such as deploy.py, custom_deploy.py, and check_pm2.py indicate server deployment/process management, with MySQL-oriented database administration implied by open_mysql.py and the SQL schema.
Main entry points: index.js API server assembly · db.js Relational database · App.jsx Public app and routes · pagesController.js Content API controllers
Components 17
Public Portal
- Public SPA bootstrap
client/src/main.jsx - Public app and routes
client/src/App.jsx - Public content and application pages · Services, landing content, and internship application flows.
client/src/pages/InternshipApplication.jsx - Site and auth state
client/src/context/SiteContext.jsx
Admin CMS
- Admin SPA bootstrap
admin/src/main.jsx - Admin authentication state
admin/src/context/AuthContext.jsx - Admin layout and navigation
admin/src/layouts/AdminLayout.jsx - CMS and operations views · Manages content, services, internships, applications, users, and settings.
admin/src/pages/InternshipApplicationsView.jsx
Backend API
- API server assembly
backend/index.js - Authorization middleware
backend/middleware/authMiddleware.js - Administrative routes
backend/routes/adminRoutes.js - Public workflow routes · Accepts contact, internship, and service submissions.
backend/routes/contactRoutes.js - Content API controllers · Serves CMS pages, media, and site settings.
backend/controllers/pagesController.js - Media management · Backend-owned media lifecycle.
backend/routes/mediaRoutes.js
Data & Operations
- Relational database
backend/db.js - Schema and migrations · Initial schema plus CMS and portfolio upgrades.
backend/schema.sql - Deployment and process management · Deploys services and checks PM2 processes.
deploy.py
Connections 20
- Public SPA bootstrap → Public app and routes: mounts
- Public app and routes → Public content and application pages: routes to
- Public app and routes → Site and auth state: uses
- Public content and application pages → API server assembly: reads content and submits workflows
- Site and auth state → API server assembly: auth/content requests
- Admin SPA bootstrap → Admin authentication state: initializes
- Admin authentication state → Admin layout and navigation: protects
- Admin layout and navigation → CMS and operations views: hosts
- CMS and operations views → API server assembly: manages CMS and records
- API server assembly → Authorization middleware: applies
- Authorization middleware → Administrative routes: authorizes
- API server assembly → Public workflow routes: mounts
- API server assembly → Content API controllers: dispatches to
- Administrative routes → Content API controllers: updates content
- Public workflow routes → Relational database: stores submissions
- Content API controllers → Relational database: reads and writes entities
- API server assembly → Media management: mounts
- Media management → Relational database: persists media metadata
- Schema and migrations → Relational database: creates and upgrades
- Deployment and process management → API server assembly: deploys and supervises