Skip to content

Latest commit

Β 

History

257 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌿 Harmoniq

Harmoniq is a full-stack web application built to foster a supportive, anonymous community for individuals navigating mental health challenges. It offers a safe, digital space where users can share their thoughts, connect through shared experiences, and support one another, all while preserving their privacy.

β€œWe believe in the power of human connections and community harmony. Harmoniq is designed to make people feel heard, supported,Β andΒ safe.”

Java Angular Docker

Table of Contents

Demo

A video walkthrough and live demo will be added shortly. Stay tuned!

✨ Features

1. πŸ” Authentication

  • Users can sign up and log in securely using their email and password.
  • All users are anonymous across the platform. Real names are never stored or revealed publicly.
  • Anonymous Guest login is available, allowing users to browse threads without registration.
  • Guest accounts are automatically deleted after 2 weeks to reduce storage usage.

2. πŸ›‘οΈ Role-Based Access Control

  • Role-based authentication hierarchy: MODERATOR > MEMBER > GUEST

  • Fine-grained permissions according to roles are provided:

    • MODERATOR: Can use the chatbot, manage threads, moderate content, and oversee platform safety.
    • MEMBER: Can use the chatbot and can create threads, comment, and participate in them too.
    • GUEST: Can view public threads page, but cannot create or comment on threads.
  • Implemented with Spring Security, including protected API endpoints and access control logic.

3. πŸ€– AI-Powered Chatbot

  • Engage with a compassionate chatbot designed to offer empathetic, human-like conversations. Users can freely vent and reflect without judgment.
  • Available exclusively to Moderator and Member roles.
  • Chatbot messages are automatically deleted after 2 weeks to ensure privacy and minimize data retention.
  • Powered by Ollama and the open-source Mistral model.

4. 🧡 Community Threads

  • Members can create and participate in open discussions (Threads) focused on mental health and well-being.
  • A supportive and anonymous space to share coping strategies and lived experiences.
  • Moderators can manage or remove inappropriate content.

5. 🐳 Docker Support

  • The entire application can be run using Docker Compose.
  • Simplifies setup for local development, testing, and contributions.
  • Backend and frontend Dockerfiles are included for isolated builds.

πŸ’» Technologies Used

Frontend

  • 🌐 Angular – Reactive front-end framework for building single-page applications (SPA).
  • 🟦 TypeScript – A statically typed superset of JavaScript for safer, scalable code.
  • 🎨 HTML5 & CSS – Standard markup and styling for responsive UI.
  • βš™οΈ RxJS – For reactive programming and efficient state management.

Backend & Database

  • β˜• Java 23+ – Modern backend development using the latest features.
  • 🧰 Spring Boot – Framework for building robust, production-grade REST APIs.
  • πŸ›’οΈ PostgreSQL – Powerful, open-source relational database for persistent storage.

DevOps & Deployment

  • 🐳 Docker – Containerization for consistent development and deployment.
  • πŸ“¦ Docker Compose – Simplifies multi-container setups.
  • ☁️ Render – Cloud platform for hosting the backend.
  • πŸ”Ό Vercel – Fast and reliable deployment for the frontend.

πŸ“ Project Structure

harmoniq/
β”œβ”€β”€ harmoniq_backend/       # Spring Boot backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── dev/anirban/harmoniq_backend/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ config/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ constants/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ dto/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ entity/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ exception/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ repo/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ security/
β”‚   β”‚   β”‚   β”‚       └── service/
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   β”‚       β”œβ”€β”€ application-dev.properties
β”‚   β”‚   β”‚       β”œβ”€β”€ application-docker.properties
β”‚   β”‚   β”‚       β”œβ”€β”€ application-prod.properties
β”‚   β”‚   β”‚       β”œβ”€β”€ application.properties
β”‚   β”‚   β”‚       └── static/
β”‚   └── Dockerfile          # Docker config for backend
β”‚
β”œβ”€β”€ harmoniq_frontend/      # Angular Framework Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ chatbot/
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”‚   β”œβ”€β”€ helplines/
β”‚   β”‚   β”‚   β”œβ”€β”€ home/
β”‚   β”‚   β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   β”‚   β”œβ”€β”€ shared/
β”‚   β”‚   β”‚   └── threads/
β”‚   β”‚   └── assets/
β”‚   β”œβ”€β”€ angular.json
β”‚   β”œβ”€β”€ Dockerfile          # Docker config for frontend
β”‚   └── package.json
β”‚
β”œβ”€β”€ ollama/                 # Ollama-specific folder
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── entrypoint.sh
β”‚
β”œβ”€β”€ docker-compose.yml      # Docker compose file for the whole app
└── README.md

βš™οΈ Installation Guide

Follow these steps to get the project up and running on your local machine.

1️⃣ Clone the Repository

Open a terminal (Git Bash for Windows or Terminal on macOS) and run:

git clone https://github.com/basakjeet08/Harmoniq.git

2️⃣ Open the Project Directory

cd harmoniq

3️⃣ Build & Run Using Docker (Recommended)

Build using Docker : Make sure your docker desktop is running.

docker-compose build

Start the ollama instance : On its initial run, it downloads the Mistral model ~4GB, which may take some time. Only run this the first time to pull and prepare the model.

docker-compose up -d ollama
docker logs -f --tail 100 ollama

Note : Keep in mind that after running this command the download would start and you should run the steps once the download is completed.

Now, stop and then restart the remaining containers in detached mode: - Run this after the Ollama Mistral model has finished downloading.

# Get out of the previous Process Using Ctrl + C first
docker-compose up -d

⚑What Does Docker Compose Do?

This will start four containers:

  1. db - PostgreSQL container.
  2. ollama - Ollama container which downloads Ollama Mistral Model.
  3. backend - Spring Boot application container.
  4. frontend - Angular frontend application container.

The setup is configured for a local development environment, so all the necessary database URLs and Spring Boot connections are automatically handled, making it easy to get started without manual configuration (when using docker compose).

βœ… Post-Installation

  • Once the containers are up and running, navigate to the frontend at http://127.0.0.1:5000 to start using the application.
  • For the backend, you can access it through http://localhost:8080.
  • The application will be running locally, and the database will be connected automatically.

πŸ›‘ Stop the docker containers when done

Stop the Docker containers : Make sure you stop the docker container and docker desktop when you are done testing the project.

docker stop $(docker ps -q)

πŸ‘¨β€πŸ’» Author

Building things with πŸ’», coffee β˜•, and a lot of ❀️ for clean code.

About

Harmoniq is a full-stack web application designed to foster a supportive community for individuals facing mental health challenges. It provides a safe, anonymous space where users can connect, share their experiences, and find solace through meaningful interactions.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages