# prathik-ds/nexus architecture

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

- Interactive diagram: https://gitdiagram.com/prathik-ds/nexus
- Repository: https://github.com/prathik-ds/nexus

## Overview

1. **Overall shape**  
   FusionVerse is a mostly server-rendered **PHP/MySQL monolith** for a college fest platform. The core architecture is page-driven: browser requests land on PHP entrypoints, those pages query/update MySQL, and then render HTML with shared header/footer templates.

2. **Main user-facing surfaces**  
   The application is split into distinct role-based pages: `index.php`, `login.php`, `register.php`, `dashboard.php`, `events.php`, `leaderboard.php`, plus admin/coordinator pages such as `admin.php`, `coordinator.php`, and their related management screens. This makes the repo easy to diagram as a set of functional entrypoints over one shared backend.

3. **Shared presentation layer**  
   `includes/header.php` and `includes/footer.php` provide reusable shell markup, while `assets/css/*.css`, `assets/js/*.js`, and images under `assets/img` and `images/` contain the site’s neon/sci-fi UI. The presence of bundled files like `assets/index-*.css` and `assets/index-*.js` suggests at least one prebuilt frontend asset output layered on top of vanilla PHP pages.

4. **Authentication and session boundary**  
   `register.php`, `login.php`, and `logout.php` form the auth boundary. The README indicates registration captures student identity details and generates a unique `SYN-XXXX` ID, which then becomes the primary identity used across the dashboard, registrations, and results pages. After login, PHP sessions gate access to private user/admin/coordinator screens.

5. **User workspace flow**  
   `dashboard.php` is the user’s main post-login hub. It aggregates profile data, registration history, event status, and notices, so its data flow is read-heavy: it pulls from the database to assemble a personalized view rather than acting as a simple static page.

6. **Event discovery and registration pipeline**  
   `events.php` is the browsing layer, while `register_event.php`, `unregister_event.php`, `ajax_unregister.php`, and `team_actions.php` handle mutations. The README describes duplicate-prevention and slot enforcement, so the architecture centers on transactional checks in PHP before writing registration state to MySQL.

7. **Admin control subsystem**  
   `admin.php` and the admin subpages (`admin_users.php`, `admin_events.php`, `admin_explore_events.php`, `admin_leaderboard.php`) are the operational back office. This area owns cross-cutting actions like user management, event oversight, score entry, and public announcements, and it feeds both the dashboard notice board and the leaderboard.

8. **Coordinator workflow**  
   `coordinator.php`, `coordinator_actions.php`, and `coordinator_actions_ajax.php` represent a separate operational role from admin. This likely handles event-day workflows such as participant status updates, results submission, or coordination tasks, with an AJAX endpoint for faster UI updates without full page reloads.

9. **Results, ranking, and certificates**  
   `leaderboard.php`, `vortex_results.php`, and `certificate.php` form the recognition/output path. These pages turn stored scores and statuses into public rankings and printable artifacts, so they are downstream consumers of the admin/coordinator data-entry flows.

10. **Database as the system backbone**  
   `config/db.php` is the single database connection boundary, and `fusionverse_database.sql` is the schema seed. The rest of the application depends on this relational store for users, events, registrations, scores, notices, and team/participant mappings.

11. **Migration and maintenance scripts**  
   `install.php`, `migrate_teams.php`, and `scratch/update_db.php` indicate that schema setup and data migration are part of the repo’s lifecycle, not separate infrastructure. `export_data.php` also shows an administrative data-extraction path, useful for reporting or backups.

12. **Deployment/runtime assumptions**  
   The repo is built to run on a classic PHP web server with MySQL, aided by `.htaccess` for routing or access rules. `START_NETWORK_SERVER.bat` and `web.zip` suggest local/network deployment convenience, but the architecture itself remains a traditional server-rendered PHP app rather than a SPA or microservice system.

