a7medk7aledak/VitaPsyche-Graduation-Project

TypeScript

0

312 commits

updated Aug 7, 2025

See the code

README

VitaPsyche Grauation

Overview

VitaPsyche is a comprehensive mental health platform designed to help users assess and manage their psychological well-being. The platform uses AI and machine learning models to analyze psychological disorders, offers personalized doctor recommendations, and facilitates communication between patients and doctors. It also includes an intelligent chatbot powered by Rasa Framework, which provides psychological assessments and general mental health advice. Additionally, the platform enables direct communication between patients and doctors for consultations and continuous support. web side rate moblie

Key Features

  • Psychological Disorder Analysis: AI models analyze patient data and facial expressions to assess potential psychological disorders.
  • Doctor Recommendations: Based on the analysis, the platform suggests appropriate doctors for consultations.
  • Patient-Doctor Communication: Facilitates secure and private communication between patients and doctors for consultations and follow-up sessions.
  • Intelligent Chatbot: The chatbot, powered by Rasa Framework, provides real-time psychological advice and guidance.
  • Articles and Resources: Offers articles on mental health, well-being tips, and psychological self-help resources.
  • Authentication System: Users can register, log in, and manage their profiles.

Technologies Used

  • Next.js: Front-end framework for building the user interface with server-side rendering and static site generation.
  • Django (or Flask): Backend framework handling APIs, user authentication, and data management.
  • Rasa Framework: Used to power the chatbot for personalized interaction with patients.
  • MongoDB: NoSQL database used to store user data, session information, and communication history between patients and doctors.
  • Tailwind CSS: A utility-first CSS framework used to style the platform.
  • Express & Node.js: API back-end that communicates with the front-end and manages data flows between the client and server.

Setup Instructions

What we use (tools and technics) in the project

Prerequisites

Ensure you have the following installed on your machine:

  • Node.js (v20.15.0 or higher)
  • Python (v3.8 to v3.10)
  • MongoDB
  • Django (or Flask for the backend)
  • Rasa Framework
  • npm or yarn

Cloning the Repository

git clone https://github.com/your-username/mind-med.git
cd mind-med

Environment Variables You need to set environment variables for both the front-end and back-end. Create .env files in the respective directories (client and server).

For Next.js (client):

NEXT_PUBLIC_API_URL=<your_backend_api_url>
NEXT_PUBLIC_RASA_URL=<your_rasa_chatbot_url>

For Django (or Flask) (server):

DATABASE_URL=<your_mongo_db_url>
SECRET_KEY=<your_django_secret_key>
DEBUG=True

Installing Dependencies and run To run all project in your device follow that steps: 1-Next.js front-end:

cd client
#install node_modules
npm install
npm run dev

Flutter mobile app:

Flutter Mobile App Features

  • Responsive UI: Ensures the app works seamlessly on different devices with various screen sizes.

  • State Management: Implemented using Provider or BLoC for clean and efficient code architecture.

  • Offline Mode: Certain features are accessible even without an internet connection, ensuring usability in all situations.

  • Secure Storage: Sensitive user data is securely stored using flutter_secure_storage or similar libraries.

  • Chat Integration: The chatbot is embedded into the app for seamless user interaction without leaving the platform.

  • Interactive Charts: Visual representations of user assessments and progress over time for better engagement.


Flutter Setup Instructions

  1. Clone and Navigate to Mobile Directory
    git clone https://github.com/a7medk7aledak/VitaPsyche-Graduation-Project.git
    cd mobile
    
  2. Install Dependencies
    flutter pub get
    
  3. Run the App
    Ensure your emulator or connected device is active:
    flutter run
    
  4. Clean Build (optional)
    To ensure no cached issues:
    flutter clean
    flutter pub get
    flutter run
    

Directory Structure

lib/
├── core/                # Core layer for shared and general utilities
│   ├── errors/          # Custom exceptions and error handling
│   ├── utils/           # General helper classes and utility functions
│   ├── themes/          # App themes and design system
│   ├── constants/       # Application-wide constants (e.g., API URLs, colors, etc.)
│   └── widgets/         # Reusable widgets used across the app
│
├── features/            # Feature modules for different parts of the app
│   ├── auth/            # Authentication feature
│   │   ├── data/        # Data layer
│   │   │   ├── models/  # Data models
│   │   │   ├── datasources/ # Local/Remote data sources
│   │   │   └── repositories/ # Repository implementations
│   │   ├── domain/      # Domain layer
│   │   │   ├── entities/ # Core entities for the feature
│   │   │   └── usecases/ # Business logic use cases
│   │   ├── presentation/ # Presentation layer
│   │       ├── screens/  # Screens for UI
│   │       ├── widgets/  # Widgets for the feature
│   │       └── providers/ # State management
│   │
│   ├── chat/            # Chat feature (similar structure as auth)
│   ├── profile/         # Profile feature
│   └── home/            # Home feature
│
└── main.dart            # Entry point of the application

Explanation of Layers

Core Layer

The Core Layer contains code that is shared across multiple features:

  • errors/: Custom exception classes for error handling.
  • utils/: Helper classes for common operations.
  • themes/: Centralized app theme definitions.
  • constants/: Application-wide constants like API URLs, colors, etc.
  • widgets/: Reusable UI components not tied to a specific feature.

Features Layer

The Features Layer is where each app feature/module is defined, and each feature follows the Clean Architecture layers:

  1. Data Layer:
    • Handles data fetching, storage, and transformation.
    • Includes models, data sources (e.g., API, database), and repositories.
  2. Domain Layer:
    • Focused on business logic and independent of frameworks.
    • Contains use cases (business logic) and entities (core objects).
  3. Presentation Layer:
    • Handles UI and state management.
    • Includes screens, widgets, and providers for state management.

Benefits of this Structure

  • Scalability: Adding new features without affecting existing ones is easy.
  • Maintainability: Clear separation of concerns ensures code is easier to debug and test.
  • Reusability: Shared utilities and widgets can be reused across features.
  • Testability: Business logic and UI are decoupled, making it easier to write unit tests.

Flutter Libraries Used

This project utilizes the following libraries to enhance functionality and streamline development:


Upcoming Features (Flutter)

  • AI-Driven Personal Insights: Integrate AI models into the mobile app for on-the-go mental health insights.
  • Calendar and Reminders: A built-in calendar to track appointments, sessions, and assessments.
  • Interactive Animations: Leverage animations for a more engaging UI.

3.5-Django back-end all project:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
py -3.9 -m venv .venv
.\.venv\Scripts\activate
cd server
cd Project
pip install django
py -m pip install --upgrade pip
pip install requests
pip install django-cors-headers
pip install drf-yasg
pip install djangorestframework-simplejwt
pip install -r requirements.txt
py -m pip install --upgrade pip
pip install djangorestframework
pip install django-cors-headers
pip install drf-yasg
pip install coverage

#don't run that if you want run chatbot
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

#to run the server chatbot
python manage.py runserver

to make backend tastes:

cd Back-End/Project
python manage.py test
coverage run --source='.' manage.py test
coverage report -m

4-rasa chatbot:

#note Python versions: 3.7, 3.8, 3.9, and 3.10. Note that Python 3.10 is only supported for versions 3.4.x and upwards
#to make a new Environment =>  that step make it once
cd chatbot
pip install rasa
pip install --upgrade cryptography
pip install rasa-sdk openai python-dotenv websockets

or
pip install cryptography==3.4.8
rasa train
rasa run -m models --enable-api --cors "*"

deployment rasa train --fixed-model-name model

to Run action and api

cd chatbot
rasa run actions

5-rasa lina:

cd lina model
pip install rasa
pip install cryptography==38.0.4
rasa train
rasa run --port 5006

note: To test the Rasa Chatbot and Lina by terminal:

rasa train
rasa data validate  #track files in rasa
rasa shell

API Testing Use Postman or Insomnia to test the APIs for the back-end and to ensure the chatbot is responding as expected.

Project Design Links figam

Mobile Design figma

moblie

Web Design figma

web

Deployment To deploy the application, you can use the following services:

Vercel for deploying the Next.js front-end:

Ensure environment variables are set in the Vercel dashboard. Push your changes to GitHub, and Vercel will automatically deploy the site. Heroku for deploying the Django back-end:

Use the Heroku CLI to deploy. Set environment variables in Heroku. Docker for deploying the Rasa Chatbot:

Consider using Docker containers to deploy the chatbot in a cloud environment for scalability. Communication Features The Mind Med platform includes secure channels for communication between patients and doctors. Patients can request consultations, and doctors can provide feedback and treatment plans based on the AI analysis of the patient’s psychological state.

The chatbot serves as the initial point of contact for psychological assessments, offering users basic insights and advice before they interact with a doctor for a more detailed consultation.

Contributions Feel free to fork this repository, submit pull requests, or open issues for feature requests or bug fixes. We welcome community contributions!

a7medk7aledak/VitaPsyche-Graduation-Project

TypeScript

0

312 commits

updated Aug 7, 2025

See the code

README

VitaPsyche Grauation

Overview

VitaPsyche is a comprehensive mental health platform designed to help users assess and manage their psychological well-being. The platform uses AI and machine learning models to analyze psychological disorders, offers personalized doctor recommendations, and facilitates communication between patients and doctors. It also includes an intelligent chatbot powered by Rasa Framework, which provides psychological assessments and general mental health advice. Additionally, the platform enables direct communication between patients and doctors for consultations and continuous support. web side rate moblie

Key Features

  • Psychological Disorder Analysis: AI models analyze patient data and facial expressions to assess potential psychological disorders.
  • Doctor Recommendations: Based on the analysis, the platform suggests appropriate doctors for consultations.
  • Patient-Doctor Communication: Facilitates secure and private communication between patients and doctors for consultations and follow-up sessions.
  • Intelligent Chatbot: The chatbot, powered by Rasa Framework, provides real-time psychological advice and guidance.
  • Articles and Resources: Offers articles on mental health, well-being tips, and psychological self-help resources.
  • Authentication System: Users can register, log in, and manage their profiles.

Technologies Used

  • Next.js: Front-end framework for building the user interface with server-side rendering and static site generation.
  • Django (or Flask): Backend framework handling APIs, user authentication, and data management.
  • Rasa Framework: Used to power the chatbot for personalized interaction with patients.
  • MongoDB: NoSQL database used to store user data, session information, and communication history between patients and doctors.
  • Tailwind CSS: A utility-first CSS framework used to style the platform.
  • Express & Node.js: API back-end that communicates with the front-end and manages data flows between the client and server.

Setup Instructions

What we use (tools and technics) in the project

Prerequisites

Ensure you have the following installed on your machine:

  • Node.js (v20.15.0 or higher)
  • Python (v3.8 to v3.10)
  • MongoDB
  • Django (or Flask for the backend)
  • Rasa Framework
  • npm or yarn

Cloning the Repository

git clone https://github.com/your-username/mind-med.git
cd mind-med

Environment Variables You need to set environment variables for both the front-end and back-end. Create .env files in the respective directories (client and server).

For Next.js (client):

NEXT_PUBLIC_API_URL=<your_backend_api_url>
NEXT_PUBLIC_RASA_URL=<your_rasa_chatbot_url>

For Django (or Flask) (server):

DATABASE_URL=<your_mongo_db_url>
SECRET_KEY=<your_django_secret_key>
DEBUG=True

Installing Dependencies and run To run all project in your device follow that steps: 1-Next.js front-end:

cd client
#install node_modules
npm install
npm run dev

Flutter mobile app:

Flutter Mobile App Features

  • Responsive UI: Ensures the app works seamlessly on different devices with various screen sizes.

  • State Management: Implemented using Provider or BLoC for clean and efficient code architecture.

  • Offline Mode: Certain features are accessible even without an internet connection, ensuring usability in all situations.

  • Secure Storage: Sensitive user data is securely stored using flutter_secure_storage or similar libraries.

  • Chat Integration: The chatbot is embedded into the app for seamless user interaction without leaving the platform.

  • Interactive Charts: Visual representations of user assessments and progress over time for better engagement.


Flutter Setup Instructions

  1. Clone and Navigate to Mobile Directory
    git clone https://github.com/a7medk7aledak/VitaPsyche-Graduation-Project.git
    cd mobile
    
  2. Install Dependencies
    flutter pub get
    
  3. Run the App
    Ensure your emulator or connected device is active:
    flutter run
    
  4. Clean Build (optional)
    To ensure no cached issues:
    flutter clean
    flutter pub get
    flutter run
    

Directory Structure

lib/
├── core/                # Core layer for shared and general utilities
│   ├── errors/          # Custom exceptions and error handling
│   ├── utils/           # General helper classes and utility functions
│   ├── themes/          # App themes and design system
│   ├── constants/       # Application-wide constants (e.g., API URLs, colors, etc.)
│   └── widgets/         # Reusable widgets used across the app
│
├── features/            # Feature modules for different parts of the app
│   ├── auth/            # Authentication feature
│   │   ├── data/        # Data layer
│   │   │   ├── models/  # Data models
│   │   │   ├── datasources/ # Local/Remote data sources
│   │   │   └── repositories/ # Repository implementations
│   │   ├── domain/      # Domain layer
│   │   │   ├── entities/ # Core entities for the feature
│   │   │   └── usecases/ # Business logic use cases
│   │   ├── presentation/ # Presentation layer
│   │       ├── screens/  # Screens for UI
│   │       ├── widgets/  # Widgets for the feature
│   │       └── providers/ # State management
│   │
│   ├── chat/            # Chat feature (similar structure as auth)
│   ├── profile/         # Profile feature
│   └── home/            # Home feature
│
└── main.dart            # Entry point of the application

Explanation of Layers

Core Layer

The Core Layer contains code that is shared across multiple features:

  • errors/: Custom exception classes for error handling.
  • utils/: Helper classes for common operations.
  • themes/: Centralized app theme definitions.
  • constants/: Application-wide constants like API URLs, colors, etc.
  • widgets/: Reusable UI components not tied to a specific feature.

Features Layer

The Features Layer is where each app feature/module is defined, and each feature follows the Clean Architecture layers:

  1. Data Layer:
    • Handles data fetching, storage, and transformation.
    • Includes models, data sources (e.g., API, database), and repositories.
  2. Domain Layer:
    • Focused on business logic and independent of frameworks.
    • Contains use cases (business logic) and entities (core objects).
  3. Presentation Layer:
    • Handles UI and state management.
    • Includes screens, widgets, and providers for state management.

Benefits of this Structure

  • Scalability: Adding new features without affecting existing ones is easy.
  • Maintainability: Clear separation of concerns ensures code is easier to debug and test.
  • Reusability: Shared utilities and widgets can be reused across features.
  • Testability: Business logic and UI are decoupled, making it easier to write unit tests.

Flutter Libraries Used

This project utilizes the following libraries to enhance functionality and streamline development:


Upcoming Features (Flutter)

  • AI-Driven Personal Insights: Integrate AI models into the mobile app for on-the-go mental health insights.
  • Calendar and Reminders: A built-in calendar to track appointments, sessions, and assessments.
  • Interactive Animations: Leverage animations for a more engaging UI.

3.5-Django back-end all project:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
py -3.9 -m venv .venv
.\.venv\Scripts\activate
cd server
cd Project
pip install django
py -m pip install --upgrade pip
pip install requests
pip install django-cors-headers
pip install drf-yasg
pip install djangorestframework-simplejwt
pip install -r requirements.txt
py -m pip install --upgrade pip
pip install djangorestframework
pip install django-cors-headers
pip install drf-yasg
pip install coverage

#don't run that if you want run chatbot
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

#to run the server chatbot
python manage.py runserver

to make backend tastes:

cd Back-End/Project
python manage.py test
coverage run --source='.' manage.py test
coverage report -m

4-rasa chatbot:

#note Python versions: 3.7, 3.8, 3.9, and 3.10. Note that Python 3.10 is only supported for versions 3.4.x and upwards
#to make a new Environment =>  that step make it once
cd chatbot
pip install rasa
pip install --upgrade cryptography
pip install rasa-sdk openai python-dotenv websockets

or
pip install cryptography==3.4.8
rasa train
rasa run -m models --enable-api --cors "*"

deployment rasa train --fixed-model-name model

to Run action and api

cd chatbot
rasa run actions

5-rasa lina:

cd lina model
pip install rasa
pip install cryptography==38.0.4
rasa train
rasa run --port 5006

note: To test the Rasa Chatbot and Lina by terminal:

rasa train
rasa data validate  #track files in rasa
rasa shell

API Testing Use Postman or Insomnia to test the APIs for the back-end and to ensure the chatbot is responding as expected.

Project Design Links figam

Mobile Design figma

moblie

Web Design figma

web

Deployment To deploy the application, you can use the following services:

Vercel for deploying the Next.js front-end:

Ensure environment variables are set in the Vercel dashboard. Push your changes to GitHub, and Vercel will automatically deploy the site. Heroku for deploying the Django back-end:

Use the Heroku CLI to deploy. Set environment variables in Heroku. Docker for deploying the Rasa Chatbot:

Consider using Docker containers to deploy the chatbot in a cloud environment for scalability. Communication Features The Mind Med platform includes secure channels for communication between patients and doctors. Patients can request consultations, and doctors can provide feedback and treatment plans based on the AI analysis of the patient’s psychological state.

The chatbot serves as the initial point of contact for psychological assessments, offering users basic insights and advice before they interact with a doctor for a more detailed consultation.

Contributions Feel free to fork this repository, submit pull requests, or open issues for feature requests or bug fixes. We welcome community contributions!