Installation
How to set up the Zyeta backend development environment
This guide will walk you through the process of setting up the Zyeta backend development environment on your local machine.
Prerequisites
Before you begin, ensure you have the following installed:
- Python 3.10+ - The core programming language
- Poetry - For dependency management
- PostgreSQL 14+ - The main database
- Redis - For caching and Celery task queue
- Git - For version control
- Docker (optional) - For containerized development
- Node.js 20.17 (optional) - For sandbox servers
- NVM (optional) - To manage Node.js versions
Clone the Repository
First, clone the repository from GitHub:
Setting Up Python Environment
We use Poetry for dependency management:
Alternatively, you can use a virtual environment:
Setting Up Pre-commit Hooks
We use pre-commit hooks to ensure code quality:
This will configure automatic linting and type checking before each commit.
Setting Up PostgreSQL
Option 1: Local PostgreSQL with Docker
The easiest way to set up PostgreSQL is using Docker:
Option 2: Using Supabase
If you don’t want to set up PostgreSQL locally, you can use Supabase as a managed PostgreSQL service:
- Create a Supabase account at supabase.com
- Create a new project
- Navigate to the Database settings in your Supabase dashboard
- Copy the connection string from the “Connection Pooling” section
When using the connection string, replace [YOUR-PASSWORD]
with your actual database password.
Connection String Types
Supabase offers different connection types for different use cases:
-
Direct Connection:
- Best for applications with persistent, long-lived connections
- Format:
postgresql://postgres:[YOUR-PASSWORD]@db.izufeytmzeanvqoyck...
- Each client gets a dedicated connection to Postgres
-
Transaction Pooler:
- Ideal for stateless applications like serverless functions
- Format:
postgresql://postgres.izufeytmzeanvqoyckvp:[YOUR-PASSWORD]@...
- Pre-warmed connection pool to Postgres
- IPv4 compatible
-
Session Pooler:
- Alternative to Direct Connection when connecting via an IPv4 network
- Format:
postgresql://postgres.izufeytmzeanvqoyckvp:[YOUR-PASSWORD]@...
- Only recommended if you have IPv4 compatibility issues
Configuration Files
The project requires configuration files. Template files are provided to help you get started:
Update the connection strings in both files to match your database setup.
Database Migrations
Set up the database schema using Alembic migrations:
Setting Up Sandbox Servers (Optional)
If you want to develop or test tools that run dynamic code:
Running the Application
Start the application in development mode:
Or with FastAPI CLI (if installed):
The API will be available at http://localhost:8000
.
Docker Deployment
For a containerized environment, you can use Docker:
Accessing the API Documentation
FastAPI automatically generates interactive API documentation:
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
Next Steps
After installation, you’ll need to set up your environment variables. See our Environment Setup guide to configure your application.
Troubleshooting
Development Tools
We recommend these tools for an optimal development experience:
- Cursor - AI-powered IDE recommended for development
- VSCode with Python and FastAPI extensions
- pgAdmin for PostgreSQL management
- Redis Desktop Manager for Redis inspection
- Insomnia or Postman for API testing
Was this page helpful?