Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Stress-management-app

Stress Management App is a modern platform that empowers users to track their stress levels, plan relaxation activities, and monitor progress over time. Users will be able to create detailed records of stressful events, receive personalized recommendations, and view insightful statistics about their wellbeing.

Vision

Stress Management App aims to deliver an intuitive and supportive environment to help users understand their stress patterns and take actionable steps toward improved wellbeing. Through structured tracking, personalized recommendations, and clear insights, users can gain confidence in managing their stress effectively.

Contributors

Read about contributors here

Core features

  • Creation and Viewing of Stress Sessions
  • Users can create entries documenting stressful experiences, including description, stress level, and date.

///// (for screens/gifs)

  • Relaxation Recommendations
  • The app provides relaxation suggestions, such as breathing exercises or mindfulness practices. These may be displayed as a feed on the main screen.

///// (for screens/gifs)

  • Stress History and Statistics
  • Users can access historical data and visualize trends, such as average stress levels over time and improvements.

///// (for screens/gifs)

Technical stack

Backend:

  • Go (Golang):

  • High-performance language powering all backend APIs and business logic.

  • GORM:

  • ORM library for database migrations and data access.

Frontend:

  • Flutter:

  • Cross-platform framework for building a responsive and smooth mobile and web user interface.

  • Authentication:

  • JWT (JSON Web Tokens)

  • Real-Time Communication:

  • WebSockets: enables live updates and notifications to clients.

⚙️ Setup Instructions

Follow these steps to set up the project locally for development and testing.


Prerequisites

Before you begin, make sure you have the following installed:


Clone the Repository

Clone the project and navigate into the folder:

git clone https://github.com/slickip/Stress-management-app.git
cd Stress-management-app

Backend setup

cd backend
go mod tidy
docker compose up --build

Frontend setup

cd frontend
flutter pub get
flutter run

Architecture Overview

All application features will be built around a single core service:

Backend

  • User Registration and Authentication

  • Account creation and login functionality

  • JWT-based authentication for secure access

  • User Data Storage

  • Persistent storage of user profiles

  • Stress Session Management

  • Full CRUD operations for stress session entries

  • Recommendation Engine

  • Delivery of relevant relaxation and wellness recommendations

  • Real-Time Updates

  • WebSocket channels to broadcast updates (e.g., new recommendations or session changes)

  • History and Statistics

  • Aggregation and retrieval of user stress history and analytics

Frontend screens

  • Registration & Login
  • User account creation and authentication
  • Add Stress Session
  • Form for creating new stress session records
  • Stress History
  • List and timeline view of past stress entries
  • Recommendations
  • Feed of relaxation activities and wellness tips
  • User Profile
  • Display and management of personal account settings

Component diagram

diagram This diagram shows internal components and how they interact:

  • Frontend Modules:

  • Authentication Module: Registration and login forms

  • Stress Sessions UI: Creating and viewing stress entries

  • Statistics & History UI: Visualizing past stress levels

  • Recommendations Feed: Displaying relaxation suggestions

  • WebSocket Client: Receiving live updates

  • Backend Components:

  • Auth Controller: Handles registration and login

  • JWT Middleware: Validates tokens for secured endpoints

  • Stress Sessions Controller: CRUD operations for stress entries

  • Statistics Service: Computes aggregates over stress data

  • Recommendation Engine: Generates relaxation recommendations

  • WebSocket Server: Pushes notifications to clients

  • GORM ORM: Data access layer to the database

component_diagram.puml

Deployment diagram

diagram This diagram shows the runtime deployment:

  • The User Device runs the Flutter app (web or mobile).
  • The API Server hosts:
  • The REST API
  • The WebSocket server
  • The PostgreSQL Database stores all persistent data.
  • The API Server communicates securely with clients and the database.

Context diagram

diagram

This diagram shows the high-level context of the system:

  • User interacts with the application through a Flutter-based mobile or web client.
  • The Flutter Frontend communicates with the Go API Server over secure HTTPS for REST API calls and WebSocket connections for real-time updates.
  • The Go API Server uses a relational Database (e.g., PostgreSQL) for storing user accounts, stress sessions, and statistics.

diagram

API Documentation

The Stress Management App provides a RESTful API secured with JWT authentication.
Below you’ll find an overview of the available endpoints.
For complete details and request/response examples, see the Swagger UI.


Authentication

Method Endpoint Description
POST /login Log in an existing user
POST /register Register a new user

Recommendations

Method Endpoint Description
GET /recommendations Get all recommendations
POST /recommendations Create a new recommendation
GET /recommendations/{id} Get a recommendation by ID
PUT /recommendations/{id} Update a recommendation by ID

Stress Sessions

Method Endpoint Description
GET /sessions Get all stress sessions for the authenticated user
POST /sessions Create a new stress session and broadcast via WebSocket
GET /sessions/{id} Get a stress session by ID
DELETE /sessions/{id} Delete a stress session

Statistics

Method Endpoint Description
GET /stats Get aggregated user statistics

WebSocket

Method Endpoint Description
GET /ws WebSocket endpoint for real-time session updates

Data Models (Examples)

CreateSessionInput

{
  "date": "2025-07-12",
  "description": "Felt stressed due to workload",
  "stress_level": 7
}

LoginInput

{
  "email": "user@example.com",
  "password": "password123"
}

RegisterInput

{
  "email": "user@example.com",
  "nickname": "JohnDoe",
  "password": "password123"
}

Recommendation input

{
  "title": "Deep Breathing Exercise",
  "description": "A guided breathing session to help you relax."
}

Authentication & Security

All endpoints (except /login and /register) require a valid JWT token in the Authorization header:

Authorization: Bearer <your_token_here>

Tokens are issued upon successful login and must be included in every authenticated reques

Swagger UI

The complete interactive API documentation is available here

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages