garden plan web app
This commit is contained in:
125
README.md
Normal file
125
README.md
Normal file
@@ -0,0 +1,125 @@
|
||||
# Garden Planner Visualizer
|
||||
|
||||
A self-hosted web application written in Rust to visualize your garden plan timeline.
|
||||
|
||||
## Features
|
||||
|
||||
- Interactive timeline view showing planting and harvest periods for each bed
|
||||
- Table view with all planting events
|
||||
- Responsive design with hover tooltips
|
||||
- Color-coded phases (planting, growing, harvesting)
|
||||
- Reads directly from your CSV file
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Rust and Cargo (install from https://rustup.rs/)
|
||||
|
||||
## Setup
|
||||
|
||||
1. Make sure you're in the garden project directory:
|
||||
```bash
|
||||
cd /home/jonas/projects/garden
|
||||
```
|
||||
|
||||
2. Build the project:
|
||||
```bash
|
||||
cargo build --release
|
||||
```
|
||||
|
||||
3. Run the server:
|
||||
```bash
|
||||
cargo run --release
|
||||
```
|
||||
|
||||
4. Open your browser and navigate to:
|
||||
```
|
||||
http://127.0.0.1:3000
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
Just run:
|
||||
```bash
|
||||
cargo run
|
||||
```
|
||||
|
||||
The application will:
|
||||
- Parse `garden-plan-2025.csv`
|
||||
- Start a web server on port 3000
|
||||
- Serve an interactive visualization
|
||||
|
||||
## Views
|
||||
|
||||
### Timeline View
|
||||
- Shows each bed (South, Middle, North) as a separate section
|
||||
- Displays crops as colored bars across a 12-month timeline
|
||||
- Each crop type has its own color (tomatoes=red, beans=purple, etc.)
|
||||
- Crops with multiple phases (greenhouse + transplant) show multiple connected boxes:
|
||||
- Lighter shade: Greenhouse phase 🌱
|
||||
- Full color: Garden bed phase 🌿
|
||||
- Click any crop box to expand and see full growing details
|
||||
|
||||
### Table View
|
||||
- Complete list of all planting events
|
||||
- Sortable columns
|
||||
- Badges for bed locations and activity types
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
garden/
|
||||
├── Cargo.toml # Rust dependencies
|
||||
├── src/
|
||||
│ └── main.rs # Web server and CSV parsing (Rust)
|
||||
├── static/
|
||||
│ └── index.html # Visualization UI (HTML/CSS/JS)
|
||||
├── garden-plan-2025.csv # Your garden data
|
||||
└── bed-layout.md # Bed layout documentation
|
||||
```
|
||||
|
||||
## Updating Your Plan
|
||||
|
||||
1. Edit `garden-plan-2025.csv` with your changes
|
||||
2. Restart the server (Ctrl+C, then `cargo run`)
|
||||
3. Refresh your browser
|
||||
|
||||
## Customization
|
||||
|
||||
### Change Port
|
||||
|
||||
Edit `src/main.rs:107` to change from `127.0.0.1:3000` to your preferred address.
|
||||
|
||||
### Styling
|
||||
|
||||
Edit `static/index.html` to customize colors, fonts, and layout.
|
||||
|
||||
## Technical Details
|
||||
|
||||
- **Backend**: Axum web framework (Rust)
|
||||
- **CSV Parsing**: csv crate (Rust)
|
||||
- **Frontend**: Vanilla HTML/CSS/JavaScript
|
||||
- **API Endpoints**:
|
||||
- `GET /` - Main visualization page
|
||||
- `GET /api/events` - Raw CSV data as JSON
|
||||
- `GET /api/timeline` - Processed timeline data as JSON
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Port already in use:**
|
||||
```
|
||||
Error: Address already in use (os error 98)
|
||||
```
|
||||
Kill any process using port 3000 or change the port in `src/main.rs`.
|
||||
|
||||
**CSV not found:**
|
||||
Make sure you run the command from the `/home/jonas/projects/garden` directory where the CSV file is located.
|
||||
|
||||
**Build errors:**
|
||||
Update Rust to the latest version:
|
||||
```bash
|
||||
rustup update
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Personal use - do whatever you want with it.
|
||||
Reference in New Issue
Block a user