Skip to content

anand-106/SynthTeX

Repository files navigation

SynthTeX

The Cursor for LaTeX!

Write LaTeX documents with AI assistance. Chat with your code, and compile to PDFβ€”all in one place.


πŸ“Ή Demo

SynthTeX Demo


✨ Features

  • πŸ€– AI-Powered Assistance - Chat with your LaTeX code using advanced AI agents
  • 🎨 Modern Editor - Monaco Editor with syntax highlighting and IntelliSense
  • πŸ“„ PDF Compilation - Compile your LaTeX documents to PDF in the cloud
  • πŸ”„ Live Sync - Real-time collaboration and synchronization
  • πŸ“ Project Management - Organize multiple LaTeX projects with ease
  • πŸ” Secure Authentication - Built-in user authentication and project isolation
  • ⚑ Fast & Responsive - Optimized for performance and speed

πŸ› οΈ Tech Stack

Frontend

Next.js React TypeScript Tailwind CSS Monaco Editor

Backend

FastAPI Python LangChain PostgreSQL SQLAlchemy

Infrastructure & Tools

Docker AWS S3 E2B Turbo pnpm Clerk


πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js >= 18
  • pnpm >= 10.28.0
  • Python >= 3.12
  • Docker (for local development)
  • PostgreSQL (or use Docker Compose)

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/SynthTeX.git
cd SynthTeX

2. Install Dependencies

# Install root dependencies
pnpm install

# Install frontend dependencies (handled by pnpm workspace)
# Install backend dependencies
cd apps/backend
uv sync

# Install compiler dependencies
cd ../compiler
uv sync

3. Environment Setup

Backend (.env)

cd apps/backend
cp .env.example .env
# Edit .env with your configuration

Compiler (.env)

cd apps/compiler
cp .env.example .env
# Edit .env with your configuration

4. Start Development Servers

Using Docker Compose (Recommended)

docker-compose -f infra/docker-compose.yml up

Manual Start

# Terminal 1: Frontend
pnpm dev

# Terminal 2: Backend
cd apps/backend
uvicorn main:app --reload

# Terminal 3: Compiler Worker
cd apps/compiler
python worker.py

5. Access the Application


πŸ“ Project Structure

SynthTeX/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ frontend/          # Next.js frontend application
β”‚   β”œβ”€β”€ backend/           # FastAPI backend service
β”‚   └── compiler/          # LaTeX compilation worker
β”œβ”€β”€ packages/              # Shared packages
β”‚   β”œβ”€β”€ ui/               # UI components
β”‚   β”œβ”€β”€ typescript-config/ # TypeScript configurations
β”‚   └── eslint-config/    # ESLint configurations
β”œβ”€β”€ infra/                # Infrastructure as code
└── assets/               # Static assets

πŸ—οΈ Architecture

SynthTeX follows a monorepo architecture with three main services:

  1. Frontend - Next.js application with real-time LaTeX editing and preview
  2. Backend - FastAPI service handling authentication, project management, and AI agent interactions
  3. Compiler - Background worker service that compiles LaTeX documents to PDF using sandboxed environments

πŸ”§ Development

Available Scripts

# Development
pnpm dev              # Start all services in development mode

# Building
pnpm build            # Build all packages and apps

# Code Quality
pnpm lint             # Lint all packages
pnpm format           # Format code with Prettier
pnpm check-types      # Type check all TypeScript projects

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Built with LangChain for AI agent capabilities
  • Powered by E2B for secure code execution
  • UI components inspired by modern design systems

Made with ❀️ by the SynthTeX team

⭐ Star us on GitHub β€’ πŸ› Report Bug β€’ πŸ’‘ Request Feature