MCPcopy Index your code
hub / github.com/0010aor/FlashNotes

github.com/0010aor/FlashNotes @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
719 symbols 2,433 edges 185 files 62 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

FlashNotes Logo

FlashNotes

A simple flashcard app focused on quick card creation and distraction-free practice.

Live Demo URL Discord

Technology Stack and Features

  • Backend:
    • FastAPI for the Python backend API.
      • SQLModel for ORM-based SQL database interactions.
      • Pydantic for data validation and settings management.
      • PostgreSQL as the SQL database.
  • Frontend:
    • React with TypeScript, hooks, and Vite for a modern frontend stack.
      • Chakra UI for UI components.
      • Generated client for consuming the backend API.
    • Dexie.js and IndexedDB for offline/guest mode support and local data storage.
  • Authentication:
    • JWT (JSON Web Token) authentication.
  • Guest Mode & Offline Support:
    • Users can try the app instantly as a guest, with all data stored locally in the browser (IndexedDB).
    • Guest Mode users can create, edit, and practice flashcards, but data will not sync across devices.
  • Testing:

Explore the API documentation at http://127.0.0.1:8000/docs.

Running GitHub Actions Locally

To test your GitHub Actions workflows locally before pushing to GitHub, you can use nektos/act. This tool allows you to simulate GitHub Actions workflows using Docker.

Here is a simple guide for how to do this here.

Setup Instructions

Backend Setup

  1. Create a PostgreSQL database:
createdb <dbname>
  1. Set up environment variables in backend/.env:
PROJECT_NAME=FlashNotes
DOMAIN=localhost
POSTGRES_SERVER=localhost
POSTGRES_USER=<your-username>
POSTGRES_PASSWORD=<your-password>
POSTGRES_DB=<dbname>
FIRST_SUPERUSER=admin@example.com
FIRST_SUPERUSER_PASSWORD=<admin-password>
USERS_OPEN_REGISTRATION=true
  1. Navigate to the backend directory:
cd backend
  1. Make the prestart script executable:
chmod +x prestart.sh
  1. Choose one of the following setup options:

Option 1: Quick Setup with uv

# Install dependencies and run migrations
uv run ./prestart.sh # Run ./prestart.sh to run db migrations

# Start the development server
uv run uvicorn src.main:app --reload

Option 2: Traditional Virtual Environment Setup

# Create and activate virtual environment
uv venv .venv
source .venv/bin/activate

# Install dependencies
uv sync

# Run migrations
./prestart.sh

# Start the development server
uvicorn src.main:app --reload

The backend server will be available at http://127.0.0.1:8000

Frontend Setup

  1. Install dependencies and start the development server:
cd frontend
pnpm install
pnpm run dev

Generate Frontend API Client (Only if backend API is updated)

The frontend uses a generated TypeScript client to communicate with the backend API. To update the client after making changes to the backend:

  1. Activate the backend virtual environment:
cd backend
source .venv/bin/activate  # For Unix/Linux
# OR
.venv\Scripts\activate     # For Windows
  1. Run the client generation script from the project root:
./scripts/generate_client.sh

API Documentation

Once the backend is running, access the interactive API documentation at: - ReDoc: http://127.0.0.1:8000/redoc - Swagger UI: http://127.0.0.1:8000/docs

Contributing

We welcome contributions! Please see our Contributing Guidelines for details on how to get started, report bugs, suggest enhancements, and submit pull requests. Feel free to join our Discord for questions and discussions!

Extension points exported contracts — how you extend this code

CollectionRepository (Interface)
(no doc) [6 implementers]
frontend/src/repositories/collection/CollectionRepository.ts
CardRepository (Interface)
(no doc) [6 implementers]
frontend/src/repositories/card/CardRepository.ts
PracticeSessionRepository (Interface)
(no doc) [4 implementers]
frontend/src/repositories/practiceSession/PracticeSessionRepository.ts
StatsRepository (Interface)
(no doc) [4 implementers]
frontend/src/repositories/stats/StatsRepository.ts
FileRoutesByPath (Interface)
(no doc)
frontend/src/routeTree.gen.ts

Core symbols most depended-on inside this repo

t
called by 168
frontend/src/utils.ts
random_lower_string
called by 28
backend/tests/utils/utils.py
delete
called by 27
frontend/src/repositories/card/CardRepository.ts
update
called by 21
frontend/src/repositories/card/CardRepository.ts
random_email
called by 19
backend/tests/utils/utils.py
create_user
called by 16
backend/src/users/services.py
isGuest
called by 8
frontend/src/utils/authUtils.ts
create
called by 8
frontend/src/repositories/card/CardRepository.ts

Shape

Function 453
Method 86
Class 82
Interface 76
Route 22

Languages

TypeScript52%
Python48%

Modules by API surface

backend/src/flashcards/api.py30 symbols
frontend/src/client/sdk.gen.ts28 symbols
backend/src/flashcards/services.py26 symbols
backend/src/flashcards/schemas.py25 symbols
backend/tests/flashcards/practice_session/test_services.py22 symbols
frontend/src/client/core/request.ts20 symbols
backend/tests/flashcards/card/test_api.py19 symbols
backend/tests/flashcards/practice_session/test_api.py18 symbols
frontend/src/client/core/CancelablePromise.ts17 symbols
backend/tests/flashcards/collection/test_api.py17 symbols
backend/tests/users/test_services.py14 symbols
frontend/src/data/localDB/practiceSessions.ts13 symbols

For agents

$ claude mcp add FlashNotes \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact