Skip to content

Learnathon-By-Geeky-Solutions/solace

Repository files navigation

🌱 Twiggle - Your Gardening Companion

Spring Boot Java PostgreSQL License

Vercel Deploy Render Status Documentation SonarQube

πŸ“‘ Table of Contents

🌟 Overview

Twiggle is a comprehensive gardening and plant management platform that helps users plan, maintain, and track their gardens while connecting with a community of fellow gardening enthusiasts. Built with Spring Boot, it provides a robust backend for managing gardens, plants, weather data, and community interactions.

Beautiful indoor garden with hanging plants and natural lighting

Transform your space into a thriving indoor garden with Twiggle's plant management features

Project Context

  • Purpose: Simplify garden management and plant care
  • Target Users: Home gardeners, plant enthusiasts, and gardening professionals
  • Key Value: All-in-one solution for garden planning and maintenance

πŸ‘₯ Team

Name GitHub
Tasriad Ahmed Tias @tasriad
MD. AS-AID RAHMAN @aar-rafi
Munim Thahmid @munimthahmid
Moonwar AL Wardiful (Mentor) @moonwarnishan

✨ Features

  • 🌿 Garden Planning

    • Create and manage multiple gardens
    • Visual garden layout designer
    • Plant placement and arrangement
    • Garden sharing and privacy settings
  • 🌱 Plant Management

    • Comprehensive plant database
    • Smart plant recommendations
    • Growth tracking and maintenance
    • Care instructions and tips
  • 🌀️ Weather Integration

    • Real-time weather monitoring
    • Garden-specific weather advice
    • Weather-based maintenance alerts
    • Forecast integration
  • πŸ”” Smart Reminders

    • Customizable maintenance schedules
    • Multi-channel notifications
    • Task completion tracking
    • Seasonal care reminders
  • πŸ‘₯ Community Features

    • Garden photo sharing
    • Expert advice system
    • Community discussions
    • Progress tracking

πŸ› οΈ Tech Stack

Backend

  • Framework: Spring Boot 3.4.4
  • Language: Java 21
  • API Style: RESTful
  • Authentication: JWT with OAuth 2.0

Databases

  • Primary: PostgreSQL 15
  • Document Store: MongoDB 6.0
  • Cache: Redis 7.0
  • ORM: Hibernate 6.0

Infrastructure

  • Containerization: Docker
  • Orchestration: Kubernetes
  • CI/CD: GitHub Actions
  • Cloud: AWS
  • CDN: CloudFront

External Services

  • Weather: OpenWeatherMap API
  • Plant Database: Trefle API
  • Storage: AWS S3
  • Email: SendGrid
  • Push Notifications: Firebase Cloud Messaging

πŸ“ Project Structure

twiggle/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   └── dev/solace/twiggle/
β”‚   β”‚   β”‚       β”œβ”€β”€ config/        # Configuration classes
β”‚   β”‚   β”‚       β”œβ”€β”€ controller/    # REST controllers
β”‚   β”‚   β”‚       β”œβ”€β”€ dto/          # Data Transfer Objects
β”‚   β”‚   β”‚       β”œβ”€β”€ exception/    # Custom exceptions
β”‚   β”‚   β”‚       β”œβ”€β”€ mapper/       # Object mappers
β”‚   β”‚   β”‚       β”œβ”€β”€ model/        # Entity models
β”‚   β”‚   β”‚       β”œβ”€β”€ repository/   # Data access layer
β”‚   β”‚   β”‚       β”œβ”€β”€ service/      # Business logic
β”‚   β”‚   β”‚       └── util/         # Utility classes
β”‚   β”‚   └── resources/
β”‚   β”‚       β”œβ”€β”€ application.yml   # Main configuration
β”‚   β”‚       └── db/              # Database migrations
β”‚   └── test/                    # Test classes
β”œβ”€β”€ docs/                        # Documentation
β”œβ”€β”€ bruno/                       # API collections
└── docker/                      # Docker configuration

πŸ”— Quick Links

πŸš€ Installation

Prerequisites

  • Java 21 or higher
  • Maven 3.8+
  • Docker and Docker Compose
  • PostgreSQL 15

