Installation Guide
This guide covers everything you need to install and configure VidaPlus API, from local development setup to production deployment with Docker.Prerequisites
Before installing VidaPlus API, ensure you have the following:- Python: Version 3.13 or higher (specifically tested with 3.13.2)
- Poetry: Version 2.1.2 for dependency management
- Database: PostgreSQL (recommended) or SQLite for development
- Docker (optional): For containerized deployment
Local Development Setup
Step 1: Install Python 3.13
VidaPlus API requires Python 3.13.2. We recommend usingpyenv for Python version management:
Step 2: Install Poetry
Poetry is the package manager used by VidaPlus API. Install version 2.1.2:If you don’t have
pipx installed, install it first:Step 3: Clone the Repository
Clone the VidaPlus API repository:Step 4: Install Dependencies
Install all project dependencies using Poetry:Install production dependencies
- FastAPI (web framework)
- SQLAlchemy (ORM with async support)
- Pydantic Settings (configuration management)
- Alembic (database migrations)
- PyJWT (JWT authentication)
- pwdlib with Argon2 (password hashing)
- Uvicorn (ASGI server)
Step 5: Configure Environment Variables
Create a.env file in the project root directory with the required configuration:
Generate a Secure Secret Key
Generate a cryptographically secure secret key:Step 6: Database Setup
Initialize the database with Alembic migrations:Step 7: Start the Development Server
Activate the Poetry virtual environment and start the server:- Main API: http://localhost:8000
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- OpenAPI JSON: http://localhost:8000/api/v1/openapi.json
The
--reload flag enables automatic reloading when code changes. This should only be used in development.Docker Installation
For production deployment or simplified setup, use Docker to containerize VidaPlus API.Step 1: Install Docker
Ensure Docker is installed on your system:Step 2: Build the Docker Image
Build the VidaPlus API Docker image:Dockerfile which:
- Uses Python 3.13-slim base image
- Installs Poetry
- Installs production dependencies (excludes dev dependencies)
- Exposes port 8000
- Runs the application with Uvicorn
Step 3: Run the Container
Step 4: Verify Container Status
Check that the container is running:Step 5: Access the API
The API is now available at http://localhost:8000 Test the connection:Docker Compose (Recommended for Production)
For a complete setup with PostgreSQL database, create adocker-compose.yml file:
docker-compose.yml
Available Task Commands
VidaPlus API uses Taskipy for common development tasks. Here are the available commands:Database Configuration
SQLite (Development)
For local development, SQLite is the easiest option:PostgreSQL (Production)
For production, use PostgreSQL with the async driver:The
asyncpg driver is required for async SQLAlchemy support in FastAPI.Running Migrations
When database schema changes, run migrations:Verification
After installation, verify everything is working:Troubleshooting
Poetry installation fails
Poetry installation fails
- Ensure
pipxis installed and in your PATH - Try installing Poetry with pip:
pip install poetry==2.1.2 - Check Python version:
python --version(must be 3.13+)
Database connection errors
Database connection errors
- Verify
DATABASE_URLformat in.envfile - For PostgreSQL, ensure the database server is running
- Check database credentials and permissions
- For Docker, use
host.docker.internalto connect to host machine
Port 8000 already in use
Port 8000 already in use
Find and stop the process using port 8000:Or use a different port:
Docker build fails
Docker build fails
- Clear Docker cache:
docker builder prune - Ensure Dockerfile is in project root
- Check Docker has sufficient disk space
- Try building with no cache:
docker build --no-cache -t vidaplus-api .
Module import errors
Module import errors
- Activate Poetry shell:
poetry shell - Reinstall dependencies:
poetry install - Check you’re in the project root directory
- Verify PYTHONPATH includes the project directory
Production Deployment Considerations
When deploying to production:Recommended Production Stack
- Application: VidaPlus API in Docker container
- Database: PostgreSQL with replication
- Reverse Proxy: Nginx or Traefik
- Process Manager: Docker Compose or Kubernetes
- Monitoring: Prometheus + Grafana
- Logging: ELK Stack or Cloud provider logs
Next Steps
Quickstart Guide
Learn how to make your first API request
API Reference
Explore all available endpoints
Authentication
Set up JWT authentication
Core Concepts
Learn about authentication and database models