GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - mfarim/fastapi-elearning-react: E-Learning for online examination at Junior high school

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
backend
backend
 
 
frontend
frontend
 
 
screenshots
screenshots
 
 
scripts
scripts
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.id.md
README.id.md
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 

Repository files navigation

๐Ÿ“š Python FastAPI & React E-Learning LMS & CBT Platform

Backend CI Frontend CI Python 3.12 FastAPI SQLAlchemy 2.0 Pydantic v2 React 19 Tailwind CSS v4 PostgreSQL Redis Spring Edition Laravel Edition License

๐Ÿ‡ฎ๐Ÿ‡ฉ Baca dalam Bahasa Indonesia

โ˜• Looking for the Java Spring Boot & React edition? Visit: https://github.com/mfarim/spring-elearning-react

๐Ÿ˜ Looking for the Laravel & Livewire edition? Visit: https://github.com/mfarim/laravel-elearning

A high-performance enterprise web-based E-Learning and Computer Based Test (CBT) platform for managing modern academic learning activities between Admin, Teacher, and Student. Built with a decoupled cloud-ready architecture: Python 3.12, FastAPI, SQLAlchemy 2.0 (Asyncpg), Pydantic v2, React 19, and Tailwind CSS v4, featuring stateless JWT authentication with impersonation, Redis Pub/Sub, native WebSocket real-time candidate proctoring, and openpyxl Excel batch processing.


โœจ Key Features

๐Ÿ‘จโ€๐Ÿ’ผ Admin Panel

Feature Description
Dashboard Real-time statistics overview: teachers, students, classrooms, subjects, CBT metrics
Teachers Full CRUD with automatic user account provisioning & NIP validation
Students CRUD + classroom filtering + ๐Ÿ“ฅ Excel Batch Import (.xlsx) + Exam Cards Print
Classrooms CRUD + homeroom teacher assignment + capacity & academic year management
Subjects CRUD + subject code + credit units + assigned teacher mapping
Announcements CRUD + multi-target broadcasting (All / Teacher / Student) + publish toggle
Impersonation Instant one-click login as teacher or student for administrative debugging
Security OAuth2 Bearer JWT tokens, BCrypt hashing, and dependency-injected role checking

๐Ÿ‘จโ€๐Ÿซ Teacher Panel

Feature Description
Dashboard Teaching metrics, scheduled examinations, active assignments, and recent activity
Learning Materials CRUD + multi-type content (Document, Video, Text, Link, Audio) + student view tracking
Assignments CRUD + deadline dates + instructions + submission grading with feedback
CBT Examinations CRUD + duration timer + passing grade (KKM) + randomize questions/options + retry toggles
Question Builder Multiple Choice (A-E), True/False, Essay + points allocation + ๐Ÿ“ฅ Excel Import
Live Telemetry Monitor Real-time WebSocket candidate status, question progress bar, and anti-cheat flag alerts
Exam Hall Tickets Print ready-to-use official CBT student candidate cards with NIS barcodes

๐Ÿ‘จโ€๐ŸŽ“ Student Panel โ€” Mobile-First Design

Feature Description
Home Dashboard Responsive mobile drawer, upcoming exams countdown, active assignments, announcements
Learning Modules Browse, read, and download structured course materials per enrolled subject
Assignment Hub View assignment instructions + file upload dropzone + feedback review
CBT Exam Room Fullscreen examination runner with countdown timer, anti-cheat detection, and auto-submit
Grades & GPA Summary Subject average breakdown, progress bars, and passing grade pass/fail status

๐Ÿ–ฅ๏ธ CBT Exam System Workflow

Exam List โ†’ Confirmation & Instructions โ†’ Secure Exam Runner
                                           โ”œโ”€โ”€ โฑ๏ธ Synchronized Timer (auto-submit on expiry)
                                           โ”œโ”€โ”€ ๐Ÿ”’ Anti-Cheat Proctoring (fullscreen & tab change alerts)
                                           โ”œโ”€โ”€ ๐Ÿ“ Color-Coded Question Palette (answered / remaining)
                                           โ”œโ”€โ”€ ๐Ÿ’พ Instant Auto-Save (on every option selection)
                                           โ””โ”€โ”€ ๐Ÿ“Š Real-Time Proctoring Telemetry (/ws/exams/{id}/monitor)

๐Ÿ“ธ Screenshots Showcase

๐Ÿ” Authentication & Role Impersonation

Login Page

๐Ÿ‘จโ€๐Ÿ’ผ Administrator Module

Admin Dashboard Classroom Management
Admin Dashboard Classroom Management
Subject Management Teacher Management
Subject Management Teacher Management
Student Management & Excel Import School Announcements
Student Management Announcements

๐Ÿ‘จโ€๐Ÿซ Teacher Module

Teacher Dashboard Learning Material Catalog
Teacher Dashboard Learning Materials
Assignment & Homework Hub CBT Examination Management
Assignments Hub CBT Exams
Interactive Question Bank Editor
Question Editor

๐Ÿ‘จโ€๐ŸŽ“ Student Module (Desktop & Mobile Optimized)

Student Home Dashboard Student Learning Modules
Student Dashboard Student Materials
Student Assignments & Submissions CBT Active Examinations
Student Assignments Student CBT
Academic Gradebook & Performance
Student Grades

