GreenSuite is a comprehensive carbon footprint tracking and management application that helps companies and individuals monitor, analyze, and reduce their environmental impact through AI-powered insights and detailed reporting.
- Carbon Footprint Tracking: Monitor emissions from various activities
- AI-Powered Analysis: Get intelligent insights and recommendations
- Multi-Company Support: Manage multiple organizations and users
- Real-time Reporting: Generate detailed sustainability reports
- User Management: Role-based access control (Owner, Manager, Employee)
- Document Processing: AI-powered document ingestion and analysis
- Vector Search: Advanced semantic search capabilities
Before running GreenSuite, ensure you have the following installed:
- Java 21 or higher
- Maven 3.6 or higher
- Docker (optional, for containerized services)
Ollama provides local AI model serving. Install it for your platform:
brew install ollamacurl -fsSL https://ollama.com/install.sh | shwinget install Ollama.Ollamaollama --versionDownload the required AI models for chat and embeddings:
# Pull chat model for AI conversations
ollama pull gemma3:4b
# Pull embedding model for vector search
ollama pull nomic-embed-text:latestStart the Ollama service:
ollama serveThe server will run on http://localhost:11434 by default.
Redis is used for rate limiting and caching.
brew install redis
brew services start redissudo apt update
sudo apt install redis-server
sudo systemctl start redis-server
sudo systemctl enable redis-server# Using Chocolatey
choco install redis-64
# Or download from https://redis.io/downloadredis-cli ping
# Should return: PONGPostgreSQL is used for chat memory and session management.
macOS:
brew install postgresql
brew services start postgresqlLinux (Ubuntu/Debian):
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresqlWindows: Download from https://www.postgresql.org/download/windows/
-- Connect to PostgreSQL as superuser
sudo -u postgres psql
-- Create database
CREATE DATABASE chat_memory_greensuite;
-- Create user
CREATE USER postgres WITH PASSWORD 'admin';
-- Grant privileges
GRANT ALL PRIVILEGES ON DATABASE chat_memory_greensuite TO postgres;
-- Exit
\qMongoDB Atlas is used for the main application data and vector storage.
- Go to MongoDB Atlas
- Create a free account or sign in
- Create a new cluster (M0 Free tier is sufficient for development)
- In your Atlas dashboard, go to Network Access
- Click "Add IP Address"
- For development: Add
0.0.0.0/0(allows access from anywhere) - For production: Add specific IP addresses
- Go to Database Access
- Click "Add New Database User"
- Create a user with these credentials:
- Username:
root - Password:
admin(use a strong password in production) - Role:
Atlas admin(for development)
- Username:
- Click "Connect" on your cluster
- Choose "Connect your application"
- Copy the connection string
- Replace
<password>with your actual password
For public vector store access, create a separate user:
- Go to Database Access
- Create a new user:
- Username:
public_user - Password:
public_password - Role:
Read and write to any database
- Username:
Update src/main/resources/application.properties with your database credentials:
# PostgreSQL Configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/chat_memory_greensuite
spring.datasource.username=postgres
spring.datasource.password=admin
# MongoDB Atlas Configuration
spring.ai.vectorstore.mongodb.atlas.uri=mongodb+srv://root:your_password@your_cluster.reg096x.mongodb.net/?retryWrites=true&w=majority&appName=YourCluster
spring.ai.vectorstore.mongodb.atlas.database=green_suite_vectors
# Main Application Database
spring.data.mongodb.uri=mongodb://localhost:27017/mongoGreenSuite
spring.data.mongodb.database=mongoGreenSuitegit clone <your-repository-url>
cd GreenSuite_BackEnd-mainmvn clean installmvn spring-boot:runThe application will start on http://localhost:8080
For production deployment, use environment variables:
export VECTOR_STORE_URI="your_mongodb_atlas_uri"
export VECTOR_STORE_DB="green_suite_vectors"
export MAIN_MONGODB_URI="your_main_mongodb_uri"
export MAIN_MONGODB_DATABASE="mongoGreenSuite"
export POSTGRES_URL="your_postgres_url"
export POSTGRES_USERNAME="your_postgres_username"
export POSTGRES_PASSWORD="your_postgres_password"Update JWT settings in application.properties:
app.jwt.secret=your-secure-jwt-secret-key
app.jwt.expiration-ms=900000
app.jwt.refresh-expiration-ms=604800000Run the test suite:
mvn testOnce the application is running, access the API documentation:
- Swagger UI:
http://localhost:8080/swagger-ui.html - API Endpoints:
http://localhost:8080/api/
Development:
- Uses default passwords and local databases
- CORS enabled for localhost
- Detailed error messages
Production:
- Use strong, unique passwords
- Enable HTTPS
- Configure proper CORS origins
- Use environment variables for sensitive data
- Enable security headers
- OWNER: Full access to company data and settings
- MANAGER: Manage employees and view reports
- EMPLOYEE: Basic access to input data and view personal reports
# Build Docker image
docker build -t greensuite .
# Run container
docker run -p 8080:8080 greensuiteThe application can be deployed to:
- AWS: Using Elastic Beanstalk or ECS
- Google Cloud: Using App Engine or GKE
- Azure: Using App Service or AKS
- Heroku: Using the provided Procfile
- Health Endpoint:
http://localhost:8080/actuator/health - Metrics:
http://localhost:8080/actuator/metrics
Logs are written to logs/application.log with the following levels:
- INFO: General application logs
- DEBUG: Detailed debugging information
- ERROR: Error and exception logs
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
Keep your dependencies updated:
# Update Maven dependencies
mvn versions:use-latest-versions
# Update Ollama models
ollama pull gemma3:4b:latest
ollama pull nomic-embed-text:latestNote: This is a development setup. For production deployment, ensure all security best practices are followed, including using strong passwords, enabling HTTPS, and properly configuring network security.