How mubasshirahin/austwise works
Purpose and Runtime Shape
AUSTWise is a PWA/student utility platform for AUST: academic routines and tracking, campus/life tools, collaborative/community features, study vaults, messaging, and account services. It is a React SPA built by Vite and served with a custom Node HTTP server, which also exposes APIs and WebSockets. Primary entry points: src/main.jsx, src/App.jsx, server/dev.mjs.
Client Application Shell
App.jsx is the route/page composition boundary; shared navigation and responsive shell surround feature pages. Application-wide UI state is supplied through React contexts for identity, themes, routines, and Pomodoro state. Key paths: src/App.jsx, src/context/AuthContext.jsx, src/layout/Sidebar.jsx.
Feature-Domain Modules
The client is organized as independently rendered feature directories rather than a generic backend-driven CMS. Major domains include dashboard/planning, campus operations, analytics, vault, marketplace/community, and lifestyle tools. Feature pages combine local components, client storage/API utilities, and domain-specific CSS. Representative roots: src/features/dashboard/DashboardPage.jsx, src/features/campus/CampusPage.jsx, src/features/vault/VaultPage.jsx.
Academic Planning and Insight Flow
Routine context and planner/dashboard components drive schedule, attendance, deadlines, exam flow, and weekly planning. Analytics modules render CGPA, semester progress, course feedback, prerequisites, and departmental heatmaps. Course and route datasets are bundled where suitable, while runtime campus/course records may come from the server/database. Paths: src/context/RoutineProvider.jsx, src/features/dashboard/RoutineAttendanceTracker.jsx, src/features/analytics/AnalyticsPage.jsx.
Server API, Identity, and Authorization
The zero-framework Node server is the API router, SPA host in production, static/data integration point, and environment gate for dev-only APIs. Authentication uses JWTs in HttpOnly/SameSite cookies with bcrypt password hashing; middleware and rate limiting enforce request boundaries. Role/admin functions are backed by dedicated persistence modules. Paths: server/dev.mjs, server/auth.mjs, server/middleware.mjs, server/rateLimiter.mjs, server/roleAppDB.mjs.
Persistence and Sensitive Data Boundary
SQL Server is the intended relational store, accessed through mssql/Prisma integration and schema definitions; JSON-backed modules provide runtime/fallback persistence for users, messages, library activity, marketplace-style stores, and feature data. Password-vault records cross an explicit encryption boundary using AES-256-GCM. Paths: server/db.mjs, server/prisma/schema.prisma, server/jsonDB.mjs, server/passwordCrypto.mjs, server/passwordVaultDB.mjs.
Real-Time and External Integrations
WebSocket infrastructure supports live messaging and related notifications; client hooks consume socket and notification state. Telegram notifier/scheduler modules provide outbound notification capability. Social OAuth, Google Drive-related client utilities, payments, and routine extraction are integration boundaries requiring environment/configured credentials or service behavior. Paths: server/wsServer.mjs, src/hooks/useWebSocket.js, server/telegramNotifier.mjs, server/payment.mjs.
Deployment and Operational Boundaries
Development runs Vite HMR plus the API server on port 5174. Production builds the SPA and serves it from Node; TLS is explicitly terminated by a reverse proxy, which must forward WebSocket upgrades. SQL Server credentials, JWT secret, vault crypto key, cookie security, and CORS origins are environment-controlled. Deployment descriptors: package.json, render.yaml, vercel.json.
Main entry points: dev.mjs Node HTTP server · App.jsx App shell & routes · DashboardPage.jsx Dashboard & planner · wsServer.mjs WebSocket server
Components 24
React PWA Client
Vite-built single-page application.
- Client entry
src/main.jsx - App shell & routes · Shared responsive navigation surrounds feature pages.
src/App.jsx - Identity context
src/context/AuthContext.jsx - Sidebar navigation
src/layout/Sidebar.jsx - Routine state · Drives planning, schedules, and attendance state.
src/context/RoutineProvider.jsx - Socket client hook
src/hooks/useWebSocket.js
Client Domains
- Dashboard & planner
src/features/dashboard/DashboardPage.jsx - Routine attendance
src/features/dashboard/RoutineAttendanceTracker.jsx - Campus operations
src/features/campus/CampusPage.jsx - Academic analytics · CGPA, progress, feedback, prerequisites, and heatmaps.
src/features/analytics/AnalyticsPage.jsx - Study vault
src/features/vault/VaultPage.jsx
Node API Runtime
Hosts production SPA, APIs, and sockets.
- Node HTTP server · Dev API gate and production static host.
server/dev.mjs - Authentication · Uses HttpOnly/SameSite JWT cookies and bcrypt passwords.
server/auth.mjs - Request protection · Authorization and request-boundary enforcement.
server/middleware.mjs - Rate limiter
server/rateLimiter.mjs
Persistence & Security
- SQL Server / Prisma · Intended relational store and schema boundary.
server/db.mjs - Prisma schema
server/prisma/schema.prisma - JSON feature stores · Runtime stores for users, messages, library, marketplace, and features.
server/jsonDB.mjs - Role/admin store
server/roleAppDB.mjs - Password vault store · Vault records cross AES-256-GCM encryption.
server/passwordVaultDB.mjs - Vault encryption
server/passwordCrypto.mjs
Realtime & External Services
- WebSocket server · Live messaging and notification transport.
server/wsServer.mjs - Telegram notifications
server/telegramNotifier.mjs - Payment integration
server/payment.mjs
Connections 26
- Client entry → App shell & routes: mounts
- App shell & routes → Identity context: uses
- App shell & routes → Sidebar navigation: renders
- App shell & routes → Dashboard & planner: routes to
- App shell & routes → Campus operations: routes to
- App shell & routes → Academic analytics: routes to
- App shell & routes → Study vault: routes to
- Dashboard & planner → Routine state: consumes
- Dashboard & planner → Routine attendance: includes
- Academic analytics → Node HTTP server: reads runtime data
- Campus operations → Node HTTP server: uses APIs
- Study vault → Node HTTP server: uses APIs
- Socket client hook → WebSocket server: WebSocket
- Node HTTP server → Request protection: applies
- Request protection → Authentication: validates identity
- Node HTTP server → Rate limiter: limits requests
- Authentication → Role/admin store: loads roles
- Node HTTP server → SQL Server / Prisma: queries
- SQL Server / Prisma → Prisma schema: defined by
- Node HTTP server → JSON feature stores: uses fallback stores
- Node HTTP server → Password vault store: stores vault records
- Password vault store → Vault encryption: encrypts through
- Node HTTP server → WebSocket server: hosts
- WebSocket server → JSON feature stores: persists messages
- Node HTTP server → Telegram notifications: sends notifications
- Node HTTP server → Payment integration: initiates payments