How nguyenlephianh56/englishaiweb works
EnglishAI is a web app for adaptive, AI-assisted English learning, with student, teacher, and admin experiences. Users enter through the client’s public landing/auth routes; authenticated users reach role-specific workspaces for learning, class and assignment management, or administration. The server exposes API modules for identity, classes, exercises, assignments, and attempts, alongside AI, analytics, reporting, and related capabilities visible in the tree. Shown excerpts establish selected routing and service calls; links to unsampled modules are omitted or marked unverified rather than inferred as confirmed calls.
Main entry points: app.ts HTTP API · prisma.ts PostgreSQL data · router.tsx Role-based routes · auth.service.ts Account and session logic
Components 25
Web client
- Role-based routes
client/src/app/router.tsx - Landing experience
client/src/features/landing/LandingPage.tsx - Login and registration
client/src/features/auth - Role workspaces
client/src/features - API client
client/src/api/client.ts - Session hook
client/src/hooks/useAuth.ts - Auth API
client/src/api/auth.ts
Identity and access
- Auth endpoints
server/src/modules/auth/auth.routes.ts - Account and session logic
server/src/modules/auth/auth.service.ts - Authentication and roles
server/src/middlewares/auth.ts
Learning workflow
- Exercise library
server/src/modules/exercises/exercises.service.ts - Exercise grading
server/src/modules/grading/grading.service.ts - Student attempts
server/src/modules/attempts/attempts.controller.ts - Learning paths
server/src/modules/learning-paths - Skill profiles
server/src/modules/skill-profiles
Classroom operations
- Admin management
server/src/modules/admin/admin.controller.ts - Class management
server/src/modules/classes/classes.controller.ts - Assignments
server/src/modules/assignments/assignments.service.ts
Platform services
- HTTP API
server/src/app.ts - AI generation and analysis
server/src/ai - Analytics and reports
server/src/modules/analytics - Notifications and reminders
server/src/modules/notifications - PostgreSQL data
server/src/config/prisma.ts - API response format
server/src/utils/response.ts
Other components
- Learners and staff
Connections 29
- Learners and staff → Role-based routes: opens
client/src/app/router.tsx - Role-based routes → Landing experience: routes to
client/src/app/router.tsx - Role-based routes → Login and registration: routes to
client/src/app/router.tsx - Role-based routes → Role workspaces: routes by role
client/src/app/router.tsx - Session hook → Auth API: calls
client/src/hooks/useAuth.ts - Auth API → API client: uses
client/src/api/auth.ts - API client → HTTP API: sends API requests
- HTTP API → Auth endpoints: mounts
server/src/app.ts - HTTP API → Admin management: mounts admin routes
server/src/app.ts - HTTP API → Class management: mounts class routes
server/src/app.ts - HTTP API → Exercise library: mounts exercise routes
server/src/app.ts - HTTP API → Student attempts: mounts attempt routes
server/src/app.ts - HTTP API → Assignments: mounts assignment routes
server/src/app.ts - Auth endpoints → Account and session logic: dispatches
server/src/modules/auth/auth.routes.ts - Account and session logic → PostgreSQL data: reads and writes
server/src/modules/auth/auth.service.ts - Account and session logic → Authentication and roles: issues JWT
- Authentication and roles → PostgreSQL data: looks up user
server/src/middlewares/auth.ts - Admin management → PostgreSQL data: manages users
- Class management → PostgreSQL data: manages classes
- Exercise library → PostgreSQL data: stores exercises
- Student attempts → PostgreSQL data: stores attempts
- Assignments → PostgreSQL data: stores assignments
- Student attempts → Exercise grading: grades submissions
- Exercise library → AI generation and analysis: may use AI
- Learning paths → AI generation and analysis: may personalize with AI
- Skill profiles → Analytics and reports: informs insights
- Analytics and reports → PostgreSQL data: reads learning data
- Notifications and reminders → PostgreSQL data: reads notification data
- HTTP API → API response format: uses response helpers