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 - thehimel/learning-platform-api: Learning platform API with FastAPI, PostgreSQL, and JWT auth. Courses, enrollments, ratings, and role-based access (student, instructor, admin).

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
alembic
alembic
 
 
app
app
 
 
bruno
bruno
 
 
docs
docs
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CLAUDE.md
CLAUDE.md
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
alembic.ini
alembic.ini
 
 
conftest.py
conftest.py
 
 
docker-compose.yml
docker-compose.yml
 
 
pyproject.toml
pyproject.toml
 
 
setup.sh
setup.sh
 
 
uv.lock
uv.lock
 
 

Repository files navigation

Learning Platform API

Python FastAPI Pydantic SQLAlchemy Alembic PostgreSQL structlog secure CI uv Ruff Vercel

A learning platform API built with FastAPI. Supports courses, enrollments, ratings, and role-based access (student, instructor, admin).

Tech Stack

  • Framework: FastAPI
  • Database: PostgreSQL (async via asyncpg)
  • ORM: SQLAlchemy 2.0 (async)
  • Auth: fastapi-users (JWT)
  • Rate limiting: slowapi
  • Logging: structlog
  • Security headers: secure

Features

  • Auth: Register, login (JWT), password update
  • Users: GET/PATCH /me; admin CRUD for users
  • Courses: CRUD, list with pagination and filters (published, q for title search)
  • Enrollments: Enroll/unenroll in courses
  • Ratings: Rate courses (1-5); aggregate recomputed asynchronously
  • Visibility: Unauthenticated: published only; instructor: published + own unpublished; admin: all

Project Setup

uv sync

Copy .env.example to .env and set POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, JWT_SECRET_KEY, AUTH_RESET_PASSWORD_TOKEN_SECRET, and AUTH_VERIFICATION_TOKEN_SECRET. Generate secrets with openssl rand -hex 32.

cp .env.example .env

Run With Docker

Only PostgreSQL

Starts just the database, so the app runs on the host with uv run uvicorn app.main:app --reload.

docker compose up -d postgres

App and PostgreSQL Together

docker compose up

Stop the Containers

docker compose down

Database Migrations

alembic upgrade head

Run the App

uv run uvicorn app.main:app --reload

API: http://localhost:8000 Docs: http://localhost:8000/docs

API Overview

API endpoints overview

Run Tests

Tests use a separate database ({postgres_db}_test), created and migrated automatically.

pytest -v

# Parallel execution
pytest -n auto

Commands

Description Command
Install dependencies (from pyproject.toml) uv sync
Run API (dev) uv run uvicorn app.main:app --reload
Apply migrations alembic upgrade head
Create migration alembic revision --autogenerate -m "message"
Run tests pytest
Run tests in parallel (pytest-xdist) pytest -n auto
Run tests and drop test DB after pytest --drop-test-db
Lint ruff check .
Format ruff format .

See docs/commands.md for Docker, pre-commit, and more.

Documentation

  • Commands: Docker, Alembic, pytest, ruff
  • DB setup: Async SQLAlchemy and Alembic
  • Auth options: Why fastapi-users
  • Test types: Unit, integration, E2E
  • Test speed: pytest performance notes
  • Troubleshoot DB: Connection issues
  • Steps: Project build order

System Diagram

system-diagram.svg

Generated with Excalidraw

Component Map

component-map.png

Generated with GitDiagram

Wiki

Explore the detailed documentation for this project.

wiki.png

Generated with DeepWiki

About

Learning platform API with FastAPI, PostgreSQL, and JWT auth. Courses, enrollments, ratings, and role-based access (student, instructor, admin).

learningplatform-api.vercel.app

Topics

asynciofastapijwtlearning-platformpostgresqlpythonrest-apisqlalchemy

Resources

Readme
Activity

Stars

40 stars

Watchers

0 watching

Forks

4 forks
Report repository

Releases

Packages

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.