A beautiful, modern web application to explore the biodiversity of domestic gardens in Japan. Features a comprehensive database of 218+ species including flora, fauna, objects, and garden styles.
- Docker and Docker Compose.
For local development with automatic code reloading:
-
Clone the repository:
git clone https://github.com/rubensbraz/domestic_garden_database cd domestic_garden_database -
Start the development environment:
docker compose -f docker-compose.dev.yml up
-
Import Data & Map Images:
docker compose -f docker-compose.dev.yml run --rm web python scripts/import_data.py
-
Access the App:
- Web Interface: http://localhost:8015
- API Docs: http://localhost:8015/docs
Development Features:
- Hot-reload enabled (changes reflect instantly)
- DEBUG mode active
- Code volumes mounted (no rebuild needed)
- Port 8015
For production deployment behind Nginx:
-
Build and start:
docker compose up -d --build
-
Import Data:
docker compose run --rm web python scripts/import_data.py
-
Configure Nginx to proxy to
http://127.0.0.1:8000
Production Features:
- Optimized build (code frozen in image)
- DEBUG mode disabled
- Port restricted to localhost (127.0.0.1:8000)
- Auto-restart on failure
The application is configured via the .env file. You can adjust the following settings:
- APP_PORT: The port the application runs on (default:
8015). - DEBUG: Set to
Truefor development,Falsefor production. - Database:
POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB.
domestic_garden_database/
├── app/
│ ├── main.py # FastAPI application
│ ├── models.py # Database models
│ ├── routers/ # API and Page routes
│ └── static/ # CSS, JS, and Assets
├── scripts/
│ ├── import_data.py # Data import & Image mapping
│ ├── convert_images.py # WebP conversion utility
│ └── update_db_images.py # Database image path updater
├── data/ # Excel source file
├── images/ # Source images (Flora, Fauna, etc.)
├── docker-compose.yml # Production configuration
├── docker-compose.dev.yml # Development configuration (hot-reload)
└── requirements.txt
To optimize new images, run the conversion script:
# Development
docker compose -f docker-compose.dev.yml run --rm web python scripts/convert_images.py
# Production
docker compose run --rm web python scripts/convert_images.pyIf you add or rename images, update the database references:
# Development
docker compose -f docker-compose.dev.yml run --rm web python scripts/update_db_images.py
# Production
docker compose run --rm web python scripts/update_db_images.py- Backend: FastAPI, SQLAlchemy, PostgreSQL
- Frontend: HTML5, CSS3, Vanilla JS
- Infrastructure: Docker, Docker Compose