# noice-noise/gogamify-students architecture

> Architecture diagram of the GitHub repository noice-noise/gogamify-students, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noice-noise/gogamify-students
- Repository: https://github.com/noice-noise/gogamify-students

## Overview

#### Purpose and execution model
GoGamify Education is a Node.js/Express, MongoDB-backed education platform for teachers, students, and administrators. Teachers turn learning resources into gamified journeys, resources, and collectibles; students join and complete them. The server entry point is `index.js`; a separate source/template entry exists at `src/index.js`. Deployment targets Heroku, and the client includes installable PWA assets.

#### HTTP application boundary
Express routes partition the application by role and domain, dispatching requests to controllers: `routes/authRoute.js`, `routes/gamifyRoutes.js`, and `routes/collectionRoutes.js`; corresponding handlers include `controllers/authController.js`, `controllers/gamifyController.js`, and `controllers/collectionController.js`. Server-rendered EJS views provide teacher/admin/auth flows, while public PWA pages support learner-facing use.

#### Identity, sessions, and roles
Authentication configuration and Passport integration form the security boundary, with password/session/cookie handling described by the project: `config/authConfig.js`, `config/passportConfig.js`, `models/user.js`. Role-specific identity data is separated into `models/student.js` and `models/teacher.js`, with administration managed through `controllers/adminController.js` and `routes/adminRoutes.js`.

#### Learning-resource gamification pipeline
Teachers create and manage learning resources, then gamify them into playable material; the README identifies rich-text-to-HTML conversion and Mammoth.js as part of this capability. Core persistence and orchestration reside in `models/learningResource.js`, `controllers/learningResourceController.js`, and `controllers/gamifyController.js`. Teacher authoring UIs are rendered from `views/gamify/create.ejs` and `views/gamify/details.ejs`.

#### Journey, enrollment, and student progression
Student-facing flow includes joining a journey, browsing content, completing material, and receiving summary/done states. This is represented by `controllers/studentController.js`, `routes/studentRoutes.js`, and server views such as `views/app/join-code.ejs`, `views/app/browse-journey.ejs`, and `views/app/journey-summary.ejs`. The PWA provides parallel static journey/module experiences at `public/pwa/journey/journey.html` and `public/pwa/learning-module/module.html`.

#### Collectibles and reward system
Collectibles are a distinct domain used for badges, achievements, or themes earned through progression. Its API/controller/model boundary is `routes/collectionRoutes.js`, `controllers/collectionController.js`, and `models/collectible.js`; management views live in `views/collection/index.ejs` and `views/collection/details.ejs`. Reward presentation also exists in the learner PWA at `public/pwa/collections/collections.html`.

#### Client delivery and infrastructure
The project serves static browser assets and EJS-rendered pages from `public/` and `views/`, with Tailwind CSS artifacts/configuration at `public/tailwind.css` and `tailwind.config.js`. PWA install/offline behavior is anchored by `public/manifest.json` and `public/service-worker.js`. MongoDB is accessed through Mongoose models; Heroku is the stated hosting platform. `data/schools.json` supplies local school reference data.

