An AI-powered educational platform for personalized learning experiences.
SUNSCHOOL is a web-based educational platform that provides AI-generated lessons and achievement tracking for learners. The platform supports role-based access with three user types: administrators, parents, and learners.
- Features
- Technology Stack
- Installation
- Database Setup
- Running the Application
- Admin Onboarding
- User Roles
- API Endpoints
- Development
- Contributing
- License
- AI-Generated Lessons: Content created using OpenRouter API for personalized learning
- Achievement System: Gamified learning with badges and recognition
- User Management: Three-tier system with ADMIN, PARENT, and LEARNER roles
- Parent-Child Relationships: Parents can manage multiple learner accounts
- Database Synchronization: Parents can configure external PostgreSQL database connections for data backup
- Progress Tracking: Basic lesson completion and scoring
- Cross-Platform Web App: Works on desktop and mobile browsers
Administrators:
- Full system access
- User management capabilities
- System-wide data access
Parents:
- Manage their children's learner accounts
- View children's progress and achievements
- Configure database synchronization settings
- Access to personal family data only
Learners:
- Access assigned lessons
- View personal achievements
- Complete lessons and submit answers
- React 19.1.0 with TypeScript
- React Native Web for cross-platform compatibility
- React Query for data fetching and caching
- Wouter for client-side routing
- Vite for build tooling
- Node.js with Express.js 5.1.0
- TypeScript for type safety
- JWT authentication with role-based access control
- PostgreSQL (Neon serverless) with Drizzle ORM
- OpenRouter API for lesson content generation
- Perplexity API for enhanced knowledge context
- Jest for unit testing
- Playwright for end-to-end testing
- Drizzle Kit for database migrations
- Web Frontend: React application served via Express.js
- REST API: Express.js backend with JWT authentication
- Database: PostgreSQL with Drizzle ORM for schema management
- Session Management: Express sessions with database storage
- Authentication: JWT-based login with role verification
- Lesson Creation: AI-generated content via OpenRouter API
- Progress Tracking: Lesson completion and achievement awards
- Data Sync: Optional external PostgreSQL database connections
- Node.js (v18.x or newer)
- PostgreSQL database (local or cloud)
- npm package manager
git clone https://github.com/realityinspector/origen-one.git
cd origen-one
npm installCreate a .env file with required variables:
DATABASE_URL=postgresql://user:password@host:port/database
JWT_SECRET=your-jwt-secret-key
SESSION_SECRET=your-session-secret
OPENROUTER_API_KEY=your-openrouter-key
PERPLEXITY_API_KEY=your-perplexity-key
PORT=5000# Push schema to database
npm run db:push
# Optional: Seed with sample data
npm run db:seednpm run devStarts the server at http://localhost:5000 (or configured PORT).
npm run build
npm startOn first run, if no users exist, the system automatically creates an admin user. Check admin-credentials.txt for login details.
ts-node scripts/admin-onboard.ts- Full system access and user management
- Can view all data across the platform
- Manage their children's learner accounts
- View children's progress and achievements
- Configure database synchronization
- Access assigned lessons
- Complete lessons and view achievements
POST /login- User loginPOST /register- User registrationPOST /logout- User logoutGET /user- Get current user info
GET /api/parents- List parents (ADMIN only)GET /api/learners- List learners (PARENT, ADMIN)POST /api/learners- Create learner (PARENT, ADMIN)DELETE /api/learners/:id- Delete learner (PARENT, ADMIN)GET /api/learner-profile/:userId- Get learner profilePUT /api/learner-profile/:userId- Update learner profile (PARENT, ADMIN)
POST /api/lessons/create- Create lessonGET /api/lessons/active- Get active lessonGET /api/lessons/:lessonId- Get lesson detailsGET /api/lessons- List lessonsPOST /api/lessons/:lessonId/answer- Submit lesson answers
GET /api/achievements- Get user achievements
GET /api/sync-configs- List sync configurations (PARENT)POST /api/sync-configs- Create sync configuration (PARENT)GET /api/sync-configs/:id- Get sync config (PARENT)PUT /api/sync-configs/:id- Update sync config (PARENT)DELETE /api/sync-configs/:id- Delete sync config (PARENT)POST /api/sync-configs/:id/push- Trigger sync (PARENT)
GET /api/reports- Get reportsGET /api/export- Export data (PARENT, ADMIN)GET /api/healthcheck- Health check
client/- React frontendserver/- Express.js backendshared/- TypeScript schemas and typesscripts/- Database and utility scripts
npm run dev- Start development servernpm run db:push- Update database schemanpm run db:seed- Seed database with test datanpm test- Run unit testsnpx playwright test- Run e2e tests
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License