Prerequisites

  • Python 3.11+
  • Node.js 20+
  • Docker Desktop (recommended for the containerized approach)
  • uv package manager (preferred for Python dependencies)

Clone the Repository

git clone https://github.com/nhemerson/mako-code.git
cd mako-code

Setup Options

Mako Code offers three ways to set up your development environment:

This is the simplest approach that ensures consistency across environments:

# Build the image
docker-compose build

# Run the application
docker-compose up

2. Using Make (Mac only)

For Mac users, we provide Make commands to simplify setup:

# Setup both frontend and backend dependencies
make setup

# Run the application (both frontend and backend)
make run

# To run frontend and backend separately:
make frontend  # Runs frontend server
make backend   # Runs backend server

# To clean up dependencies and build artifacts
make clean

3. Manual Setup

For the backend:

cd backend
uv venv .venv  # Or: python3 -m venv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt  # Or: pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8001

For the frontend:

cd frontend
npm install
npm run dev

Project Structure

  • backend/: FastAPI backend with Python code
    • main.py: Entry point for the backend
    • functions/: Backend functionality
  • frontend/: SvelteKit frontend with TypeScript

API Documentation

The backend API documentation will be available at http://localhost:8001/api/docs when running locally.

Running Tests

If available, run tests with:

# For backend tests
cd backend
pytest

# For frontend tests
cd frontend
npm test

Building for Production

To build the frontend for production:

cd frontend
npm run build

Or using Make:

make build

Submitting Changes

Please refer to our Contribution Guidelines for information on how to submit your changes.