A comprehensive, containerized full-stack web application designed to manage clinic operations, patient records, therapist schedules, and secure communications.
This project uses a decoupled, Dockerized architecture to ensure isolated environments and seamless deployment.
| Layer | Technology |
|---|---|
| Frontend | Next.js (React), Axios, CSS Modules |
| Backend | Django, Django REST Framework (DRF) |
| Database | PostgreSQL |
| Auth | JWT Authentication |
| Infrastructure | Docker & Docker Compose |
| Networking | Tailscale (secure remote tunnel access) |
- Role-Based Dashboards β Distinct interfaces and access levels for Admins, Therapists, and Patients.
- Secure Authentication β JWT-based login and session management.
- User Management β Admins can onboard staff, register patients, and manage account statuses.
- Profile Management β Dynamic profile updates including secure image uploading.
- Messaging System β Integrated chat threads for secure communication between patients and their assigned therapists.
- Dynamic Routing β Environment variable-driven networking allowing seamless switching between
localhostand Tailscale VPN IPs.
Before running this project, ensure you have the following installed:
- Docker Desktop (WSL2 backend required on Windows)
- Tailscale (required only for remote network access or demos)
git clone https://github.com/SoCool-Theo/Mental_Health_System
cd Mental_Health_SystemFrontend β Create a .env.local file inside the frontend/ directory:
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_API_URL=http://localhost:8000/api/Replace
localhostwith your Tailscale IP if testing across multiple devices on a VPN.
Backend β Ensure your backend/.env file or docker-compose.yml includes the required PostgreSQL credentials (e.g. POSTGRES_PASSWORD).
docker compose up --build -ddocker compose exec backend python manage.py makemigrations
docker compose exec backend python manage.py migrate
# Explicitly migrate custom apps
docker compose exec backend python manage.py makemigrations communications
docker compose exec backend python manage.py migratedocker compose exec backend python manage.py createsuperuser| Service | URL |
|---|---|
| Frontend (Next.js) | http://localhost:3000 |
| Backend API (Django) | http://localhost:8000/api/ |
To access the app from another device on your Tailscale network, bridge the Docker ports from your host Linux environment:
sudo tailscale serve --bg --tcp 8000 tcp://127.0.0.1:8000
sudo tailscale serve --bg --tcp 3000 tcp://127.0.0.1:3000Then update your frontend/.env.local with your Tailscale IP and rebuild:
docker compose up --build| Command | Description |
|---|---|
docker compose down |
Stop all running containers |
docker compose logs -f |
Stream live container logs |
docker builder prune -a |
Clear build cache (fixes snapshot errors) |
Mental_Health_System/
βββ frontend/ # Next.js application
β βββ src/
β βββ public/
β βββ .env.local.example
β βββ package.json
β βββ Dockerfile
β
βββ backend/ # Django backend
β βββ mental_health_clinic/ # Django root directory
β βββ appointments/
β βββ communications/
β βββ users/
β βββ mental_health_clinic/ # Django project settings
β βββ manage.py
β βββ requirements.txt
β βββ Dockerfile
βββ .env.example
βββ docker-compose.yml
This project was developed as part of a university submission. All rights reserved.