Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design-Project

This repository delivers an offline-first EdTech platform.

Backend

Python FastAPI service with AI workers (LangChain/OpenAI) and PostgreSQL via SQLAlchemy.

Frontend (React Native/Expo)

New Screens & Features

  • Profile: view/edit name, email, password; logout (mobile) and /profile web page.
  • Settings: push-notification permission and registration.
  • History: view past chapter progress with timestamps (mobile) and /history web page.
  • Content: generate AI content via the /content API.
  • Admin: (role=admin) mobile panel and web analytics dashboard at /dashboard.
  • Teacher Portal: role=teacher (or admin) sees Teacher screen which loads /teacher web portal page; teachers can create classes, enroll students, and assign chapters as lessons. A new mobile Classes section lets both students and teachers browse their classrooms and view assignments. Teachers can also perform these operations from the app; offline actions are queued and synchronized automatically when connectivity returns.

All code is modern ES6 JavaScript; TypeScript is intentionally not used.

Dependencies

Install via expo/npm:

expo install react-native-screens react-native-safe-area-context
npm install @react-navigation/native @react-navigation/native-stack nativewind
expo install react-native-svg
expo install @react-native-community/netinfo expo-sqlite @react-native-async-storage/async-storage expo-notifications
npm install react-native-markdown-display react-native-mathjax

For the web dashboard we use FastAPI templates; install jinja2 (already pulled by FastAPI) and run the backend normally.

You'll also need a tailwind.config.js and corresponding postcss config for NativeWind.

Entry point

src/App.js initializes the SQLite database and loads the AppNavigator stack, which contains LessonScreen and QuizScreen.

Offline synchronization

  • src/database/db.js defines local tables LocalChapters and LocalProgress.
  • src/hooks/useSyncState.js returns 'Offline', 'Syncing', or 'Online' and triggers sync logic via useSyncEffect.
  • src/services/syncWorker.js pulls chapter data; pushWorker.js pushes unsynced progress.

Further components include HighlightToAsk, and screens for lessons and quizzes.

Authentication

Backend provides /api/v1/auth/register and /api/v1/auth/login endpoints. The login endpoint uses OAuth2 password grant and returns a JWT. The frontend stores the token in AsyncStorage and includes it in sync requests via an Authorization header.

Default user data is decoded from the JWT to obtain userId which is also persisted locally.

Profile Endpoints

  • GET /api/v1/profile/me returns current user details.
  • PUT /api/v1/profile/me updates name/email/password; email uniqueness enforced.

Analytics Query

  • GET /api/v1/analytics-query/user returns the authenticated user’s event history (optional start/end ISO timestamps).
  • GET /api/v1/analytics-query/summary returns aggregated event counts by type (filterable by event_type).

Content Generation

  • POST /api/v1/content/generate accepts {input_text} and returns generated markdown, flashcards, and quiz.
  • POST /api/v1/content/translate accepts generated JSON and target_language to produce translated output.

Progress & History

  • GET /api/v1/progress/history returns the user’s chapter progress records with titles and timestamps.

Notifications

  • POST /api/v1/notifications/register accepts {token} to register Expo push tokens.
  • POST /api/v1/notifications/send (admin) sends a notification via Expo push API. Payload: {title, body, user_id?}.

Admin Endpoints

Accessible to user ID 1 (stubbed admin). Provide:

  • GET /api/v1/admin/users – list users.
  • GET /api/v1/admin/chapters – list chapters.
  • GET /api/v1/admin/classrooms – list all classrooms.
  • GET /api/v1/admin/assignments – list all assignments.

The mobile Admin screen now shows classrooms and assignment titles in addition to users and chapters.

Future admin features may include content moderation, user management, etc.

Sync upgrades

Push operations now send last_updated timestamps, include a version number, and are split into batches of 20. The backend performs richer conflict resolution by comparing versions, averaging when versions match, and returns canonical progress rows (with updated versions) so the client can reconcile and mark them synced. Note: the local SQLite schema adds a version column; existing installations may need a migration or database reset.

Additionally, an offline QueuedTasks table is available. Several services (content generation, classroom creation, enrollment, assignment posting) write to the queue when an operation fails due to network issues. The useSyncEffect hook calls processQueue() whenever connectivity is restored so queued actions are replayed automatically.

Push operations now send last_updated timestamps, include a version number, and are split into batches of 20. The backend performs richer conflict resolution by comparing versions, averaging when versions match, and returns canonical progress rows (with updated versions) so the client can reconcile and mark them synced. Note: the local SQLite schema adds a version column; existing installations may need a migration or database reset.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages