How ngtruongmetin/viviora works
Viviora is a social reading platform for middle-school students, with staff administration. The main journey is a signed-in reader discovering books and community posts, recording reading activity, and progressing through achievements, missions, and book-linked games; staff moderate content and manage platform resources. The React SPA routes users to these experiences, while Express exposes session-authenticated REST endpoints backed by PostgreSQL. The graph preserves documented AI advising, surveys, and question banks as distinct capabilities. Some routes and page implementations were not sampled, so their internal connections are omitted rather than inferred.
Main entry points: app.js Express API composition · db.js PostgreSQL pool · achievementService.js Achievement service · App.tsx React application
Components 22
Web experience
- React application
frontend/src/App.tsx - Page routing
frontend/src/routes/AppRoutes.tsx
Identity and access
- Session context
frontend/src/auth/AuthContext.tsx - Authentication API
backend/routes/auth.js - Role guards
backend/middlewares/auth.js
Community and progression
- Community pages
frontend/src/pages/community/FeedPage.tsx - Posts and feed API
backend/routes/posts.js - Moderation API
backend/routes/moderation.js - Profile and activity
backend/routes/profile.js - Achievement service
backend/services/achievementService.js - Weekly missions
backend/routes/weeklyMissions.js
Reading and learning
- Library pages
frontend/src/pages/library/LibraryPage.tsx - Library API
backend/routes/library.js - Catalog service
backend/services/libraryService.js - AI book advisor
backend/services/aiService.js - Question banks
backend/routes/questionBanks.js - Game sessions
backend/services/gameService.js - Survey service
backend/services/surveyService.js
API and persistence
- Express API composition
backend/app.js - PostgreSQL pool
backend/database/db.js - Session store
backend/sessionStore.js
Other components
- Reader or staff
Connections 31
- Reader or staff → React application: uses
- React application → Session context: provides context
frontend/src/App.tsx - React application → Page routing: renders routes
frontend/src/App.tsx - Page routing → Community pages: routes to
frontend/src/routes/AppRoutes.tsx - Session context → Authentication API: requests session
- Express API composition → Authentication API: mounts
backend/app.js - Express API composition → Posts and feed API: mounts
backend/app.js - Express API composition → Moderation API: mounts
backend/app.js - Express API composition → Profile and activity: mounts
backend/app.js - Express API composition → Library API: mounts
backend/app.js - Express API composition → Question banks: mounts
backend/app.js - Express API composition → Game sessions: mounts
backend/app.js - Express API composition → Weekly missions: mounts
backend/app.js - Express API composition → Survey service: mounts
backend/app.js - Express API composition → AI book advisor: mounts route
backend/app.js - Posts and feed API → Achievement service: evaluates
backend/routes/posts.js - Profile and activity → Achievement service: evaluates
backend/routes/profile.js - Authentication API → Achievement service: evaluates
backend/routes/auth.js - Library API → Catalog service: calls
backend/routes/library.js - Library API → Achievement service: evaluates
backend/routes/library.js - Game sessions → Achievement service: evaluates
backend/services/gameService.js - Posts and feed API → PostgreSQL pool: queries
backend/routes/posts.js - Profile and activity → PostgreSQL pool: queries
backend/routes/profile.js - Catalog service → PostgreSQL pool: queries
backend/services/libraryService.js - Achievement service → PostgreSQL pool: queries
backend/services/achievementService.js - Game sessions → PostgreSQL pool: queries
backend/services/gameService.js - AI book advisor → PostgreSQL pool: queries
backend/services/aiService.js - Survey service → PostgreSQL pool: queries
backend/services/surveyService.js - Express API composition → Session store: configures store
backend/app.js - Session store → PostgreSQL pool: uses pool
backend/sessionStore.js - Role guards → PostgreSQL pool: checks account
backend/middlewares/auth.js