How guptaanshik1/schedulereminder works
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: App.js Route application · userController.js Account controller · scheduleController.js Schedule controller · app.js Express composition
Components 20
React client
- Client bootstrap
client/src/index.js - Route application · Composes dashboards, schedules, settings, and authentication flows.
client/src/App.js - Protected routes
client/src/components/common/protectedRoute.js - Account flows · Login, OTP, and password recovery interfaces.
client/src/components/login.js - Schedule workspace · Creates, displays, filters, and completes schedules.
client/src/components/createSchedule.js - Domain API services · Partitions auth, schedule, user, and admin operations.
client/src/services/scheduleService.js - HTTP transport
client/src/services/httpService.js
Express API
- Server bootstrap
index.js - Express composition · Configures middleware and mounts domain routes.
app.js - User endpoints
routes/user.js - Schedule endpoints
routes/schedule.js - Account controller
controllers/userController.js - Schedule controller
controllers/scheduleController.js - User authorization · Establishes authorization and user context.
middlewares/user.js - Token & cookie issuance
utils/cookieToken.js - Query construction
utils/whereClause.js
Persistence & effects
- User model
models/user.js - Schedule model
models/schedule.js - MongoDB connection
config/db.js - Email delivery · Sends reminder and account-related messages.
utils/emailHelper.js
Connections 23
- 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