Getting Started with Rhesis Backend
This guide will help you set up and run the Rhesis backend on your local machine for development purposes.
Prerequisites
Before you begin, make sure you have the following installed:
- Python 3.10 or higher
- PostgreSQL 13 or higher
- UV package installer
- Git
Clone the Repository
Environment Setup
- Navigate to the backend directory:
- Create a Python virtual environment:
- Activate the virtual environment:
On Linux/macOS:
On Windows:
- Install dependencies using UV:
Database Setup
- Create a PostgreSQL database:
- Create a
.envfile based on the provided template:
- Update the database connection string in
.env:
- Run database migrations:
Running the Application
- Start the FastAPI server:
The API will be available at http://localhost:8000
- Open the API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Running Background Tasks
- Start a Celery worker:
Development Workflow
Code Formatting
Format code using ruff:
Linting
Run the linter:
Fix linting issues automatically:
Running Tests
Run the test suite:
Authentication Setup
For local development, Quick Start mode provides automatic authentication bypass. For production-like setup, configure the authentication system:
Authentication Configuration
Update the authentication settings in your .env file:
API Endpoints
Once the application is running, you can explore the available endpoints through the Swagger UI at http://localhost:8000/docs .
Next Steps
Now that you have the backend running, you can:
- Create your first organization and user
- Explore the API endpoints
- Set up the frontend application to interact with the backend
- Start developing new features
For more detailed information about the backend architecture and components, refer to the other documentation files in this directory.