Skip to content

Latest commit

 

History

History
90 lines (62 loc) · 2.03 KB

File metadata and controls

90 lines (62 loc) · 2.03 KB

Learny

Learny Screenshot

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 application
  • apps/api – FastAPI service wrapping the Hugging Face model

Prerequisites

  • Node.js (v18 or later) and npm
  • Python (3.10+ recommended)
  • a Hugging Face API token for the model

Installing dependencies

From the repository root run:

npm install

and then install the Python dependencies for the API:

pip install -r apps/api/requirements.txt

Create a .env file at the repository root (or inside apps/api) with your Hugging Face token:

HUGGINGFACE_API_TOKEN=YOUR_TOKEN_HERE

Running the project

The easiest way to start both applications is:

npm start

This 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 dev

API usage

The 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.

Testing

The web application contains a Jest setup. Run its tests from within the apps/web directory:

npm test

Contributing

  1. Fork the repository and create a new branch for your changes.
  2. Install dependencies and make sure npm start works.
  3. Update or add tests when relevant and run them before opening a pull request.
  4. Open a PR describing your changes.

Feel free to file issues or suggestions if you encounter problems or have ideas for improvements.