How sidd19898/jswm works
Purpose and Top-Level Shape
JSWM (“Just Stay With Me”) is an in-progress full-stack productivity system combining personal TODO tasks, reminders/habit tracking, and education workflows. It is split into a Vite/React single-page frontend and a Node.js backend with route modules, middleware, and domain models.
Application Entry Points
• Backend server startup and route composition: backend/index.js
• Frontend React bootstrap: frontend/src/main.jsx
• Frontend application shell: frontend/src/App.jsx
• Primary user-facing screens include dashboard, login/signup, and landing: frontend/src/pages/Dashboard.jsx, frontend/src/pages/Login.jsx, frontend/src/pages/landing.jsx
Frontend UI and State Boundary
The frontend is a React SPA organized around reusable dashboard/task UI components. The dashboard assembles operational views such as task display, task creation, reminder UI, navigation, and sidebars.
• Task/dashboard composition: frontend/src/pages/Dashboard.jsx, frontend/src/components/Taskview.jsx, frontend/src/components/OperatingBoard.jsx
• Task mutation interface: frontend/src/components/Addtask.jsx
• Shared task-removal state is represented through React context: frontend/src/context/RemovetaskContext.jsx
Frontend API Layer
Client-server communication is centralized in a small API layer rather than embedded directly in screen components.
• Axios client setup: frontend/src/api/axios.js
• Authentication requests: frontend/src/api/auth.js
• Task requests: frontend/src/api/tasks.js
This creates the principal boundary between browser state/UI and backend HTTP endpoints.
Backend HTTP, Authentication, and Access Control
The backend is an Express-style HTTP service. Routes separate the main functional areas: user identity, tasks, education, collaboration, and habits.
• Route modules: backend/routes/user.js, backend/routes/task.js, backend/routes/education.js
• Additional domain endpoints: backend/routes/collaboration.js, backend/routes/habit.js
• Authentication and student-specific authorization middleware: backend/middleware/authMiddleware.js, backend/middleware/studentcheck.js
• Upload handling is a separate request-processing concern: backend/middleware/upload.js
Expected control flow is request → authentication/role middleware where required → route handler → model/database operation → HTTP response.
Persistence and Domain Model Layer
Persistence is configured independently from request handling, with a database connection module at backend/config/db.js. The model set indicates a broad education/productivity schema, likely backed by MongoDB/Mongoose or a comparable document-model integration.
Architecture-defining domains include:
• Identity and roles: backend/model/jswm/user.js, backend/model/jswm/students.js, backend/model/jswm/teachers.js
• Personal productivity: backend/model/jswm/task.js, backend/model/jswm/habitTracker.js
• Educational activity: backend/model/jswm/class.js, backend/model/jswm/homework.js, backend/model/jswm/submissions.js
• Scheduling/communications: backend/model/jswm/lectures.js, backend/model/jswm/exam.js, backend/model/jswm/announcement.js
• Collaboration and school calendar: backend/model/jswm/Collaboration.js, backend/model/jswm/holidays.js
Key Functional Flows
1. A user signs up or logs in through frontend auth calls, which reach user routes and pass through authentication controls for protected operations.
2. Authenticated users interact with the dashboard to create, view, or remove tasks; React components call the task API, which reaches backend/routes/task.js and the task model.
3. Education-oriented users access class, homework, lecture, exam, submission, and announcement workflows through the education route boundary and corresponding models.
4. Habit/reminder interactions follow the habit route boundary and persist through the habit-tracker domain model.
Runtime and External Dependencies
The frontend runs as a Vite-served React application (frontend/vite.config.js, frontend/package.json). The backend runs under Node.js (backend/package.json) and obtains database/environment configuration through backend/config/db.js and backend/.env.example. The README links a Figma prototype as the primary external design reference.
Main entry points: index.js Backend server · education.js Education routes · db.js Database connection · Dashboard.jsx User screens
Components 20
React frontend
Vite-served single-page application.
- Vite runtime
frontend/vite.config.js - React bootstrap
frontend/src/main.jsx - Application shell
frontend/src/App.jsx - User screens · Dashboard, login/signup, and landing screens.
frontend/src/pages/Dashboard.jsx - Task dashboard UI · Composes task views, operating board, and task creation.
frontend/src/components/Taskview.jsx - Task removal state
frontend/src/context/RemovetaskContext.jsx - Client API layer · Centralizes authentication and task HTTP requests.
frontend/src/api/axios.js
Node backend
Express HTTP service and request middleware.
- Backend server · Starts the service and composes route modules.
backend/index.js - Identity routes
backend/routes/user.js - Task routes
backend/routes/task.js - Education routes · Serves class, homework, lecture, exam, submission, and announcement workflows.
backend/routes/education.js - Habit routes
backend/routes/habit.js - Collaboration routes
backend/routes/collaboration.js - Access middleware · Authenticates protected requests and checks student access.
backend/middleware/authMiddleware.js - Upload processing
backend/middleware/upload.js
Domain persistence
Document-model domain data backed by the configured database.
- Identity models · User, student, and teacher records.
backend/model/jswm/user.js - Productivity models
backend/model/jswm/task.js - Education models · Classes, homework, submissions, lectures, exams, and announcements.
backend/model/jswm/class.js - Collaboration models
backend/model/jswm/Collaboration.js - Database connection · Connects domain models to the database.
backend/config/db.js
Connections 26
- Vite runtime → React bootstrap: serves
- React bootstrap → Application shell: mounts
- Application shell → User screens: renders
- User screens → Task dashboard UI: dashboard composition
- Task dashboard UI → Task removal state: shares removal state
- User screens → Client API layer: auth requests
- Task dashboard UI → Client API layer: task requests
- Client API layer → Backend server: HTTP requests
- Backend server → Identity routes: mounts
- Backend server → Task routes: mounts
- Backend server → Education routes: mounts
- Backend server → Habit routes: mounts
- Backend server → Collaboration routes: mounts
- Identity routes → Access middleware: protects operations
- Task routes → Access middleware: protects operations
- Education routes → Access middleware: role-gated access
- Education routes → Upload processing: handles uploads
- Identity routes → Identity models: reads and writes
- Task routes → Productivity models: reads and writes tasks
- Habit routes → Productivity models: persists habits
- Education routes → Education models: reads and writes
- Collaboration routes → Collaboration models: reads and writes
- Identity models → Database connection: uses connection
- Productivity models → Database connection: uses connection
- Education models → Database connection: uses connection
- Collaboration models → Database connection: uses connection