A full-stack web application for generating LaTeX-based cheat sheets. Users select math classes and formula categories, then view the generated LaTeX code alongside a live PDF preview.
- Multi-Class Selection: Choose from 10 different subjects including PRE-ALGEBRA, ALGEBRA I & II, GEOMETRY, TRIGONOMETRY, PRECALCULUS, CALCULUS I-III, and UNIT CIRCLE.
- Category Selection: Select categories with checkboxes for each class (no Ctrl/Cmd needed)
- Drag-and-Drop Reordering: Intuitively organize your cheat sheet by dragging individual formulas or entire collapsible class groups to reorder them before generating.
- Formula Generation: Automatically generates formatted LaTeX for selected formulas
- Live Preview: Split-pane interface with line-numbered LaTeX editor (45% width) and PDF preview (45% width)
- PDF Compilation: Compile to PDF using Tectonic LaTeX engine on the backend
- Download Options: Download as
.texsource or.pdf - Auto-Save: Progress automatically saved to browser localStorage - survives page refresh
- Version History: Navigate through the last 7 saved versions with back/forward buttons
- Layout Auto-Recompile: Recompile the current sheet automatically after layout changes such as columns, spacing, margins, or font size
- Column Layout: Single, two, or three column layouts with auto-scaling formulas that fit within column boundaries
- Margins: Adjustable page margins
- Font Size: Configurable font scaling (8pt - 12pt)
- Spacing: Adjustable spacing between formula sections
- Templates: Save and manage reusable LaTeX templates
- Cheat Sheets: Save and load your cheat sheet projects
- Practice Problems: Add practice problems to your sheets
| Layer | Technology |
|---|---|
| Frontend | React 18 + Vite |
| Backend | Django 6 + Django REST Framework |
| LaTeX Engine | Tectonic |
| Database | SQLite (dev) / PostgreSQL (Docker/prod) |
| Container | Docker Compose |
├── backend/ # Django REST API
│ ├── cheat_sheet/ # Django project settings
│ ├── api/ # Main API app
│ │ ├── views.py # API endpoints
│ │ ├── models.py # Database models
│ │ ├── latex_utils.py # LaTeX generation utilities
│ │ ├── urls.py # URL routing
│ │ ├── serializers.py # DRF serializers
│ │ ├── tests.py # Test suite
│ │ └── formula_data/ # Formula definitions
│ │ ├── pre_algebra.py
│ │ ├── algebra_i.py
│ │ ├── algebra_ii.py
│ │ └── geometry.py
│ └── requirements.txt
├── frontend/ # React + Vite
│ ├── src/
│ │ ├── App.jsx # Main app
│ │ ├── components/
│ │ │ └── CreateCheatSheet.jsx
│ │ ├── hooks/
│ │ │ ├── formulas.js # Formula selection logic
│ │ │ └── latex.js # LaTeX generation & compilation
│ │ └── App.css
│ └── package.json
├── docker-compose.yml
├── docs/ # Static GitHub Pages project page
│ ├── app-preview.png
│ ├── index.html
│ └── styles.css
└── README.md
This repository includes a lightweight static project page in docs/ for GitHub Pages.
- Source:
docs/index.htmlanddocs/styles.css - Deployment:
.github/workflows/pages.yml - Purpose: project overview only
The hosted static page does not run the full app by itself. The full experience still requires the React frontend and Django backend running locally or in Docker.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/classes/ |
List available classes with categories and formulas |
| POST | /api/generate-sheet/ |
Generate LaTeX for selected formulas |
| POST | /api/compile/ |
Compile LaTeX to PDF |
| Method | Endpoint | Description |
|---|---|---|
| GET/POST | /api/templates/ |
List/create templates |
| GET/PUT/PATCH/DELETE | /api/templates/{id}/ |
Retrieve/update/delete template |
| GET/POST | /api/cheatsheets/ |
List/create cheat sheets |
| GET/PUT/PATCH/DELETE | /api/cheatsheets/{id}/ |
Retrieve/update/delete cheat sheet |
| GET/POST | /api/problems/ |
List/create practice problems |
| GET/PUT/PATCH/DELETE | /api/problems/{id}/ |
Retrieve/update/delete problem |
- PRE-ALGEBRA - Operations and Properties, Fractions, Ratios, and Proportions, Area and Perimeter, Solving Equations
- ALGEBRA I - Linear Equations, Inequalities, Integer Rules, Decimals and Percents, Mean, Median, Mode, Quadratic Equations, Polynomials, Exponents, Radicals, Functions, Absolute Value, Rational Expressions
- ALGEBRA II - Complex Numbers, Logarithms, Exponential Functions, Polynomial Theorems and Binomial Expansion, Conic Sections, Sequences and Series, Matrices
- GEOMETRY - Basic Angle Relationships, Parallel Lines and Transversals, Triangles, Pythagorean Theorem, Similar and Congruent Triangles, Quadrilaterals, Polygons, Circles, Circle Theorems, Coordinate Geometry, Surface Area and Volume, Transformations
- TRIGONOMETRY - Special Triangles and Basic Trig Relationships, Fundamental Identities, Angle Sum and Multiple-Angle Identities, Product and Power Identities, Inverse Trig Identities, Applications
- PRECALCULUS - Functions, Conic Sections, Sequences, Series, and Binomial Theorem, Polar & Complex Polar
- CALCULUS I - Limits, Derivative Definitions and Rules, Common Derivatives, Core Theorems of Calculus, Basic Antiderivatives
- CALCULUS II - Integration Techniques and Improper Integrals, Applications of Integration, Sequences & Series, Power & Taylor Series, Parametric & Polar
- CALCULUS III - Vector Formulas, Partial Derivatives and Optimization, Multiple Integrals
- UNIT CIRCLE - Complete visual representation of the unit circle with radians, degrees, and coordinates
- Python 3.13+
- Node.js 20+
- Tectonic (for PDF compilation)
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserverSet these backend environment variables in backend/.env before running the server:
DJANGO_SECRET_KEY=your-django-secret-key
JWT_SIGNING_KEY=your-separate-jwt-signing-keyUse long random values for both keys. JWT_SIGNING_KEY should be separate from DJANGO_SECRET_KEY so JWT signing does not depend on the Django app secret.
The API will be available at http://localhost:8000/api/.
cd frontend
npm install
npm run devThe frontend will be available at http://localhost:5173/.
If GitHub Pages is enabled for this repository, the static overview page is deployed from the docs/ directory through the Pages workflow.
For local preview, open docs/index.html directly in a browser.
docker compose up --buildThis builds and starts the Django backend, React frontend, and PostgreSQL database.
cd backend
pytest # Run all tests
pytest -v # Run with verbose output
pytest -k "test_name" # Run tests matching pattern
pytest api/tests.py # Run specific test filecd frontend
npx eslint src/ # Lint source files
npx eslint --fix src/ # Auto-fix lint issues
npm run build # Production build verificationThe project includes GitHub Actions CI that runs:
- Backend: Ruff linting, Safety security scan, pytest
- Frontend: ESLint, build verification
- Docker: Image build verification
- Enter Title: Give your cheat sheet a name
- Select Class: Click on a class (e.g., CALCULUS I, UNIT CIRCLE, ALGEBRA II)
- Select Categories: Check the categories you want
- Reorder: Drag and drop formulas or entire categories to set their final order
- Generate: Click "Generate Cheat Sheet" - LaTeX generates and PDF compiles automatically
- Preview: View the PDF in the preview pane, or click the circular button to recompile
- Customize: Edit the LaTeX directly or adjust formatting options
- Download: Download as
.texor.pdf - Save: Click "Save Progress" to store your cheat sheet to the database
- Add view function in
backend/api/views.py - Add serializer in
backend/api/serializers.pyif needed - Add URL route in
backend/api/urls.py - Write tests in
backend/api/tests.py
Add formulas to the appropriate file in backend/api/formula_data/:
pre_algebra.pyalgebra_i.pyalgebra_ii.pygeometry.pytrig.pyprecalculus.pycalculus_i.pycalculus_ii.pycalculus_iii.pyunit_circle.py
