8000 GitHub - MCCMDave/lernkarten-api: FastAPI Lernkarten-API mit Leitner-System
[go: up one dir, main page]

Skip to content

MCCMDave/lernkarten-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lernkarten-App (Leitner-System)

Team 4.5 - Behlau & Vaupel | FastAPI Backend + Quiz Frontend


Was ist das?

REST-API für eine Lernkarten-App mit dem Leitner-System (Spaced Repetition).

Leitner-System

Karten in 3 Fächern:

  • Fach 1: Neue/schwierige Karten (täglich)
  • Fach 2: Fortgeschritten (alle 3 Tage)
  • Fach 3: Gemeistert (wöchentlich)

Workflow: Frage sehen -> Antwort aufdecken -> "Gewusst" oder "Nicht gewusst"


Quick Start

# Ins Backend wechseln
cd backend

# Dependencies installieren
pip install -r requirements.txt

# API starten
uvicorn main:app --host 0.0.0.0 --port 8000

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

API Endpoints

Karten

Method Endpoint Beschreibung
GET /cards Alle Karten
GET /cards?box=1 Filter nach Fach
GET /cards/due Fällige Karten
GET /cards/{id} Eine Karte
POST /cards Neue Karte
PUT /cards/{id} Karte ändern
DELETE /cards/{id} Karte löschen

Lernen

POST /cards/{id}/answer
{ "knew_it": true }
// -> Karte wandert ins nächste Fach

Datenbank-Schema

CREATE TABLE cards (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    question TEXT NOT NULL,
    answer TEXT NOT NULL,
    box INTEGER DEFAULT 1,
    next_review TEXT
)
Spalte Typ Beschreibung
id INTEGER Primärschlüssel
question TEXT Die Frage
answer TEXT Die Antwort
box INTEGER Leitner-Box (1-3)
next_review TEXT Nächstes Review-Datum (ISO)

Projektstruktur

team4.5-behlau-vaupel/
├── backend/
│   ├── main.py           # FastAPI App
│   ├── database.py       # SQLite CRUD
│   ├── models.py         # Pydantic Schemas
│   └── requirements.txt
├── frontend/
│   └── index.html        # Quiz UI
├── docs/
│   ├── CODE-ERKLAERUNG.md
│   ├── EC2-BACKEND.md
│   └── WORKFLOW-GUIDE.md
└── tools/
    ├── ec2/              # SSH Scripts
    └── hooks/            # Git Hooks

Team

Rolle Person
Maintainer @MCCMDave (David)
Developer @lukasbe86 (Lukas)

Tools

EC2 Connect (tools/ec2/)

PowerShell-Script für einfache AWS EC2 Verbindungen:

  • Multi-Instance Menü
  • Automatischer Instance-Start
  • SSH-Alias Unterstützung
.\tools\ec2\connect-ec2.ps1    # Interaktives Menü

Git Hooks (tools/hooks/)

Automatische GitHub Issue-Erstellung aus lokalen Dateien:

  • ideen.txt → Issues mit Label "idea"
  • stories.txt → User Stories
# Setup (einmalig)
.\setup-hooks.bat              # Windows
bash tools/hooks/setup-hooks.sh # Linux/Mac

Dokumentation

About

FastAPI Lernkarten-API mit Leitner-System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0