# guptaanshik1/schedulereminder architecture

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

- Interactive diagram: https://gitdiagram.com/guptaanshik1/schedulereminder
- Repository: https://github.com/guptaanshik1/schedulereminder

## Overview

#### Purpose and topology
ScheduleReminder is a MERN application for creating activities/schedules, tracking completion, presenting user effectiveness statistics, and emailing reminders around activity start/end times. It has separate React and Node/Express applications: `client/src/index.js` boots the browser client; `index.js` and `app.js` boot and configure the API server.

#### Client application and navigation
The React root in `client/src/App.js` composes the application’s route-level experience. Main user flows include dashboards, schedule creation/listing, timetable views, search/filtering, settings, and authentication; representative entry components are `client/src/components/userDashboard.js`, `client/src/components/createSchedule.js`, and `client/src/components/schedules.js`. Shared route access control is centralized in `client/src/components/common/protectedRoute.js`.

#### Client API boundary
UI components call backend-facing service modules rather than directly owning HTTP behavior. `client/src/services/httpService.js` is the transport boundary, while `client/src/services/authService.js`, `client/src/services/scheduleService.js`, and `client/src/services/userService.js` partition API operations by domain. This is the key frontend/backend contract boundary.

#### Authentication, accounts, and administration
Authentication flows cover signup, login, OTP, forgotten-password, reset-password, logout, and password changes through components such as `client/src/components/login.js`, `client/src/components/otp.js`, and `client/src/components/common/resetPassword.js`. Server-side account endpoints are organized in `routes/user.js` and implemented in `controllers/userController.js`; authorization/user context is enforced by `middlewares/user.js`. Administrative user management has separate UI and client service layers in `client/src/components/admin/adminDashboard.js` and `client/src/services/adminService.js`.

#### Schedule lifecycle and analytics
Schedules are the primary domain record, represented by `models/schedule.js`. Requests enter through `routes/schedule.js` and are handled by `controllers/scheduleController.js`. The client creates, displays, filters, searches, and marks schedules complete via `client/src/components/createSchedule.js`, `client/src/components/displaySchedules.js`, and `client/src/components/isCompleted.js`. Supporting derived-view operations, including filtering/pagination/date validation, are isolated under `client/src/utils/filter.js`, `client/src/utils/paginate.js`, and `client/src/utils/validateDateTime.js`.

#### Server composition and persistence
Express application setup belongs in `app.js`; route modules divide the HTTP surface into home, user, and schedule domains via `routes/home.js`, `routes/user.js`, and `routes/schedule.js`. MongoDB/Mongoose connectivity is configured in `config/db.js`, with persisted user records in `models/user.js` and schedule records in `models/schedule.js`. `middlewares/bigPromise.js` provides an async-controller error/control-flow wrapper.

#### External effects and infrastructure
MongoDB is the persistent datastore, accessed through Mongoose models and the database configuration. Email delivery is an external side-effect used for schedule reminders and account-related messaging, encapsulated by `utils/emailHelper.js`. Authentication token/cookie issuance is centralized in `utils/cookieToken.js`; server-side filtering/query construction is handled by `utils/whereClause.js`.

