Skip to content

πŸ“ Math notes to formatted LaTeX converter

License

Notifications You must be signed in to change notification settings

quynhan-tr/notation

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

102 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Notation

A modern web application for converting PDFs and images into LaTeXβ€”the industry standard for mathematical and technical documents. Built with a Ruby on Rails backend and a React (Vite) frontend, powered by Google's Gemini API.

πŸš€ Features

  • PDF & Image Processing: Upload documents or images and extract content directly into LaTeX.
  • Mathematical Extraction: Intelligent recognition of complex mathematical expressions and equations.
  • Real-time Compilation: Compile LaTeX code into high-quality PDFs instantly using the integrated compilation service.
  • Modern UI: A sleek, responsive workspace designed for productivity and ease of use.
  • Micro-animations: Enhanced user experience with fluid transitions and interactive elements.

πŸ› οΈ Tech Stack

Backend

  • Ruby on Rails API: Robust and scalable backend architecture.
  • Gemini API: Leverages the latest Gemini 2.5 Flash model for high-fidelity content extraction.
  • Docker: Fully containerized environment for consistent deployment.

Frontend

  • React (Vite): Fast and modern frontend development.
  • TypeScript: Type-safe development for reliable code.
  • Framer Motion: Smooth, high-performance animations.
  • KaTeX: Blazing fast math rendering in the browser.

Infrastructure

  • Google Cloud Platform: Deployed on Cloud Run for serverless scaling.
  • CI/CD: Automated build and deployment with Google Cloud Build.

πŸ—οΈ Project Structure

.
β”œβ”€β”€ backend/           # Ruby on Rails API server
β”œβ”€β”€ frontend/          # React (Vite) web application
β”œβ”€β”€ cloudbuild.yaml    # Cloud Build configuration for GCP
└── docker-compose.yml # Local development configuration

🚦 Prerequisites

  • Node.js: v18 or higher
  • Ruby: 3.3.x or higher
  • Docker & Docker Compose: For containerized development
  • Gemini API Key: Required for content extraction

πŸ”§ Setup & Installation

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    bundle install
  3. Configure environment: Create a .env file and add your GEMINI_API_KEY.

  4. Start the Rails server:

    rails server

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

🐳 Docker Deployment

You can run the entire stack using Docker:

  1. Build and start services:
    docker-compose up --build

πŸš€ Cloud Deployment

The project is optimized for deployment on Google Cloud Run:

  1. Initialize GCP Project:

    gcloud config set project [YOUR_PROJECT_ID]
  2. Deploy via Cloud Build:

    gcloud builds submit

πŸ”’ Environment Variables

Backend (.env)

  • GEMINI_API_KEY: Your Google AI Studio API key.
  • RAILS_MASTER_KEY: Master key for encrypted credentials (production).
  • RAILS_ENV: Set to production or development.

Frontend

  • VITE_BACKEND_URL: URL of the running Rails API (injected during build in CI/CD).

πŸ“ API Documentation

POST /convert

Uploads a file (PDF or Image) and returns the extracted LaTeX content.

  • Parameters: file (Multipart Form)
  • Response: { "latex": "..." }

POST /compile

Compiles a LaTeX string into a PDF document.

  • Parameters: latex (String)
  • Response: PDF file binary (served as application/pdf)

πŸ“„ License

This project is licensed under the MIT License.

About

πŸ“ Math notes to formatted LaTeX converter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 38.3%
  • TypeScript 35.9%
  • CSS 22.9%
  • Dockerfile 1.6%
  • Other 1.3%