A modern, production-ready flashcard application with a clean UI and light theme. Built with React and FastAPI.
docker compose up -d
This will start PostgreSQL with persistent storage using a named volume.
cd backend
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start backend server
uvicorn app.main:app --reload --port 8000
The backend API will be available at http://localhost:8000
Open a new terminal:
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
The frontend will be available at http://localhost:5173
Landing Page (/)
Dashboard (/dashboard)
All Decks (/decks)
Deck Page (/decks/:id)
Review Page (/decks/:id/review)
All pages (except Landing) include:
GET /api/v1/decks - List all decksPOST /api/v1/decks - Create a new deckGET /api/v1/decks/{deck_id} - Get deck details with cardsPUT /api/v1/decks/{deck_id} - Update deckDELETE /api/v1/decks/{deck_id} - Delete deckPOST /api/v1/decks/{deck_id}/cards - Create a card in a deckGET /api/v1/cards/{card_id} - Get card detailsPUT /api/v1/cards/{card_id} - Update cardDELETE /api/v1/cards/{card_id} - Delete cardPostgreSQL runs in Docker with a persistent named volume (flashdecks-data). Data persists across container restarts.
# Stop the database
docker compose down
# Stop and remove data (reset database)
docker compose down -v
# View logs
docker compose logs postgres
# Check database status
docker compose ps
The backend uses:
The frontend uses:
cd frontend
npm run build
The production build will be in frontend/dist/.
The backend can be deployed using:
minimal-flashcards/
├── backend/
│ ├── app/
│ │ ├── api/
│ │ │ ├── routes/
│ │ │ │ └── decks.py
│ │ │ └── api_v1.py
│ │ ├── core/
│ │ │ └── config.py
│ │ ├── db/
│ │ │ └── session.py
│ │ ├── models/
│ │ │ ├── deck.py
│ │ │ └── card.py
│ │ ├── schemas/
│ │ │ └── deck.py
│ │ └── main.py
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Header.jsx
│ │ │ ├── Sidebar.jsx
│ │ │ └── Layout.jsx
│ │ ├── pages/
│ │ │ ├── LandingPage.jsx
│ │ │ ├── DashboardPage.jsx
│ │ │ ├── AllDecksPage.jsx
│ │ │ ├── DeckPage.jsx
│ │ │ └── ReviewPage.jsx
│ │ ├── lib/
│ │ │ └── api.js
│ │ ├── styles/
│ │ │ └── index.css
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── index.html
│ ├── package.json
│ └── vite.config.js
└── docker-compose.yml
The review page implements a 3D flip animation using CSS transforms:
The dashboard includes a GitHub-style activity heatmap:
All create and edit operations use modal forms:
If the backend can't connect to PostgreSQL:
# Check if PostgreSQL is running
docker compose ps
# View PostgreSQL logs
docker compose logs postgres
# Restart PostgreSQL
docker compose restart postgres
If port 5432, 8000, or 5173 is already in use:
docker-compose.ymlvite.config.jsIf you encounter CORS errors, ensure the backend CORS configuration in app/main.py includes your frontend URL.
MIT