Main entry points: [`client/src/App.js`](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/App.js) (Route application), [`controllers/userController.js`](https://github.com/guptaanshik1/schedulereminder/blob/main/controllers/userController.js) (Account controller), [`controllers/scheduleController.js`](https://github.com/guptaanshik1/schedulereminder/blob/main/controllers/scheduleController.js) (Schedule controller), [`app.js`](https://github.com/guptaanshik1/schedulereminder/blob/main/app.js) (Express composition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_client_boot["Client bootstrap<br/>React entry<br/>[index.js]"]
  node_client_app["Route application<br/>React router<br/>[App.js]"]
  node_client_guard["Protected routes<br/>access control<br/>[protectedRoute.js]"]
  node_client_auth["Account flows<br/>React components<br/>[login.js]"]
  node_client_schedule["Schedule workspace<br/>React components<br/>[createSchedule.js]"]
  node_client_services["Domain API services<br/>client API layer<br/>[scheduleService.js]"]
  node_http_service["HTTP transport<br/>client transport<br/>[httpService.js]"]
end

subgraph group_server["Express API"]
  node_server_boot["Server bootstrap<br/>Node entry<br/>[index.js]"]
  node_express_app["Express composition<br/>Express app<br/>[app.js]"]
  node_user_routes["User endpoints<br/>Express routes<br/>[user.js]"]
  node_schedule_routes["Schedule endpoints<br/>Express routes<br/>[schedule.js]"]
  node_user_controller["Account controller<br/>[userController.js]"]
  node_schedule_controller["Schedule controller"]
  node_user_middleware["User authorization<br/>Express middleware<br/>[user.js]"]
  node_token["Token & cookie issuance<br/>auth utility<br/>[cookieToken.js]"]
  node_query["Query construction<br/>filter utility<br/>[whereClause.js]"]
end

subgraph group_data["Persistence & effects"]
  node_user_model[("User model<br/>Mongoose model<br/>[user.js]")]
  node_schedule_model[("Schedule model<br/>Mongoose model<br/>[schedule.js]")]
  node_database[("MongoDB connection<br/>database integration<br/>[db.js]")]
  node_email["Email delivery<br/>external effect<br/>[emailHelper.js]"]
end

node_client_boot -->|"renders"| node_client_app
node_client_app -->|"uses"| node_client_guard
node_client_app -->|"routes to"| node_client_auth
node_client_app -->|"routes to"| node_client_schedule
node_client_auth -->|"calls"| node_client_services
node_client_schedule -->|"calls"| node_client_services
node_client_services -->|"uses"| node_http_service
node_http_service -->|"API requests"| node_express_app
node_server_boot -->|"starts"| node_express_app
node_express_app -->|"mounts"| node_user_routes
node_express_app -->|"mounts"| node_schedule_routes
node_user_routes -->|"authorizes with"| node_user_middleware
node_user_routes -->|"dispatches"| node_user_controller
node_schedule_routes -->|"authorizes with"| node_user_middleware
node_schedule_routes -->|"dispatches"| node_schedule_controller
node_user_controller -->|"reads and writes"| node_user_model
node_user_controller -->|"issues auth via"| node_token
node_user_controller -->|"sends messages"| node_email
node_schedule_controller -->|"reads and writes"| node_schedule_model
node_schedule_controller -->|"builds filters with"| node_query
node_schedule_controller -->|"sends reminders"| node_email
node_user_model -->|"persists through"| node_database
node_schedule_model -->|"persists through"| node_database

click node_client_boot "https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/index.js"
click node_client_app "https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/App.js"
click node_client_guard "https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/components/common/protectedRoute.js"
click node_client_auth "https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/components/login.js"
click node_client_schedule "https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/components/createSchedule.js"
click node_client_services "https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/services/scheduleService.js"
click node_http_service "https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/services/httpService.js"
click node_server_boot "https://github.com/guptaanshik1/schedulereminder/blob/main/index.js"
click node_express_app "https://github.com/guptaanshik1/schedulereminder/blob/main/app.js"
click node_user_routes "https://github.com/guptaanshik1/schedulereminder/blob/main/routes/user.js"
click node_schedule_routes "https://github.com/guptaanshik1/schedulereminder/blob/main/routes/schedule.js"
click node_user_controller "https://github.com/guptaanshik1/schedulereminder/blob/main/controllers/userController.js"
click node_schedule_controller "https://github.com/guptaanshik1/schedulereminder/blob/main/controllers/scheduleController.js"
click node_user_middleware "https://github.com/guptaanshik1/schedulereminder/blob/main/middlewares/user.js"
click node_user_model "https://github.com/guptaanshik1/schedulereminder/blob/main/models/user.js"
click node_schedule_model "https://github.com/guptaanshik1/schedulereminder/blob/main/models/schedule.js"
click node_database "https://github.com/guptaanshik1/schedulereminder/blob/main/config/db.js"
click node_email "https://github.com/guptaanshik1/schedulereminder/blob/main/utils/emailHelper.js"
click node_token "https://github.com/guptaanshik1/schedulereminder/blob/main/utils/cookieToken.js"
click node_query "https://github.com/guptaanshik1/schedulereminder/blob/main/utils/whereClause.js"

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_client_boot,node_client_app,node_client_guard,node_client_auth,node_client_schedule,node_client_services,node_http_service toneBlue
class node_server_boot,node_express_app,node_user_routes,node_schedule_routes,node_user_controller,node_schedule_controller,node_user_middleware,node_token,node_query toneAmber
class node_user_model,node_schedule_model,node_database,node_email toneMint
```

## Components

### React client

- [Client bootstrap](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/index.js): React entry · `client/src/index.js`
- [Route application](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/App.js): React router · Composes dashboards, schedules, settings, and authentication flows. · `client/src/App.js`
- [Protected routes](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/components/common/protectedRoute.js): access control · `client/src/components/common/protectedRoute.js`
- [Account flows](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/components/login.js): React components · Login, OTP, and password recovery interfaces. · `client/src/components/login.js`
- [Schedule workspace](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/components/createSchedule.js): React components · Creates, displays, filters, and completes schedules. · `client/src/components/createSchedule.js`
- [Domain API services](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/services/scheduleService.js): client API layer · Partitions auth, schedule, user, and admin operations. · `client/src/services/scheduleService.js`
- [HTTP transport](https://github.com/guptaanshik1/schedulereminder/blob/main/client/src/services/httpService.js): client transport · `client/src/services/httpService.js`

### Express API

- [Server bootstrap](https://github.com/guptaanshik1/schedulereminder/blob/main/index.js): Node entry · `index.js`
- [Express composition](https://github.com/guptaanshik1/schedulereminder/blob/main/app.js): Express app · Configures middleware and mounts domain routes. · `app.js`
- [User endpoints](https://github.com/guptaanshik1/schedulereminder/blob/main/routes/user.js): Express routes · `routes/user.js`
- [Schedule endpoints](https://github.com/guptaanshik1/schedulereminder/blob/main/routes/schedule.js): Express routes · `routes/schedule.js`
- [Account controller](https://github.com/guptaanshik1/schedulereminder/blob/main/controllers/userController.js): controller · `controllers/userController.js`
- [Schedule controller](https://github.com/guptaanshik1/schedulereminder/blob/main/controllers/scheduleController.js): controller · `controllers/scheduleController.js`
- [User authorization](https://github.com/guptaanshik1/schedulereminder/blob/main/middlewares/user.js): Express middleware · Establishes authorization and user context. · `middlewares/user.js`
- [Token & cookie issuance](https://github.com/guptaanshik1/schedulereminder/blob/main/utils/cookieToken.js): auth utility · `utils/cookieToken.js`
- [Query construction](https://github.com/guptaanshik1/schedulereminder/blob/main/utils/whereClause.js): filter utility · `utils/whereClause.js`

### Persistence & effects

- [User model](https://github.com/guptaanshik1/schedulereminder/blob/main/models/user.js): Mongoose model · `models/user.js`
- [Schedule model](https://github.com/guptaanshik1/schedulereminder/blob/main/models/schedule.js): Mongoose model · `models/schedule.js`
- [MongoDB connection](https://github.com/guptaanshik1/schedulereminder/blob/main/config/db.js): database integration · `config/db.js`
- [Email delivery](https://github.com/guptaanshik1/schedulereminder/blob/main/utils/emailHelper.js): external effect · Sends reminder and account-related messages. · `utils/emailHelper.js`

## Connections

- Client bootstrap → Route application: renders
- Route application → Protected routes: uses
- Route application → Account flows: routes to
- Route application → Schedule workspace: routes to
- Account flows → Domain API services: calls
- Schedule workspace → Domain API services: calls
- Domain API services → HTTP transport: uses
- HTTP transport → Express composition: API requests
- Server bootstrap → Express composition: starts
- Express composition → User endpoints: mounts
- Express composition → Schedule endpoints: mounts
- User endpoints → User authorization: authorizes with
- User endpoints → Account controller: dispatches
- Schedule endpoints → User authorization: authorizes with
- Schedule endpoints → Schedule controller: dispatches
- Account controller → User model: reads and writes
- Account controller → Token & cookie issuance: issues auth via
- Account controller → Email delivery: sends messages
- Schedule controller → Schedule model: reads and writes
- Schedule controller → Query construction: builds filters with
- Schedule controller → Email delivery: sends reminders
- User model → MongoDB connection: persists through
- Schedule model → MongoDB connection: persists through
