Prerequisites
Before you begin, ensure you have the following installed:Python 3.10+
Required for running the Flask application
PostgreSQL
Database for storing beekeeping data
Quick Setup
Run the Initialization Script
Use the provided initialization script to set up your environment:This script will:
- Create a Python virtual environment
- Install all base dependencies
- Optionally install development dependencies
- Set up the project structure
When prompted, type
s or y to install development dependencies for a better development experience.Configure Environment Variables
Copy the example environment file and configure your settings:Update the
.env file with your configuration:.env
Initialize the Database
Create the database and run migrations:
Make sure PostgreSQL is running and the database specified in
DATABASE_URL exists.Make Your First API Call
Now that your server is running, let’s test it with a real API call.Register a New User
Create a new user account using the registration endpoint:Password must contain at least 8 characters with:
- One uppercase letter
- One lowercase letter
- One number
- One special character
Login to Get Access Token
Authenticate and receive JWT tokens:Verify API Health
Check that the authentication feature is running correctly:Next Steps
API Reference
Explore all available endpoints and their parameters
Architecture
Learn about the Clean Architecture and DDD patterns used
Authentication
Deep dive into JWT authentication and security
Error Handling
Understand error codes and how to handle them
Troubleshooting
Database connection errors
Database connection errors
Make sure PostgreSQL is running and the
DATABASE_URL in your .env file is correct.Test your database connection:Virtual environment issues
Virtual environment issues
If you’re having trouble with the virtual environment:Linux/Mac:Windows:
Migration errors
Migration errors
If you encounter migration errors, try:
Port already in use
Port already in use
If port 5000 is already in use, specify a different port:Or update
FLASK_RUN_PORT in your .flaskenv file.