Cultivate attention.
An open-source backend for Trease Focus
A free alternative to Forest App 🌲
🎨 Procedurally Generated Flora — Every plant is unique, grown from seeds
🎬 Real-time Video Generation — Watch your trees grow with animated videos
Every focus session grows something beautiful. (More to be added)
![]() 🌳 Tree |
![]() 🌸 Sakura |
![]() 🍁 Maple |
![]() 🌲 Cedar |
![]() 💜 Wisteria |
![]() 🌿 Weeping Willow |
![]() 🌻 Sunflower |
![]() 💐 Lavender |
![]() 🩷 Pink Balls Tree |
- Bun runtime installed
- FFmpeg (for video generation)
# Clone the repository
git clone https://github.com/trease-focus/trease-backend.git
cd trease-backend
# Install dependencies
bun install
# Start the server
bun run src/server.ts
🌱 Server listening on http://localhost:3000
GET /image?type={plant}&seed={seed}| Parameter | Type | Description |
|---|---|---|
type |
string |
Plant type (see available types below) |
seed |
int |
Optional. Unique seed for reproducibility(16 chars) |
### Generate Video
GET /video?type={plant}&seed={seed}GET /video?type={plant}&seed={seed}Watch your plant grow in real-time! Returns a streaming WebM video.
GET /treeInfo?seed={seed}Returns positioning data for the tree trunk.
| Type | Description |
|---|---|
tree |
Classic deciduous tree |
sakura |
Japanese cherry blossom |
maple |
Autumn maple tree |
cedar |
Evergreen cedar |
wisteria |
Purple cascading wisteria |
weeping_willow |
Graceful weeping willow |
sunflower |
Bright yellow sunflower |
lavender |
Fragrant lavender bush |
pink_balls_tree |
Whimsical pink spheres tree |
curl "http://localhost:3000/image?type=sakura" -o sakura.pngcurl "http://localhost:3000/video?type=maple" -o maple.webm- Runtime: Bun — Fast JavaScript runtime
- Framework: BaoJS — Lightweight web framework
- Canvas: @napi-rs/canvas — High-performance canvas rendering
- Video: FFmpeg — Video encoding and streaming
Contributions are what make the open-source community amazing! Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingPlant) - Commit your Changes (
git commit -m 'Add some AmazingPlant') - Push to the Branch (
git push origin feature/AmazingPlant) - Open a Pull Request
- Add new plant species (open an issue with an image to your art if you dont know how to code but would like to contribute)
- Improve animation smoothness
- Add seasonal variations
- Create frontend client
- Add weather effects (rain, snow, wind)
Distributed under the GNU GENERAL PUBLIC LICENSE Version 3. See LICENSE for more information.
Built with 💚 for focused minds everywhere
Stay focused. Grow forests. Change the world. 🌍











