Skip to content

mathisto/sprout-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌱 Sprout Server

Sprout Server

Rails Ruby PostgreSQL HTMX Hotwire TailwindCSS

Build Status License Last Commit

A modern, real-time plant monitoring system powered by ESP32 devices and Rails πŸͺ΄

Features β€’ Getting Started β€’ Development β€’ Deployment β€’ Contributing

✨ Features

  • 🌿 Real-time plant moisture monitoring
  • πŸ“Š Beautiful, interactive charts and visualizations
  • πŸ”” Instant notifications when plants need attention
  • πŸ“± Progressive Web App (PWA) support
  • πŸ€– ESP32 device integration
  • πŸ”„ HTMX-powered dynamic interactions
  • ⚑️ WebSocket live updates via Hotwire
  • 🎨 Modern, responsive UI with TailwindCSS
  • πŸ§ͺ Comprehensive test suite

πŸš€ Getting Started

Prerequisites

  • Ruby 3.3.0
  • PostgreSQL 14+
  • Node.js 18+
  • Yarn 1.x
  • Redis (optional, for ActionCable in production)

Quick Start

  1. Clone the repository:
git clone https://github.com/mathisto/sprout-server.git
cd sprout-server
  1. Install dependencies:
bundle install
yarn install
  1. Set up your environment:
cp .env.example .env
# Edit .env with your configuration
  1. Set up the database:
rails db:create db:migrate db:seed
  1. Start the development server:
bin/dev

Visit http://localhost:3000 and start monitoring your plants! 🌱

πŸ’» Development

Running Tests

bundle exec rspec                 # Run all tests
bundle exec rspec spec/models     # Run specific test directory
bundle exec rspec spec/models/plant_spec.rb  # Run specific test file

Code Quality

bundle exec rubocop              # Ruby style guide
bundle exec brakeman            # Security vulnerabilities
bundle exec bundle audit        # Gem vulnerabilities

Architecture

%%{
  init: {
    'theme': 'base',
    'themeVariables': {
      'primaryColor': '#1a1b26',
      'primaryTextColor': '#a9b1d6',
      'primaryBorderColor': '#7aa2f7',
      'lineColor': '#7aa2f7',
      'secondaryColor': '#24283b',
      'tertiaryColor': '#414868'
    }
  }
}%%
graph TD
    A[ESP32 Device]:::iot -->|HTTP POST| B[Rails API]:::server
    B -->|ActionCable| C[Browser Client]:::client
    B -->|Store| D[(PostgreSQL)]:::db
    
    C -->|HTMX Requests| B
    B -->|HTML Fragments| C
    
    C -->|Turbo Streams| E[Dashboard]:::ui
    C -->|Service Worker| F[PWA Notifications]:::worker

    classDef default fill:#1a1b26,stroke:#7aa2f7,color:#a9b1d6,stroke-width:2px
    classDef iot fill:#2ac3de,stroke:#7dcfff,color:#1a1b26,stroke-width:2px
    classDef server fill:#f7768e,stroke:#ff9e64,color:#1a1b26,stroke-width:2px
    classDef client fill:#9ece6a,stroke:#73daca,color:#1a1b26,stroke-width:2px
    classDef db fill:#bb9af7,stroke:#c0caf5,color:#1a1b26,stroke-width:2px
    classDef ui fill:#e0af68,stroke:#ff9e64,color:#1a1b26,stroke-width:2px
    classDef worker fill:#7aa2f7,stroke:#b4f9f8,color:#1a1b26,stroke-width:2px
Loading

πŸ“¦ Deployment

This application uses Kamal for deployment:

  1. Set up your deployment configuration:
cp config/deploy.yml.example config/deploy.yml
# Edit deploy.yml with your server configuration
  1. Deploy:
bin/kamal setup
bin/kamal deploy

🀝 Contributing

We love contributions! Please check out our Contributing Guide for guidelines.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -am 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


Made with πŸ’š by Matt Kelly

Theme inspired by Tokyo Night πŸŒƒ

About

A Rails application for managing ESP32-based plant monitoring and automation.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published