A Rust-based API for managing beehive data, including hives, queens, inspections, and user management.
# macOS
brew install just
# Linux
cargo install just
# Windows
cargo install just-
Clone the repository
git clone <repository-url> cd beekeeper-api
-
Start the Docker containers
docker-compose up -d # or just db-start # or if you want to run the api in a container as well docker-compose --profile production up -d
This starts the MySQL database container in the background.
-
Build the database schema
just db-reset
This creates all the necessary tables (users, queen, hives, inspections).
-
Seed with test data
just seed
This populates the database with fake data for testing.
-
Run the API
just run # or cargo runThe API will be available at
http://localhost:3000
If a team member changes the database structure in schema.sql:
-
Pull the latest changes
git pull
-
Reset your database to the new schema
just db-reset
This will drop all existing tables and recreate them with the new structure.
-
Reseed the database
just seed
This adds fresh test data to work with.
That's it! Your database is now up to date with the latest schema.
View all available commands:
just| Command | Description |
|---|---|
just run |
Start the API server |
just db-start |
Start the database container |
just db-reset |
Drop and recreate all database tables |
just seed |
Populate database with test data |
If port 3000 or 3306 is already in use, you can either:
- Stop the application using that port
- Change the port mapping in
docker-compose.yml
For a complete fresh start:
docker-compose down -v # Stop containers and remove volumes
docker-compose up -d # Start fresh containers
just db-reset # Create schema
just seed # Add test dataWhen making changes to the database schema:
- Update
schema.sqlwith your changes - Test locally with
just db-reset - Commit both code and schema changes
- Notify team members to reset the after pulling