Main entry points: [`config/db.php`](https://github.com/prathik-ds/nexus/blob/main/config/db.php) (DB Config), [`dashboard.php`](https://github.com/prathik-ds/nexus/blob/main/dashboard.php) (Dashboard), [`admin.php`](https://github.com/prathik-ds/nexus/blob/main/admin.php) (Admin), [`includes/header.php`](https://github.com/prathik-ds/nexus/blob/main/includes/header.php) (Header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_entry["Public entrypoints"]
  node_index["Home<br/>php entrypoint<br/>[index.php]"]
  node_login["Login<br/>auth page<br/>[login.php]"]
  node_register["Register<br/>auth page<br/>[register.php]"]
  node_logout["Logout<br/>session endpoint<br/>[logout.php]"]
end

subgraph group_g_user["User workspace"]
  node_dashboard["Dashboard<br/>user hub<br/>[dashboard.php]"]
  node_events["Events<br/>browse page<br/>[events.php]"]
  node_reg_event["Join Event<br/>mutation endpoint<br/>[register_event.php]"]
  node_unreg_event["Leave Event<br/>mutation endpoint"]
  node_ajax_unreg["Ajax Leave<br/>ajax endpoint"]
  node_team_actions["Team Actions<br/>team endpoint<br/>[team_actions.php]"]
  node_leaderboard["Leaderboard<br/>results page<br/>[leaderboard.php]"]
  node_certificate["Certificate<br/>output page<br/>[certificate.php]"]
  node_vortex_results["Results<br/>[vortex_results.php]"]
end

subgraph group_g_admin["Admin console"]
  node_admin_home["Admin<br/>[admin.php]"]
  node_admin_users["Users<br/>admin module<br/>[admin_users.php]"]
  node_admin_events["Events Admin<br/>admin module<br/>[admin_events.php]"]
  node_admin_explore["Explore Events<br/>admin module"]
  node_admin_leaderboard["Admin Rank<br/>admin module"]
end

subgraph group_g_coord["Coordinator tools"]
  node_coordinator["Coordinator<br/>role console<br/>[coordinator.php]"]
  node_coord_actions["Coord Actions<br/>workflow endpoint"]
  node_coord_ajax["Coord Ajax<br/>ajax endpoint"]
end

subgraph group_g_shared["Shared app layer"]
  node_header["Header<br/>template<br/>[header.php]"]
  node_footer["Footer<br/>template<br/>[footer.php]"]
  node_styles["Styles<br/>css assets<br/>[styles.css]"]
  node_splash_css["Splash CSS<br/>css assets<br/>[splash.css]"]
  node_script_js["Site JS<br/>client script<br/>[script.js]"]
  node_splash_js["Splash JS<br/>client script<br/>[splash.js]"]
  node_build_css["Built CSS<br/>bundled asset<br/>[index-S1tavsFE.css]"]
  node_build_js["Built JS<br/>bundled asset<br/>[index-tiyn2ZUY.js]"]
end

subgraph group_g_data["Data layer"]
  node_db_config["DB Config<br/>db connector<br/>[db.php]"]
  node_schema[("Schema")]
  node_install["Install<br/>setup script<br/>[install.php]"]
  node_migrate_teams["Migrate Teams<br/>migration script<br/>[migrate_teams.php]"]
  node_update_db["Update DB<br/>maintenance script<br/>[update_db.php]"]
end

node_index -->|"sign in"| node_login
node_index -->|"sign up"| node_register
node_login -->|"verify"| node_db_config
node_register -->|"create user"| node_db_config
node_login -->|"session start"| node_dashboard
node_logout -->|"return"| node_index
node_dashboard -->|"browse"| node_events
node_dashboard -->|"view ranks"| node_leaderboard
node_dashboard -->|"view cert"| node_certificate
node_events -->|"register"| node_reg_event
node_events -->|"withdraw"| node_unreg_event
node_events -->|"team flow"| node_team_actions
node_unreg_event -.->|"async"| node_ajax_unreg
node_reg_event -->|"write reg"| node_db_config
node_unreg_event -->|"remove reg"| node_db_config
node_team_actions -->|"team data"| node_db_config
node_admin_home -->|"manage users"| node_admin_users
node_admin_home -->|"manage events"| node_admin_events
node_admin_home -->|"inspect"| node_admin_explore
node_admin_home -->|"rank control"| node_admin_leaderboard
node_admin_users -->|"user ops"| node_db_config
node_admin_events -->|"event ops"| node_db_config
node_admin_leaderboard -->|"scores"| node_db_config
node_coordinator -->|"workflow"| node_coord_actions
node_coordinator -.->|"fast updates"| node_coord_ajax
node_coord_actions -->|"update status"| node_db_config
node_coord_ajax -->|"async update"| node_db_config
node_admin_leaderboard -->|"publish"| node_leaderboard
node_admin_events -->|"source data"| node_events
node_admin_home -.->|"notices"| node_dashboard
node_leaderboard -->|"read ranks"| node_db_config
node_vortex_results -->|"read results"| node_db_config
node_certificate -->|"verify award"| node_db_config
node_header -->|"shell style"| node_styles
node_header -->|"shared ui"| node_script_js
node_footer -->|"page script"| node_script_js
node_index -->|"layout"| node_header
node_dashboard -->|"layout"| node_header
node_admin_home -->|"layout"| node_header
node_coordinator -->|"layout"| node_header
node_index -->|"layout"| node_footer
node_dashboard -->|"layout"| node_footer
node_install -->|"seed"| node_schema
node_migrate_teams -->|"migrate"| node_schema
node_update_db -->|"repair"| node_schema
node_db_config -->|"connects to"| node_schema
node_install -->|"bootstrap"| node_db_config
node_migrate_teams -->|"transform"| node_db_config

click node_index "https://github.com/prathik-ds/nexus/blob/main/index.php"
click node_login "https://github.com/prathik-ds/nexus/blob/main/login.php"
click node_register "https://github.com/prathik-ds/nexus/blob/main/register.php"
click node_logout "https://github.com/prathik-ds/nexus/blob/main/logout.php"
click node_dashboard "https://github.com/prathik-ds/nexus/blob/main/dashboard.php"
click node_events "https://github.com/prathik-ds/nexus/blob/main/events.php"
click node_reg_event "https://github.com/prathik-ds/nexus/blob/main/register_event.php"
click node_unreg_event "https://github.com/prathik-ds/nexus/blob/main/unregister_event.php"
click node_ajax_unreg "https://github.com/prathik-ds/nexus/blob/main/ajax_unregister.php"
click node_team_actions "https://github.com/prathik-ds/nexus/blob/main/team_actions.php"
click node_leaderboard "https://github.com/prathik-ds/nexus/blob/main/leaderboard.php"
click node_certificate "https://github.com/prathik-ds/nexus/blob/main/certificate.php"
click node_vortex_results "https://github.com/prathik-ds/nexus/blob/main/vortex_results.php"
click node_admin_home "https://github.com/prathik-ds/nexus/blob/main/admin.php"
click node_admin_users "https://github.com/prathik-ds/nexus/blob/main/admin_users.php"
click node_admin_events "https://github.com/prathik-ds/nexus/blob/main/admin_events.php"
click node_admin_explore "https://github.com/prathik-ds/nexus/blob/main/admin_explore_events.php"
click node_admin_leaderboard "https://github.com/prathik-ds/nexus/blob/main/admin_leaderboard.php"
click node_coordinator "https://github.com/prathik-ds/nexus/blob/main/coordinator.php"
click node_coord_actions "https://github.com/prathik-ds/nexus/blob/main/coordinator_actions.php"
click node_coord_ajax "https://github.com/prathik-ds/nexus/blob/main/coordinator_actions_ajax.php"
click node_header "https://github.com/prathik-ds/nexus/blob/main/includes/header.php"
click node_footer "https://github.com/prathik-ds/nexus/blob/main/includes/footer.php"
click node_styles "https://github.com/prathik-ds/nexus/blob/main/assets/css/styles.css"
click node_splash_css "https://github.com/prathik-ds/nexus/blob/main/assets/css/splash.css"
click node_script_js "https://github.com/prathik-ds/nexus/blob/main/assets/js/script.js"
click node_splash_js "https://github.com/prathik-ds/nexus/blob/main/assets/js/splash.js"
click node_build_css "https://github.com/prathik-ds/nexus/blob/main/assets/index-S1tavsFE.css"
click node_build_js "https://github.com/prathik-ds/nexus/blob/main/assets/index-tiyn2ZUY.js"
click node_db_config "https://github.com/prathik-ds/nexus/blob/main/config/db.php"
click node_schema "https://github.com/prathik-ds/nexus/blob/main/fusionverse_database.sql"
click node_install "https://github.com/prathik-ds/nexus/blob/main/install.php"
click node_migrate_teams "https://github.com/prathik-ds/nexus/blob/main/migrate_teams.php"
click node_update_db "https://github.com/prathik-ds/nexus/blob/main/scratch/update_db.php"

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_index,node_login,node_register,node_logout toneBlue
class node_dashboard,node_events,node_reg_event,node_unreg_event,node_ajax_unreg,node_team_actions,node_leaderboard,node_certificate,node_vortex_results toneAmber
class node_admin_home,node_admin_users,node_admin_events,node_admin_explore,node_admin_leaderboard toneMint
class node_coordinator,node_coord_actions,node_coord_ajax toneRose
class node_header,node_footer,node_styles,node_splash_css,node_script_js,node_splash_js,node_build_css,node_build_js toneIndigo
class node_db_config,node_schema,node_install,node_migrate_teams,node_update_db toneTeal
```

## Components

### Public entrypoints

Browser-facing starting points and session boundary pages.

- [Home](https://github.com/prathik-ds/nexus/blob/main/index.php): php entrypoint · Public landing page for the fest platform. · `index.php`
- [Login](https://github.com/prathik-ds/nexus/blob/main/login.php): auth page · Authenticates users and starts a session. · `login.php`
- [Register](https://github.com/prathik-ds/nexus/blob/main/register.php): auth page · Creates student accounts and assigns identity IDs. · `register.php`
- [Logout](https://github.com/prathik-ds/nexus/blob/main/logout.php): session endpoint · Ends the active session. · `logout.php`

### User workspace

Logged-in student flows for browsing, registration, and profile views.

- [Dashboard](https://github.com/prathik-ds/nexus/blob/main/dashboard.php): user hub · Personalized post-login overview of profile, registrations, and notices. · `dashboard.php`
- [Events](https://github.com/prathik-ds/nexus/blob/main/events.php): browse page · Lists events and entry points for registration. · `events.php`
- [Join Event](https://github.com/prathik-ds/nexus/blob/main/register_event.php): mutation endpoint · Registers a user or team for an event with validation. · `register_event.php`
- [Leave Event](https://github.com/prathik-ds/nexus/blob/main/unregister_event.php): mutation endpoint · Removes a registration from an event. · `unregister_event.php`
- [Ajax Leave](https://github.com/prathik-ds/nexus/blob/main/ajax_unregister.php): ajax endpoint · Asynchronous unregister action for the UI. · `ajax_unregister.php`
- [Team Actions](https://github.com/prathik-ds/nexus/blob/main/team_actions.php): team endpoint · Handles team formation and team-related operations. · `team_actions.php`
- [Leaderboard](https://github.com/prathik-ds/nexus/blob/main/leaderboard.php): results page · Public ranking view built from stored scores. · `leaderboard.php`
- [Certificate](https://github.com/prathik-ds/nexus/blob/main/certificate.php): output page · Renders printable recognition artifacts. · `certificate.php`
- [Results](https://github.com/prathik-ds/nexus/blob/main/vortex_results.php): results page · Shows event outcome and result data. · `vortex_results.php`

### Admin console

Operational back office for users, events, scores, and announcements.

- [Admin](https://github.com/prathik-ds/nexus/blob/main/admin.php): admin shell · Main operational console for site administration. · `admin.php`
- [Users](https://github.com/prathik-ds/nexus/blob/main/admin_users.php): admin module · Manages user accounts and identity records. · `admin_users.php`
- [Events Admin](https://github.com/prathik-ds/nexus/blob/main/admin_events.php): admin module · Creates and manages events and related settings. · `admin_events.php`
- [Explore Events](https://github.com/prathik-ds/nexus/blob/main/admin_explore_events.php): admin module · Admin view for inspecting event data and structure. · `admin_explore_events.php`
- [Admin Rank](https://github.com/prathik-ds/nexus/blob/main/admin_leaderboard.php): admin module · Controls leaderboard data and ranking presentation. · `admin_leaderboard.php`

### Coordinator tools

Role-specific event-day workflows and fast update endpoints.

- [Coordinator](https://github.com/prathik-ds/nexus/blob/main/coordinator.php): role console · Coordinator workspace for event operations. · `coordinator.php`
- [Coord Actions](https://github.com/prathik-ds/nexus/blob/main/coordinator_actions.php): workflow endpoint · Processes coordinator updates and result submissions. · `coordinator_actions.php`
- [Coord Ajax](https://github.com/prathik-ds/nexus/blob/main/coordinator_actions_ajax.php): ajax endpoint · Fast asynchronous coordinator actions. · `coordinator_actions_ajax.php`

### Shared app layer

Reusable templates, client assets, and deployment/runtime glue.

- [Header](https://github.com/prathik-ds/nexus/blob/main/includes/header.php): template · Shared page shell and navigation markup. · `includes/header.php`
- [Footer](https://github.com/prathik-ds/nexus/blob/main/includes/footer.php): template · Shared closing markup and page footer. · `includes/footer.php`
- [Styles](https://github.com/prathik-ds/nexus/blob/main/assets/css/styles.css): css assets · Primary site styling and themed UI assets. · `assets/css/styles.css`
- [Splash CSS](https://github.com/prathik-ds/nexus/blob/main/assets/css/splash.css): css assets · Splash screen styling. · `assets/css/splash.css`
- [Site JS](https://github.com/prathik-ds/nexus/blob/main/assets/js/script.js): client script · Shared client-side behavior for the PHP pages. · `assets/js/script.js`
- [Splash JS](https://github.com/prathik-ds/nexus/blob/main/assets/js/splash.js): client script · Behavior for the splash/landing experience. · `assets/js/splash.js`
- [Built CSS](https://github.com/prathik-ds/nexus/blob/main/assets/index-S1tavsFE.css): bundled asset · Prebuilt frontend stylesheet output. · `assets/index-S1tavsFE.css`
- [Built JS](https://github.com/prathik-ds/nexus/blob/main/assets/index-tiyn2ZUY.js): bundled asset · Prebuilt frontend script output. · `assets/index-tiyn2ZUY.js`

### Data layer

Database schema, connection boundary, and maintenance scripts.

- [DB Config](https://github.com/prathik-ds/nexus/blob/main/config/db.php): db connector · Single connection boundary to MySQL. · `config/db.php`
- [Schema](https://github.com/prathik-ds/nexus/blob/main/fusionverse_database.sql): sql schema · Database schema and seed data. · `fusionverse_database.sql`
- [Install](https://github.com/prathik-ds/nexus/blob/main/install.php): setup script · Initial application and schema setup. · `install.php`
- [Migrate Teams](https://github.com/prathik-ds/nexus/blob/main/migrate_teams.php): migration script · Converts or repairs team data shape. · `migrate_teams.php`
- [Update DB](https://github.com/prathik-ds/nexus/blob/main/scratch/update_db.php): maintenance script · Ad hoc database update utility. · `scratch/update_db.php`

## Connections

- Home → Login: sign in · Users move from the landing page to authentication.
- Home → Register: sign up · New users can create accounts from the public entrypoint.
- Login → DB Config: verify · Credentials are checked through the database connection.
- Register → DB Config: create user · Registration writes identity records to MySQL.
- Login → Dashboard: session start · Successful login leads into the user workspace.
- Logout → Home: return · Logout sends users back to the public site.
- Dashboard → Events: browse · The dashboard links into event discovery.
- Dashboard → Leaderboard: view ranks · Users can inspect rankings from their workspace.
- Dashboard → Certificate: view cert · Certificates are reachable from the user hub.
- Events → Join Event: register · Browsing leads into event registration mutations.
- Events → Leave Event: withdraw · Users can unregister from an event.
- Events → Team Actions: team flow · Team-related event actions are delegated to team endpoints.
- Leave Event → Ajax Leave: async · The UI can use an AJAX path for unregistering.
- Join Event → DB Config: write reg · Registration state is stored in the database.
- Leave Event → DB Config: remove reg · Unregistration updates the relational store.
- Team Actions → DB Config: team data · Team membership and mappings are persisted in MySQL.
- Admin → Users: manage users · Admin console branches into user management.
- Admin → Events Admin: manage events · Admin console branches into event management.
- Admin → Explore Events: inspect · Admins can inspect event structures and records.
- Admin → Admin Rank: rank control · Admin console feeds leaderboard management.
- Users → DB Config: user ops · User administration reads and writes MySQL data.
- Events Admin → DB Config: event ops · Event administration persists event configuration.
- Admin Rank → DB Config: scores · Ranking data comes from the database.
- Coordinator → Coord Actions: workflow · Coordinator pages delegate core operations to action handlers.
- Coordinator → Coord Ajax: fast updates · Coordinator UI can use AJAX for quick state changes.
- Coord Actions → DB Config: update status · Coordinator actions modify operational records.
- Coord Ajax → DB Config: async update · Asynchronous coordinator actions persist through MySQL.
- Admin Rank → Leaderboard: publish · Admin-managed ranking data flows to the public leaderboard.
- Events Admin → Events: source data · Public event listings are driven by admin-managed records.
- Admin → Dashboard: notices · Administrative announcements and updates surface to users.
- Leaderboard → DB Config: read ranks · Leaderboard pages read ranking data from the database.
- Results → DB Config: read results · Results pages consume stored score and status data.
- Certificate → DB Config: verify award · Certificate generation depends on persisted results or identity data.
- Header → Styles: shell style · Shared templates pull in the main stylesheet.
- Header → Site JS: shared ui · Common shell markup is paired with shared client behavior.
- Footer → Site JS: page script · Footer includes or closes out shared script loading.
- Home → Header: layout · Public pages use the shared page shell.
- Dashboard → Header: layout · Logged-in views render through shared templates.
- Admin → Header: layout · Admin pages share the common shell.
- Coordinator → Header: layout · Coordinator pages use the shared shell.
- Home → Footer: layout · Public pages share a common footer.
- Dashboard → Footer: layout · Logged-in views share the footer template.
- Install → Schema: seed · Installer initializes the database schema.
- Migrate Teams → Schema: migrate · Team migration scripts adapt the schema or data.
- Update DB → Schema: repair · Maintenance updates are applied against the database structure.
- DB Config → Schema: connects to · All runtime data access flows through the database schema.
- Install → DB Config: bootstrap · Setup scripts rely on the DB connection boundary.
- Migrate Teams → DB Config: transform · Migration scripts use the same database connection.
