Learny is a small demo monorepo showing how to combine a React frontend with a FastAPI backend to generate personalised study programmes. The backend connects to a Hugging Face model that returns a curriculum based on a short questionnaire.
This repository uses Turborepo for managing multiple applications. Currently there are two apps:
apps/web– React + Tailwind client applicationapps/api– FastAPI service wrapping the Hugging Face model
- Node.js (v18 or later) and npm
- Python (3.10+ recommended)
- a Hugging Face API token for the model
From the repository root run:
npm installand then install the Python dependencies for the API:
pip install -r apps/api/requirements.txtCreate a .env file at the repository root (or inside apps/api) with
your Hugging Face token:
HUGGINGFACE_API_TOKEN=YOUR_TOKEN_HEREThe easiest way to start both applications is:
npm startThis uses turbo run dev which launches the FastAPI server on port
8000 and the React development server on port 3000.
You can also run each application separately:
# Start the API only
cd apps/api
npm run dev
# Start the web app only
cd ../web
npm run devThe FastAPI server exposes a POST /generate-course endpoint that returns a
course plan as JSON. Each module object now includes an additional
explanation field with a short description of the module.
The web application contains a Jest setup. Run its tests from within the
apps/web directory:
npm test- Fork the repository and create a new branch for your changes.
- Install dependencies and make sure
npm startworks. - Update or add tests when relevant and run them before opening a pull request.
- Open a PR describing your changes.
Feel free to file issues or suggestions if you encounter problems or have ideas for improvements.
