Getting Started with Rhesis Backend
Set up and run the backend locally for development.
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
- Use
/docsto explore the API - See Architecture and Development workflow in this section for patterns and conventions