Quickstart Guide

This guide will help you set up and run Zyeta on your local machine for development and testing purposes.

Prerequisites

Before you begin, make sure you have the following installed:

  • Python 3.9 or later
  • PostgreSQL 16 (recommended)
  • Docker (optional, for containerized setup)

Environment Setup

  1. Clone the repository
git clone https://github.com/zyeta-io/zyeta.backend.git
cd zyeta.backend
  1. Create a Python virtual environment
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Create your environment file by copying the example file
cp .env.local .env
  1. Configure the following environment variables in the .env file:
APP_NAME=zyeta-backend
DATABASE_URL=<DATABASE URL>
ENVIRONMENT=development
FRONTEND_URL=<FRONTEND URL>
JWT_SECRET=<JWT SECRET>
MASTER_API_KEY=<MASTER API KEY>
OPENAI_API_KEY=<OPENAI API KEY>
RESEND_API_KEY=<RESEND API KEY>

Database Setup

You can set up the database either locally or using Docker.

Local PostgreSQL Setup

  1. Install PostgreSQL by following the official installation guide
  2. Create a database for Zyeta
  3. Update the DATABASE_URL in your .env file:
DATABASE_URL=postgresql+asyncpg://<user>:<password>@<host>:5432/<db-name>

If your database password contains special characters like ’@’, remember to URL-encode them. For example, use ‘%40’ instead of ’@’.

  1. Ensure Docker is installed on your system
  2. Run the following command from the project root:
docker compose up

This will start PostgreSQL and pgAdmin containers as defined in the compose.yml file.

Application Setup

  1. Install dependencies using Poetry:
pip install poetry
poetry install
  1. Set up database migrations:
cp alembic.copy.ini alembic.ini
  1. Edit alembic.ini and set the sqlalchemy.url to match your database URL

  2. Apply database migrations:

alembic upgrade head
  1. Start the application:
# Using uvicorn
uvicorn src.app:app --reload

# OR using fastapi
fastapi dev src/app.py
  1. Open your browser and navigate to http://localhost:8000/docs to access the Swagger documentation

What’s Next?

Now that you have Zyeta up and running, check out:

This quickstart guide covers development setup only. For production deployment, additional steps are required.

Was this page helpful?