A modern telehealth platform that connects patients with doctors for virtual consultations.
├── Backend/ # Go backend API
│ ├── api/ # API handlers and routes
│ ├── db/ # Database migrations and queries
│ │ ├── migration/ # SQL migrations
│ │ └── sqlc/ # SQLC-generated Go code
│ ├── token/ # Paseto token functionality
│ └── util/ # Utility functions
└── Frontend/ # React frontend
├── public/ # Static assets
└── src/
├── components/ # UI components
├── hooks/ # Custom React hooks
├── pages/ # Page components
└── utils/ # Utility functions
- Go with Gin framework
- PostgreSQL database
- SQLC for type-safe SQL
- PASETO/JWT for authentication
- Migrate for database migrations
- React 18
- Vite
- React Router
- shadcn/ui components
- Tailwind CSS
- Lucide React icons
- Go 1.24 or higher
- Node.js 16 or higher
- PostgreSQL 14 or higher
-
Create a PostgreSQL database:
CREATE DATABASE vitareach;
-
Run migrations:
cd Backend migrate -path db/migration -database "postgresql://username:password@localhost:5432/vitareach?sslmode=disable" -verbose up
-
Navigate to the backend directory:
cd Backend
-
Build and run:
go build -o vitareach ./vitareach
The backend will start on port 3000.
-
Navigate to the frontend directory:
cd Frontend
-
Install dependencies:
npm install
-
Start development server:
npm run dev
The frontend will start on port 8080.
POST /patients
- Register a new patientPOST /patients/login
- Patient loginGET /patients/profile
- Get patient profilePUT /patients/profile
- Update patient profilePATCH /patients/password
- Update patient passwordDELETE /patients
- Delete patient accountGET /patients/check-username/:username
- Check if username existsGET /patients/check-email/:email
- Check if email exists
POST /doctors
- Register a new doctorPOST /doctors/login
- Doctor loginGET /doctors
- List doctors (with pagination)GET /doctors/profile
- Get doctor profilePUT /doctors/profile
- Update doctor profilePATCH /doctors/password
- Update doctor passwordDELETE /doctors
- Delete doctor accountGET /doctors/check-username/:username
- Check if username existsGET /doctors/check-email/:email
- Check if email exists
- Registration and login
- View and update profile information
- Delete account
- Browse and search for doctors
- Book appointments
- Filter appointments by status (upcoming, completed, all)
- Join video calls initiated by doctors
- View and download prescriptions
- Registration and login
- View and update professional profile
- Delete account
- Manage appointments
- Filter appointments by status (upcoming, completed, all)
- Initiate video calls with patients
- Write and manage prescriptions
- View patient history and details
- Secure authentication
- Profile management
- Real-time validation
- Responsive UI design
- Smart appointment management that hides completed appointments by default
- Video consultation capabilities
cd Backend
sqlc generate
migrate create -ext sql -dir db/migration -seq add_new_feature
The backend includes CORS configuration to allow requests from the frontend. In the development environment, all origins are allowed, but in production, this should be restricted to your domain.
The application uses PASETO tokens for authentication. When a user logs in, they receive an access token that must be included in the Authorization header for protected endpoints.
The frontend communicates with the backend through the API utilities in src/utils/api.js
. This provides a consistent interface for all API calls and handles authentication tokens automatically.
The platform implements a structured video consultation workflow:
-
Appointment Booking: Patients book appointments with doctors, specifying whether they prefer online or in-person consultation.
-
Doctor-Initiated Calls: Only doctors can initiate video calls for online appointments. This ensures consultations happen at scheduled times and prevents unauthorized access.
-
Patient Join: Once a doctor initiates a call, the patient's dashboard updates to show an active "Join Video Call" button. Before this, patients see a disabled "Waiting for Doctor" button.
-
Completed Appointments: After consultation, appointments are marked as "completed" and automatically filtered out from the default dashboard view. Users can still access completed appointments through the status filter.
-
Post-Consultation: Doctors can write prescriptions for completed appointments, which patients can view and download from their dashboard.
This workflow ensures a clear process for telehealth consultations while maintaining security and proper medical protocols.