Skip to content

Latest commit

 

History

History
291 lines (215 loc) · 9.13 KB

File metadata and controls

291 lines (215 loc) · 9.13 KB

Cheat Sheet Generator

Cheat Sheet Generator web icon

A full-stack React and Django application for generating LaTeX-based cheat sheets with live preview, saved projects, and PDF export.

CI Project page status Top language Language count Repository size Last commit Node 24 Python 3.14 React 18 Vite 6 Django 6 Django REST Framework Docker Compose

FeaturesArchitectureGetting StartedDeploymentsAPI EndpointsContributing

Cheat Sheet Generator interface preview

Overview

Cheat Sheet Generator helps students and instructors build math reference sheets from structured formula libraries. Users can select topics, generate starter LaTeX, refine layout settings, preview compiled output, and export the final result as source or PDF.

The repository includes:

  • a React frontend for the interactive editor and preview workflow
  • a Django REST API for formula generation, persistence, and PDF compilation
  • a public GitHub Pages site for lightweight project browsing

Features

Core workflow

  • Multi-class selection across subjects from pre-algebra through calculus
  • Category-based formula picking without multi-select keyboard shortcuts
  • Drag-and-drop ordering for formulas and grouped sections
  • Generated LaTeX editing in the browser
  • Live PDF preview alongside the editor
  • PDF compilation through the backend using Tectonic
  • Download support for both .tex and compiled .pdf
  • Local autosave to preserve in-progress work

Layout and formatting

  • One, two, or three column layouts
  • Adjustable margins, font sizing, and spacing
  • Layout-aware recompile flow after formatting changes

Persistence

  • Saved cheat sheet projects
  • Reusable templates
  • Practice problem storage

Project page

A public project page is available at https://chicostate.github.io/cheat-sheet/ for lightweight browsing and onboarding.

The hosted project page does not run the full application by itself. The full experience still depends on the Django API.

Tech stack

Layer Technology
Frontend React 18, Vite 6, react-pdf, dnd-kit
Backend Django 6, Django REST Framework
PDF pipeline Tectonic
Database SQLite in development, PostgreSQL in Docker
Container tooling Docker Compose
CI GitHub Actions

Architecture

Frontend (React + Vite)
  ├─ Formula selection UI
  ├─ Layout controls
  ├─ LaTeX editor
  └─ PDF preview
         │
         ▼
Backend (Django + DRF)
  ├─ Formula data and generation
  ├─ Template / cheat sheet APIs
  ├─ Practice problem APIs
  └─ PDF compilation endpoint

Project structure

├── backend/                      # Django REST API
│   ├── api/                      # Models, serializers, views, tests, formula data
│   ├── cheat_sheet/              # Django settings
│   ├── manage.py
│   └── requirements.txt
├── frontend/                     # React + Vite app
│   ├── public/
│   ├── src/
│   ├── Dockerfile
│   ├── package.json
│   └── package-lock.json
├── .github/workflows/            # CI workflows
├── docker-compose.yml
└── README.md

Getting started

Prerequisites

  • Python 3.14
  • Node.js 24+
  • Tectonic
  • Docker Desktop or compatible Docker engine for containerized development

Backend setup

cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Backend health check:

http://localhost:8000/api/health/

Frontend setup

cd frontend
nvm use || true
npm install
npm run dev

Frontend app:

http://localhost:5173/

Full stack with Docker

docker compose up --build

Deployments

GitHub Pages

  • Public project page: https://chicostate.github.io/cheat-sheet/
  • Intended use: UI demonstration of the frontend without backend dependencies

Application runtime

The full application is intended to run locally or through container infrastructure because PDF generation and persistence require the backend API.

API endpoints

Authentication and health

Method Endpoint Description
GET /api/health/ Service health check
POST /api/register/ Register a user
POST /api/token/ Obtain JWT access and refresh tokens
POST /api/token/refresh/ Refresh a JWT access token

Formula generation

Method Endpoint Description
GET /api/classes/ List classes, categories, and formulas
POST /api/generate-sheet/ Generate LaTeX from selected content
POST /api/compile/ Compile LaTeX into PDF

Resource management

Method Endpoint Description
GET / POST /api/templates/ List or create templates
GET / PUT / PATCH / DELETE /api/templates/{id}/ Retrieve or modify a template
GET / POST /api/cheatsheets/ List or create cheat sheets
GET / PUT / PATCH / DELETE /api/cheatsheets/{id}/ Retrieve or modify a cheat sheet
GET / POST /api/problems/ List or create practice problems
GET / PUT / PATCH / DELETE /api/problems/{id}/ Retrieve or modify a practice problem

Available formula classes

  • PRE-ALGEBRA: order of operations, fractions, ratios, properties, area and perimeter, solving equations
  • ALGEBRA I: linear equations, inequalities, quadratics, polynomials, exponents, radicals, functions, and more
  • ALGEBRA II: complex numbers, logarithms, exponentials, conics, sequences, matrices, binomial theorem
  • GEOMETRY: angles, parallel lines, triangles, circles, polygons, coordinate geometry, transformations
  • TRIGONOMETRY: right-triangle relationships, special angles, identities, laws of sines and cosines
  • PRECALCULUS: functions, conics, exponentials, logarithms, polar and parametric topics, sequences
  • CALCULUS I: limits, derivatives, derivative applications, integrals
  • CALCULUS II: integration techniques, applications, sequences and series
  • CALCULUS III: vectors, multivariable derivatives, multiple integrals, vector calculus
  • UNIT CIRCLE: radians, degrees, and coordinate reference data

Running checks

Backend

cd backend
ruff check .
safety check
pytest -v

Frontend

cd frontend
npx eslint src/
npm run build

Docker

docker compose build

CI pipeline

GitHub Actions runs:

  • backend linting and tests
  • frontend dependency install and production build
  • Docker image build verification

The frontend and CI are configured around Node.js 24.

Development notes

Adding a new API endpoint

  1. Add the view in backend/api/views.py
  2. Add or update serializers in backend/api/serializers.py
  3. Register the route in backend/api/urls.py
  4. Add tests in backend/api/tests.py

Adding formula data

Update the appropriate module under backend/api/formula_data/.

Community

Contributing

Contributions are welcome through issues and pull requests. For setup, workflow, and review expectations, see CONTRIBUTING.md.

Security

If you find a vulnerability, follow the reporting guidance in SECURITY.md instead of opening a public issue.

License

No license file is currently included in this repository.