Main entry points: [`models/collectible.js`](https://github.com/noice-noise/gogamify-students/blob/develop/models/collectible.js) (Collectibles), [`index.js`](https://github.com/noice-noise/gogamify-students/blob/develop/index.js) (Express server), [`routes/gamifyRoutes.js`](https://github.com/noice-noise/gogamify-students/blob/develop/routes/gamifyRoutes.js) (Role & domain routes), [`public/pwa/journey/journey.html`](https://github.com/noice-noise/gogamify-students/blob/develop/public/pwa/journey/journey.html) (Learner PWA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP application"]
  node_server{{"Express server<br/>Node.js entry<br/>[index.js]"}}
  node_routes["Role &amp; domain routes<br/>Express routes<br/>[gamifyRoutes.js]"]
end

subgraph group_identity["Identity &amp; roles"]
  node_auth["Auth controller<br/>[authController.js]"]
  node_passport["Passport &amp; sessions<br/>security config<br/>[passportConfig.js]"]
  node_users[("Users and role profiles<br/>Mongoose models<br/>[user.js]")]
  node_admin["Administration<br/>admin controller/routes<br/>[adminController.js]"]
end

subgraph group_learning["Learning journey"]
  node_resources[("Learning resources<br/>Mongoose model")]
  node_authoring["Resource authoring<br/>controller"]
  node_gamify["Gamification orchestration<br/>controller"]
  node_teacher_views["Teacher authoring views<br/>EJS views<br/>[create.ejs]"]
  node_student["Student progression<br/>controller/routes"]
  node_student_views["Student journey views<br/>EJS views<br/>[browse-journey.ejs]"]
  node_collectibles[("Collectibles<br/>model/controller/routes<br/>[collectible.js]")]
  node_collection_views["Collection management<br/>EJS views<br/>[index.ejs]"]
end

subgraph group_client["Client delivery"]
  node_ejs["Server-rendered UI<br/>EJS views"]
  node_pwa["Learner PWA<br/>static client<br/>[journey.html]"]
  node_offline["PWA install &amp; offline<br/>manifest/service worker<br/>[service-worker.js]"]
end

node_mongo[("MongoDB<br/>database")]
node_schools["School reference data<br/>local data<br/>[schools.json]"]
node_heroku{{"Heroku<br/>hosting"}}

node_heroku -->|"hosts"| node_server
node_server -->|"mounts"| node_routes
node_server -->|"renders"| node_ejs
node_server -->|"serves static assets"| node_pwa
node_pwa -->|"uses"| node_offline
node_routes -->|"auth requests"| node_auth
node_routes -->|"gamification requests"| node_gamify
node_routes -->|"collection requests"| node_collectibles
node_auth -->|"authenticates via"| node_passport
node_passport -->|"loads sessions and users"| node_users
node_admin -->|"manages"| node_users
node_authoring -->|"creates and updates"| node_resources
node_gamify -->|"gamifies"| node_resources
node_teacher_views -->|"submits authoring"| node_authoring
node_student -->|"browses and completes"| node_resources
node_student_views -->|"drives"| node_student
node_student -->|"awards through progression"| node_collectibles
node_collection_views -->|"manages"| node_collectibles
node_pwa -.->|"parallel learner flow"| node_student
node_pwa -.->|"shows rewards"| node_collectibles
node_users -->|"persists"| node_mongo
node_resources -->|"persists"| node_mongo
node_collectibles -->|"persists"| node_mongo

click node_server "https://github.com/noice-noise/gogamify-students/blob/develop/index.js"
click node_routes "https://github.com/noice-noise/gogamify-students/blob/develop/routes/gamifyRoutes.js"
click node_auth "https://github.com/noice-noise/gogamify-students/blob/develop/controllers/authController.js"
click node_passport "https://github.com/noice-noise/gogamify-students/blob/develop/config/passportConfig.js"
click node_users "https://github.com/noice-noise/gogamify-students/blob/develop/models/user.js"
click node_admin "https://github.com/noice-noise/gogamify-students/blob/develop/controllers/adminController.js"
click node_resources "https://github.com/noice-noise/gogamify-students/blob/develop/models/learningResource.js"
click node_authoring "https://github.com/noice-noise/gogamify-students/blob/develop/controllers/learningResourceController.js"
click node_gamify "https://github.com/noice-noise/gogamify-students/blob/develop/controllers/gamifyController.js"
click node_teacher_views "https://github.com/noice-noise/gogamify-students/blob/develop/views/gamify/create.ejs"
click node_student "https://github.com/noice-noise/gogamify-students/blob/develop/controllers/studentController.js"
click node_student_views "https://github.com/noice-noise/gogamify-students/blob/develop/views/app/browse-journey.ejs"
click node_collectibles "https://github.com/noice-noise/gogamify-students/blob/develop/models/collectible.js"
click node_collection_views "https://github.com/noice-noise/gogamify-students/blob/develop/views/collection/index.ejs"
click node_pwa "https://github.com/noice-noise/gogamify-students/blob/develop/public/pwa/journey/journey.html"
click node_offline "https://github.com/noice-noise/gogamify-students/blob/develop/public/service-worker.js"
click node_schools "https://github.com/noice-noise/gogamify-students/blob/develop/data/schools.json"

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_server,node_routes toneBlue
class node_auth,node_passport,node_users,node_admin toneAmber
class node_resources,node_authoring,node_gamify,node_teacher_views,node_student,node_student_views,node_collectibles,node_collection_views toneMint
class node_ejs,node_pwa,node_offline toneRose
class node_mongo,node_schools,node_heroku toneNeutral
```

## Components

### HTTP application

- [Express server](https://github.com/noice-noise/gogamify-students/blob/develop/index.js): Node.js entry · Primary application entry point. · `index.js`
- [Role & domain routes](https://github.com/noice-noise/gogamify-students/blob/develop/routes/gamifyRoutes.js): Express routes · `routes/gamifyRoutes.js`

### Identity & roles

- [Auth controller](https://github.com/noice-noise/gogamify-students/blob/develop/controllers/authController.js): controller · `controllers/authController.js`
- [Passport & sessions](https://github.com/noice-noise/gogamify-students/blob/develop/config/passportConfig.js): security config · `config/passportConfig.js`
- [Users and role profiles](https://github.com/noice-noise/gogamify-students/blob/develop/models/user.js): Mongoose models · User, student, and teacher identities. · `models/user.js`
- [Administration](https://github.com/noice-noise/gogamify-students/blob/develop/controllers/adminController.js): admin controller/routes · `controllers/adminController.js`

### Learning journey

- [Learning resources](https://github.com/noice-noise/gogamify-students/blob/develop/models/learningResource.js): Mongoose model · `models/learningResource.js`
- [Resource authoring](https://github.com/noice-noise/gogamify-students/blob/develop/controllers/learningResourceController.js): controller · Creates resources and converts rich text or documents to playable HTML. · `controllers/learningResourceController.js`
- [Gamification orchestration](https://github.com/noice-noise/gogamify-students/blob/develop/controllers/gamifyController.js): controller · Turns teacher resources into journey material. · `controllers/gamifyController.js`
- [Teacher authoring views](https://github.com/noice-noise/gogamify-students/blob/develop/views/gamify/create.ejs): EJS views · `views/gamify/create.ejs`
- [Student progression](https://github.com/noice-noise/gogamify-students/blob/develop/controllers/studentController.js): controller/routes · Joins journeys, browses content, and records completion. · `controllers/studentController.js`
- [Student journey views](https://github.com/noice-noise/gogamify-students/blob/develop/views/app/browse-journey.ejs): EJS views · `views/app/browse-journey.ejs`
- [Collectibles](https://github.com/noice-noise/gogamify-students/blob/develop/models/collectible.js): model/controller/routes · Badges, achievements, and themes earned through progression. · `models/collectible.js`
- [Collection management](https://github.com/noice-noise/gogamify-students/blob/develop/views/collection/index.ejs): EJS views · `views/collection/index.ejs`

### Client delivery

- **Server-rendered UI**: EJS views · Teacher, admin, authentication, and student browser flows.
- [Learner PWA](https://github.com/noice-noise/gogamify-students/blob/develop/public/pwa/journey/journey.html): static client · Parallel journey, module, and reward experiences. · `public/pwa/journey/journey.html`
- [PWA install & offline](https://github.com/noice-noise/gogamify-students/blob/develop/public/service-worker.js): manifest/service worker · `public/service-worker.js`

### Other components

- **MongoDB**: database · Persistent store accessed through Mongoose models.
- [School reference data](https://github.com/noice-noise/gogamify-students/blob/develop/data/schools.json): local data · `data/schools.json`
- **Heroku**: hosting

## Connections

- Heroku → Express server: hosts
- Express server → Role & domain routes: mounts
- Express server → Server-rendered UI: renders
- Express server → Learner PWA: serves static assets
- Learner PWA → PWA install & offline: uses
- Role & domain routes → Auth controller: auth requests
- Role & domain routes → Gamification orchestration: gamification requests
- Role & domain routes → Collectibles: collection requests
- Auth controller → Passport & sessions: authenticates via
- Passport & sessions → Users and role profiles: loads sessions and users
- Administration → Users and role profiles: manages
- Resource authoring → Learning resources: creates and updates
- Gamification orchestration → Learning resources: gamifies
- Teacher authoring views → Resource authoring: submits authoring
- Student progression → Learning resources: browses and completes
- Student journey views → Student progression: drives
- Student progression → Collectibles: awards through progression
- Collection management → Collectibles: manages
- Learner PWA → Student progression: parallel learner flow
- Learner PWA → Collectibles: shows rewards
- Users and role profiles → MongoDB: persists
- Learning resources → MongoDB: persists
- Collectibles → MongoDB: persists