πŸš€ Local Setup

  1. Clone the Repository

    git clone --branch develop-backend https://github.com/Learnathon-By-Geeky-Solutions/solace.git
    cd solace

    Note: If you want to clone the other branches, use the following command:

    git clone --branch <branch-name> https://github.com/Learnathon-By-Geeky-Solutions/solace.git
    cd solace
  2. Install Dependencies & Setup

    This project uses Maven as the build tool. To install the necessary dependencies, run:

    mvn clean install

    Note: Alternatively, you can use the shell script provided to clean and build the project:

     ./run.sh clean
  3. Configure Application Properties

    The application properties are stored in src/main/resources/application.properties. You can modify these properties as needed.

    For sensitive information (e.g., database credentials, API keys), use environment variables or a .env file. Create a .env file in the project root and add the required environment variables. A .env.example file is provided as a template.

    Example .env file:

    GRAFANA_USER=username
    GRAFANA_PASSWORD=password
    
    SONARQUBE_USER=username
    SONARQUBE_PASSWORD=password
    SONAR_TOKEN=token

    The application reads these environment variables during startup.

  4. Start Docker Services

    If you want to run the application using Docker, start the Docker services and application using the provided shell script:

    ./run.sh start

    This command starts the application, Prometheus, and Grafana services etc. Access the application at http://localhost:8080.

    To stop the services, run:

    ./run.sh stop
  5. Run the Application Locally

    Use the provided shell script to run the application:

    ./run.sh run

    Alternatively, you can start the application manually:

    mvn spring-boot:run
  6. Access the Application

    Once the application starts, access the backend at:

    http://localhost:8080
    

    For API documentation, access Swagger UI:

    http://localhost:8080/swagger-ui/index.html
    

Access the application

Backend API: http://localhost:8080

Swagger UI: http://localhost:8080/swagger-ui/index.html

βš™οΈ Configuration

Environment Variables

Variable Description Example
GRAFANA_USER Grafana admin username admin
GRAFANA_PASSWORD Grafana admin password securepassword
SONARQUBE_USER SonarQube login username admin
SONARQUBE_PASSWORD SonarQube login password sonarpass
SONAR_TOKEN SonarQube API token 123abc456xyz789token
SUPABASE_URL Supabase project URL https://xyzcompany.supabase.co
SUPABASE_USERNAME Supabase DB username postgres
SUPABASE_PASSWORD Supabase DB password supabasepass
SUPABASE_API_URL Supabase API base URL https://xyzcompany.supabase.co/rest/v1
SUPABASE_DB_URL Supabase JDBC DB URL jdbc:postgresql://xyz.supabase.co:5432/postgres
SUPABASE_ANON_KEY Supabase public anon key eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
SUPABASE_SERVICE_ROLE_KEY Supabase service role key service-role-key-goes-here
OPENAI_API_KEY OpenAI API key sk-abc123xyz456789...
UNSPLASH_ACCESS_KEY Unsplash API access key unsplash-access-key
RESEND_API_KEY Resend email API key re_abc123xyz456...
RESEND_FROM_EMAIL Default from email for Resend no-reply@example.com
WEATHER_API_KEY Weather API key weather-123-api-key
GOOGLE_CLIENT_ID Google OAuth client ID 12345-abc.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET Google OAuth client secret google-client-secret-here
JWT_SECRET JWT secret JWT-secret-here
JWT_EXPIRATION_MS JWT expiration time JWT-expiration-here

Configuration Files

  • application.yml: Main Spring Boot configuration
  • application-dev.yml: Development profile settings
  • application-prod.yml: Production profile settings
  • logback-spring.xml: Logging configuration

πŸ“š Documentation

πŸ“– Resources

Maven Dependencies

The project includes the following dependencies for backend development:

  • Spring Web: Build REST APIs
  • Spring Data MongoDB: MongoDB integration
  • Spring Boot DevTools: Developer tools
  • Spring Security: Authentication and authorization
  • JWT Support: JSON Web Token integration
  • Spring Boot Actuator: Monitoring and metrics
  • Spring Boot Starter Test: Testing framework
  • Spring Boot Starter Validation: Input validation
  • Springdoc OpenAPI: API documentation (Swagger UI)
  • Prometheus: Monitoring and alerting
  • Lombok: Boilerplate code reduction
  • Spring Boot Configuration Processor: Configuration metadata generation
  • Dotenv: Environment variable management
  • Mapstruct: Object mapping
  • Resilience4j: Resilience patterns (circuit breaker, rate limiter)
  • Spotless Plugin: Code formatting and linting
  • Jocco Plugin: Code documentation generation
  • Git Commit ID Plugin: Git commit ID generation
  • SonarQube Plugin: Code quality analysis

External Services

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add 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.


Made with ❀️ by Team Solace

About

Repository for team Solace

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •