React Vite Tailwind CSS License
Your personalized AI-powered mental health companion providing support through conversations, assessments, and wellness activities
๐ Live Demo โข ๐ Documentation โข ๐ ๏ธ Installation โข ๐ค Contributing
- ๐ About The Project
- โจ Features
- ๐ Advantages
- ๐ ๏ธ Tech Stack
- ๐๏ธ Architecture
- ๐ Installation
- ๐ป Usage
- ๐ Project Structure
- ๐ Workflows
- ๐ฎ Demo
- ๐ค Contributing
- ๐ License
- ๐ Contact
PsyMitrix is an innovative AI-powered mental health companion designed to provide accessible, personalized mental health support. Built as a comprehensive frontend demonstration, it showcases modern web technologies while addressing the critical need for mental health resources.
To democratize mental health support through AI-powered conversations, evidence-based assessments, and interactive wellness activities, making mental health care more accessible and less stigmatized.
mindmap
root((PsyMitrix))
AI Chat
Sentiment Analysis
Contextual Responses
24/7 Availability
Assessments
PHQ-9 Depression
GAD-7 Anxiety
Progress Tracking
Wellness
Breathing Exercises
Mood Journaling
Gratitude Practice
Analytics
Progress Dashboard
Mental Health Metrics
Session History
| Feature | Description | Status |
|---|---|---|
| ๐ค AI Psychiatrist Chat | Interactive conversations with sentiment analysis and contextual responses | โ Active |
| ๐ Mental Health Assessments | Standardized PHQ-9 and GAD-7 assessments with scoring | โ Active |
| ๐ฎ Wellness Games | Interactive breathing exercises, mood tracking, and gratitude practices | โ Active |
| ๐ Progress Dashboard | Comprehensive analytics and progress tracking | โ Active |
| ๐ User Authentication | Secure login/logout with session management | โ Active |
| ๐ Dark/Light Theme | Responsive theme switching with persistence | โ Active |
| ๐ฑ Responsive Design | Optimized for desktop, tablet, and mobile devices | โ Active |
- Sentiment Analysis: Real-time emotion detection from user messages
- Contextual Responses: Tailored responses based on anxiety, depression, or positive sentiment
- Session Persistence: Chat history maintained throughout user session
- Typing Indicators: Realistic AI typing simulation for enhanced UX
- PHQ-9 (Depression): 9-question standardized depression screening
- GAD-7 (Anxiety): 7-question generalized anxiety disorder assessment
- Automated Scoring: Real-time calculation with severity interpretation
- Progress Tracking: Historical assessment results and trend analysis
- Breathing Exercise: Guided 4-4-6 breathing pattern with visual cues
- Mood Journal: Daily mood tracking with notes and patterns
- Gratitude Practice: Structured gratitude exercises for positive psychology
| Advantage | Description | Impact |
|---|---|---|
| โก Lightning Fast | Vite-powered development with instant HMR | ๐ฅ High Performance |
| ๐จ Modern UI/UX | Tailwind CSS with custom design system | ๐ Professional Look |
| ๐ฑ Mobile-First | Responsive design across all devices | ๐ Better Accessibility |
| ๐ Type Safety | JavaScript with prop validation | ๐ก๏ธ Fewer Bugs |
| ๐ Theme Support | Built-in dark/light mode switching | ๐ค Better UX |
| ๐ง Modular Architecture | Component-based structure for scalability | ๐๏ธ Maintainable Code |
graph TD
A[PsyMitrix Advantages] --> B[Accessibility]
A --> C[Cost-Effective]
A --> D[Scalability]
A --> E[Privacy]
B --> B1[24/7 Availability]
B --> B2[No Geographic Limits]
B --> B3[Multiple Languages Ready]
C --> C1[No Therapist Costs]
C --> C2[Reduced Healthcare Burden]
C --> C3[Preventive Care]
D --> D1[Unlimited Users]
D --> D2[Easy Deployment]
D --> D3[Cloud-Ready]
E --> E1[Anonymous Support]
E --> E2[Confidential Sessions]
E --> E3[No Judgment Zone]
| Technology | Version | Purpose | Why Chosen |
|---|---|---|---|
| โ๏ธ React | 18.2.0 | UI Framework | Component reusability, Virtual DOM, Large ecosystem |
| โก Vite | 5.0.8 | Build Tool | Lightning-fast HMR, optimized builds, ES modules |
| ๐จ Tailwind CSS | 3.3.6 | Styling | Utility-first, responsive design, small bundle size |
| ๐ฃ๏ธ React Router | 6.8.0 | Navigation | SPA routing, protected routes, clean URLs |
| ๐ง ESLint | 8.55.0 | Code Quality | Consistent code style, error prevention |
graph LR
A[Development] --> B[Code Quality]
A --> C[Build Process]
A --> D[Styling]
B --> B1[ESLint]
B --> B2[React Hooks Rules]
B --> B3[React Refresh]
C --> C1[Vite]
C --> C2[PostCSS]
C --> C3[Autoprefixer]
D --> D1[Tailwind CSS]
D --> D2[Dark Mode]
D --> D3[Custom Themes]
graph TB
subgraph "Frontend Layer"
A[React App] --> B[React Router]
B --> C[Protected Routes]
B --> D[Public Routes]
end
subgraph "State Management"
E[Context Providers] --> F[Auth Provider]
E --> G[Theme Provider]
end
subgraph "UI Components"
H[Pages] --> I[Dashboard]
H --> J[Chat]
H --> K[Assessments]
H --> L[Games]
M[Shared Components] --> N[Button]
M --> O[Input]
M --> P[Assessment]
end
subgraph "Data Layer"
Q[Mock APIs] --> R[Auth API]
Q --> S[Sessions API]
Q --> T[Products API]
end
A --> E
A --> H
A --> M
H --> Q
graph TD
A[App.jsx] --> B[ThemeProvider]
B --> C[AuthProvider]
C --> D[BrowserRouter]
D --> E[AppRoutes]
E --> F[Protected Routes]
E --> G[Public Routes]
F --> H[Dashboard]
F --> I[Chat]
F --> J[Assessments]
F --> K[Games]
F --> L[Profile]
F --> M[Progress]
G --> N[Login]
G --> O[Home]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
Before you begin, ensure you have the following installed:
| Requirement | Version | Download Link |
|---|---|---|
| ๐ฆ Node.js | โฅ 16.0.0 | nodejs.org |
| ๐ npm | โฅ 8.0.0 | Included with Node.js |
| ๐ป Git | Latest | git-scm.com |
# 1๏ธโฃ Clone the repository git clone https://github.com/your-username/psymitrix.git cd psymitrix # 2๏ธโฃ Install dependencies npm install # 3๏ธโฃ Start development server npm run dev # 4๏ธโฃ Open your browser # Navigate to http://localhost:5173
| Command | Description | Usage |
|---|---|---|
npm run dev |
Start development server with HMR | Development |
npm run build |
Build for production | Deployment |
npm run preview |
Preview production build | Testing |
npm run lint |
Run ESLint code analysis | Code Quality |
Create a .env file in the root directory (optional for demo):
# Development Configuration VITE_APP_NAME=PsyMitrix VITE_APP_VERSION=1.0.0 # API Configuration (for future backend integration) VITE_API_BASE_URL=https://api.psymitrix.com VITE_AI_API_KEY=your_ai_api_key_here
Demo Credentials:
- Email:
utsav@example.com - Password:
password
- View mental health metrics
- Track recent sessions
- Quick access to all features
// Example interaction flow User: "I'm feeling anxious about my presentation tomorrow" AI: "I understand you're feeling anxious. That's completely valid. Can you tell me what specifically is causing these anxious feelings?"
sequenceDiagram
participant U as User
participant A as Assessment
participant S as Scoring
participant R as Results
U->>A: Select PHQ-9/GAD-7
A->>U: Present questions
U->>A: Answer questions
A->>S: Submit responses
S->>R: Calculate score
R->>U: Show results & recommendations
- Breathing Exercise: 4-count inhale, 4-count hold, 6-count exhale
- Mood Journal: Track daily mood with notes
- Gratitude Practice: Structured gratitude exercises
psymitrix/
โโ๏ฟฝ๏ฟฝ๏ฟฝ ๐ public/ # Static assets
โโโ ๐ src/
โ โโโ ๐ api/ # Mock API services
โ โ โโโ ๐ auth.js # Authentication API
โ โ โโโ ๐ sessions.js # Session management
โ โ โโโ ๐ index.js # API exports
โ โโโ ๐ components/ # Reusable components
โ โ โโโ ๐ assessments/ # Assessment components
โ โ โโโ ๐ custom/ # Custom components
โ โ โโโ ๐ ui/ # UI primitives
โ โโโ ๐ features/ # Feature modules
โ โ โโโ ๐ auth/ # Authentication feature
โ โโโ ๐ hooks/ # Custom React hooks
โ โโโ ๐ pages/ # Page components
โ โ โโโ ๐ Dashboard/ # Dashboard & sections
โ โ โโโ ๐ Chat/ # AI Chat interface
โ โ โโโ ๐ Assessments/ # Mental health tests
โ โ โโโ ๐ Games/ # Wellness activities
โ โ โโโ ๐ Profile/ # User profile
โ โ โโโ ๐ Progress/ # Progress tracking
โ โโโ ๐ providers/ # Context providers
โ โโโ ๐ routes/ # Routing configuration
โ โโโ ๐ styles/ # Global styles
โโโ ๐ package.json # Dependencies & scripts
โโโ ๐ tailwind.config.js # Tailwind configuration
โโโ ๐ vite.config.js # Vite configuration
โโโ ๐ README.md # Project documentation
| Directory | Purpose | Key Files |
|---|---|---|
/src/pages/ |
Main application pages | Dashboard, Chat, Assessments |
/src/components/ |
Reusable UI components | Button, Input, Assessment |
/src/api/ |
Mock API services | auth.js, sessions.js |
/src/providers/ |
React context providers | AuthProvider, ThemeProvider |
/src/hooks/ |
Custom React hooks | useAuth.js |
flowchart TD
A[User Visits App] --> B{Authenticated?}
B -->|No| C[Redirect to Login]
B -->|Yes| D[Show Dashboard]
C --> E[Enter Credentials]
E --> F{Valid Credentials?}
F -->|No| G[Show Error]
F -->|Yes| H[Store Token]
G --> E
H --> I[Redirect to Dashboard]
I --> D
D --> J[Access Protected Routes]
J --> K[Chat, Assessments, Games]
flowchart LR
A[User Message] --> B[Sentiment Analysis]
B --> C{Detected Emotion}
C -->|Anxiety| D[Anxiety Response Pool]
C -->|Depression| E[Depression Response Pool]
C -->|Positive| F[Positive Response Pool]
C -->|Neutral| G[Neutral Response Pool]
D --> H[Select Response]
E --> H
F --> H
G --> H
H --> I[Add Typing Delay]
I --> J[Display AI Response]
graph TD
A[Select Assessment] --> B{Assessment Type}
B -->|PHQ-9| C[Depression Questions]
B -->|GAD-7| D[Anxiety Questions]
C --> E[9 Questions]
D --> F[7 Questions]
E --> G[Calculate Score]
F --> G
G --> H{Score Range}
H -->|0-4| I[Minimal]
H -->|5-9| J[Mild]
H -->|10-14| K[Moderate]
H -->|15-19| L[Moderately Severe]
H -->|20-27| M[Severe]
I --> N[Generate Recommendations]
J --> N
K --> N
L --> N
M --> N
N --> O[Store Results]
O --> P[Display Results & Next Steps]
Note: This is a frontend-only demo with simulated backend functionality.
Demo Account:
- Email:
utsav@gmail.com - Password:
123
| Feature | Description |
|---|---|
| ๐ Home Page | Landing page with feature overview |
| ๐ค AI Chat | Interactive mental health conversations |
| ๐ Dashboard | Mental health metrics and progress |
| ๐ Assessments | PHQ-9 and GAD-7 standardized tests |
| ๐ฎ Wellness Games | Breathing exercises and mood tracking |
-
Authentication System
- Login with demo credentials
- Session persistence
- Protected routes
-
AI Chat Simulation
- Sentiment analysis
- Contextual responses
- Real-time messaging
-
Mental Health Assessments
- Complete PHQ-9 depression screening
- Take GAD-7 anxiety assessment
- View results and recommendations
-
Wellness Activities
- Try guided breathing exercises
- Log mood entries
- Practice gratitude exercises
We welcome contributions from the community! Here's how you can help:
-
Fork the Project
git clone https://github.com/Matrixxboy/psymitrix.git
-
Create Feature Branch
git checkout -b feature/AmazingFeature
-
Make Changes
- Follow existing code style
- Add tests for new features
- Update documentation
-
Commit Changes
git commit -m 'Add some AmazingFeature' -
Push to Branch
git push origin feature/AmazingFeature
-
Open Pull Request
- Describe your changes
- Link any related issues
- Request review
| Area | Guidelines |
|---|---|
| Code Style | Follow ESLint rules, use Prettier |
| Components | Use functional components with hooks |
| Naming | Use descriptive names, follow conventions |
| Testing | Add tests for new features |
| Documentation | Update README and code comments |
When reporting bugs, please include:
- Environment details (OS, Browser, Node version)
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
We'd love to hear your ideas! Please include:
- Problem description
- Proposed solution
- Use cases
- Implementation suggestions
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Matrixxboy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Utsav Lankapati
- ๐ง Email: matrix.utsav.lankapati@gmail.com
- ๐ผ LinkedIn: Connect with me
- ๐ฑ GitHub: @Matrixxboy
- ๐ Project Repository: GitHub
- ๐ Issue Tracker: Report Issues
- ๐ก Feature Requests: Request Features
- ๐ Documentation: Wiki
-
Mental Health Organizations
-
Assessment Tools
- PHQ-9 Depression Scale
- GAD-7 Anxiety Scale
-
Technology Stack
- Mental health professionals for guidance on assessment implementation
- Open source community for amazing tools and libraries
- Beta testers for valuable feedback and suggestions
PsyMitrix - Making mental health support accessible to everyone
Made with React Powered by Vite Styled with Tailwind
โญ Star this repository if it helped you! โญ