Developer Guide
Welcome to the LMS Developer Guide! This documentation provides comprehensive technical information for developers working on the Learning Management System.
Overview
The LMS is built as a modern, full-stack web application with a focus on type safety, scalability, and developer experience. It uses a monorepo architecture managed by Turborepo.
Technology Stack
Frontend
- React 19 - UI library
- TypeScript - Type-safe JavaScript
- Vite - Build tool and dev server
- TanStack Query - Data fetching and caching
- Redux Toolkit - State management
- React Router 7 - Client-side routing
- Tailwind CSS 4 - Utility-first CSS
- Radix UI - Accessible component primitives
- Tiptap - Rich text editor
- Vitest - Unit testing
Backend
- Node.js with Bun - Runtime
- Express 5 - Web framework
- TypeORM - ORM for database interactions
- TSOA - TypeScript OpenAPI generator
- PostgreSQL - Primary database
- JWT - Authentication
- Argon2 - Password hashing
Cloud Functions
- Cloudflare Workers - Serverless edge computing
- Hono - Lightweight web framework
- Wrangler - Cloudflare Workers CLI
Shared Packages
- @repo/api - Auto-generated type-safe API client
- @repo/db - Database entities and models
- @repo/utils - Shared utilities
- @repo/translations - Internationalization
- @repo/vite-plugin-i18n-types - i18n type generation
External Services
- Firebase - Authentication and storage
- Appwrite - Alternative storage provider
- OpenAI - AI chat functionality
Project Structure
fyp/
├── apps/
│ ├── client-frontend/ # React frontend application
│ ├── client-backend/ # Express backend API
│ ├── cloud-functions/ # Cloudflare Workers
│ └── docs/ # VitePress documentation
├── packages/
│ ├── api/ # Generated API client
│ ├── db/ # Database entities
│ ├── utils/ # Shared utilities
│ ├── translations/ # i18n resources
│ ├── lint/ # Shared ESLint config
│ └── vite-plugin-i18n-types/ # i18n type plugin
├── deployment/ # Deployment configurations
├── package.json # Root package configuration
├── pnpm-workspace.yaml # pnpm workspace config
└── turbo.json # Turborepo configurationKey Features
Type Safety
- End-to-end type safety from database to frontend
- OpenAPI-based API contract
- Auto-generated TypeScript types
- Type-safe database queries with TypeORM
Developer Experience
- Hot module replacement in development
- Fast builds with Vite and Bun
- Integrated linting and formatting
- Comprehensive test coverage
- Automated code generation
Architecture Highlights
- Monorepo with shared packages
- Separation of concerns
- RESTful API design
- Event-driven architecture
- Scalable cloud functions
Getting Started
To get started with development, see the Getting Started guide.
Documentation Sections
Architecture
- System Overview - High-level architecture and design patterns
- Type Safety Flow - How types flow through the system
Components
- Frontend - React application structure and patterns
- Backend - Express API and business logic
- Cloud Functions - Serverless functions on Cloudflare
Packages
- API Package - Auto-generated API client
- Database Package - Entities and database configuration
- Utils Package - Shared utilities
- i18n Plugin - Internationalization type generation
Additional Topics
- Testing - Testing strategies and tools
- Deployment - Deployment process and CI/CD
Development Workflow
- Setup - Clone repository and install dependencies
- Development - Make changes with hot reload
- Type Generation - Types are auto-generated from OpenAPI spec
- Testing - Write and run tests
- Linting - Ensure code quality
- Build - Build for production
- Deploy - Deploy to staging/production
Contributing
When contributing to the LMS:
- Follow the TypeScript and React best practices
- Maintain type safety throughout
- Write tests for new features
- Update documentation
- Follow the existing code style
- Create meaningful commit messages
Code Quality
The project maintains high code quality through:
- TypeScript strict mode
- ESLint with custom rules
- Prettier for formatting
- Automated testing
- Code reviews
- CI/CD checks
Support
For development questions:
- Check this documentation
- Review the codebase examples
- Consult the API documentation
- Reach out to the development team
Next Steps
- Getting Started - Set up your development environment
- Architecture Overview - Understand the system design
- Frontend Guide - Start building UI components