๐Ÿ› ๏ธ Tech Stack & Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   React 19 SPA Client                  โ”‚
โ”‚       Vite โ€ข TypeScript โ€ข Tailwind CSS v4 โ€ข Zustand    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚ REST APIs & WebSockets
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  FastAPI Backend Server                โ”‚
โ”‚       Python 3.12 โ€ข Pydantic v2 โ€ข SQLAlchemy 2.0 Async โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                    โ”‚                    โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  PostgreSQL โ”‚      โ”‚    Redis    โ”‚      โ”‚ Local/MinIO โ”‚
โ”‚  (Database) โ”‚      โ”‚  (Pub/Sub)  โ”‚      โ”‚  (Storage)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Backend: Python 3.12, FastAPI, Uvicorn, SQLAlchemy 2.0 Async Engine, asyncpg, Alembic, Pydantic v2, Python-JOSE (JWT), Passlib (BCrypt), openpyxl.
  • Frontend: React 19, TypeScript, Vite, Tailwind CSS v4, Zustand, Axios, Lucide React.
  • Infrastructure: Docker, Docker Compose, PostgreSQL 16, Redis 7, MinIO.

๐Ÿš€ Getting Started & Local Development

You can run this project locally in two ways:

  1. Full Docker Compose (Recommended) โ€” All services (Database, Redis, MinIO, Backend, Frontend) run containerized with zero manual configuration.
  2. Hybrid Setup (Best for Active Development) โ€” Run infrastructure (Postgres, Redis, MinIO) in Docker, while running Backend & Frontend on your host machine for instant live-reload.
  3. Full Manual Local Setup โ€” Run everything natively on your machine.

๐Ÿณ Method 1: Running with Docker Compose (Recommended)

Docker Compose provides a complete, turnkey environment with isolated network ports that avoid conflicts with existing services.

1. Clone & Configure Environment

git clone https://github.com/mfarim/python-fastapi-react-elearning.git
cd python-fastapi-react-elearning

# (Optional) Copy environment template if you wish to customize ports or credentials
cp .env.example .env

2. Build & Launch Containers

docker compose up -d --build

Note: The backend container automatically checks the database connection, provisions all database tables, and executes the demo database seeder on initial startup.

3. Access URLs & Services

Service URL / Port Credentials / Notes
Frontend Web App http://localhost:3001 Nginx reverse proxy routing /api & /ws to backend
FastAPI Swagger Docs http://localhost:8000/docs Interactive OpenAPI 3.1 documentation
FastAPI ReDoc http://localhost:8000/redoc Alternative clean API specification
Backend Health Check http://localhost:8000/health API health status endpoint
PostgreSQL Database localhost:5434 DB: elearning | User: postgres | Pass: postgres
Redis Cache / PubSub localhost:6380 High-speed cache & CBT WebSocket channel

4. Useful Docker Commands

  • Check container status:

    docker compose ps
  • View live streaming logs:

    # View all container logs
    docker compose logs -f
    
    # Or view specific service logs
    docker compose logs -f backend
    docker compose logs -f frontend
  • Re-run or reset database seeding manually:

    docker compose exec backend python -m app.scripts.seed_demo_data
  • Access backend bash shell inside container:

    docker compose exec backend bash
  • Stop all services:

    docker compose down
  • Stop and wipe all data volumes (Fresh Reset):

    docker compose down -v

โšก Method 2: Hybrid Setup (Docker Infra + Local Hot Reload)

This method is recommended for active feature development because it preserves fast hot-reloading for both FastAPI and React/Vite without rebuilding images.

1. Start Infrastructure Only

docker compose up -d postgres redis

2. Run Backend (FastAPI) Locally

cd backend

# Create & activate virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install Python dependencies
pip install -r requirements.txt

# Run initial database seeder (creates tables + seeds demo data)
python -m app.scripts.seed_demo_data

# Start FastAPI development server with auto-reload
uvicorn app.main:app --reload --port 8000

3. Run Frontend (React 19 + Vite) Locally

In a separate terminal window:

cd frontend

# Install node packages
npm install

# Start Vite development server
npm run dev

Open http://localhost:3000 in your browser. (Vite automatically proxies /api and /ws to http://localhost:8000).


๐Ÿ’ป Method 3: Full Manual Local Setup (Without Docker)

Prerequisites

  • Python 3.12+
  • Node.js 20+ & npm
  • PostgreSQL 16+ running locally
  • Redis 7+ running locally

1. Backend Setup

  1. Create a PostgreSQL database named elearning.
  2. Configure .env inside backend/ or root:
    DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/elearning
    DATABASE_URL_SYNC=postgresql+psycopg2://postgres:postgres@localhost:5432/elearning
    REDIS_URL=redis://localhost:6379/0
  3. Install dependencies and start server:
    cd backend
    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    python -m app.scripts.seed_demo_data
    uvicorn app.main:app --reload --port 8000

2. Frontend Setup

cd frontend
npm install
npm run dev

๐Ÿ”‘ Default Demo Credentials

All seed demo accounts share the uniform password: password

Role Name Email Password Access Level & Key Capabilities
Super Admin Administrator Sistem [email protected] password Master data (teachers, students, classes, subjects), announcements, school configuration, and 1-click account impersonation
Teacher Budi Santoso, S.Pd. [email protected] password Learning materials, homework assignment grading, CBT exam authoring, question bank editor, live WebSocket proctoring monitor, and exam cards print
Teacher Siti Aminah, M.Kom. [email protected] password Database teacher with pre-assigned classes & materials
Student Andi Pratama [email protected] password Mobile dashboard, CBT exam runner with anti-cheat detection, homework submissions, gradebook summary, and print exam hall ticket
Student Bella Safira [email protected] password Peer student account for multi-user CBT exam simulation

๐Ÿงช Running Automated Tests

To run the backend integration and unit tests:

# Inside the backend directory (with venv activated)
pytest -v

# Or run inside Docker container
docker compose exec backend pytest -v

๐Ÿ“„ License

This project is licensed under the MIT License.

About

E-Learning for online examination at Junior high school

www.mfarim.com/blog/elearning/blog/elearning-python-fastapi

Topics

elearning-platformpython-fast-api-framework

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.