Skip to content

About

Production-deployed MERN healthcare platform with role-based access, appointment scheduling, Razorpay payments, Docker, CI/CD, AWS EC2, Nginx, and HTTPS.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Prescripto

React 19 Node.js 22 Express.js MongoDB

Docker GitHub Actions AWS EC2 Nginx HTTPS

Production-grade healthcare appointment platform built with the MERN stack and deployed with a complete Docker + AWS + CI/CD workflow.

Live Application β€’ Admin Panel β€’ Source Code


πŸ“Œ Overview

Prescripto is a full-stack healthcare appointment platform connecting patients, doctors, and administrators through role-based workflows.

Patients can discover doctors, view profiles, manage their accounts, book appointments, and make online payments. Doctors can manage availability and appointments. Administrators can manage doctors, appointments, and platform activity.

The project goes beyond a typical MERN application: it is containerized, continuously built, published to GitHub Container Registry, deployed to AWS EC2, served through Nginx, secured with HTTPS, and operated with a SHA-based release workflow.

Production URL: https://prescripto.shop/


✨ Features

πŸ‘€ Patient

  • User registration and authentication
  • Browse doctors by specialty
  • View doctor profiles
  • Appointment booking
  • Appointment management
  • Profile management
  • Online appointment payments with Razorpay
  • Protected user workflows

πŸ‘¨β€βš•οΈ Doctor

  • Secure doctor authentication
  • Doctor dashboard
  • Appointment statistics
  • Earnings information
  • View and manage appointments
  • Complete or cancel appointments
  • Availability management
  • Profile management

πŸ›‘οΈ Admin

  • Secure admin authentication
  • Platform dashboard
  • Dashboard analytics
  • Add doctors
  • Manage doctors
  • Manage appointments
  • Monitor platform activity

πŸ’³ Payments

  • Razorpay order creation
  • Browser-side Razorpay Checkout initialization
  • Payment response handling
  • Backend payment verification
  • Production payment flow

πŸ–ΌοΈ Media

  • Multipart file uploads with Multer
  • Cloudinary-based media storage

πŸ—οΈ Architecture

                             Internet
                                β”‚
                                β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚   prescripto.shop   β”‚
                     β”‚     HTTPS / TLS     β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚    Nginx    β”‚
                         β”‚ Reverse     β”‚
                         β”‚ Proxy       β”‚
                         β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚                 β”‚                 β”‚
              β–Ό                 β–Ό                 β–Ό
             /               /admin/            /api/
              β”‚                 β”‚                 β”‚
              β–Ό                 β–Ό                 β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Frontend  β”‚     β”‚   Admin   β”‚     β”‚  Backend  β”‚
        β”‚  :5173    β”‚     β”‚   :5174   β”‚     β”‚   :4000   β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                                                  β”‚
                                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                      β–Ό                       β–Ό
                                  MongoDB                 Razorpay

Production request routing

Route Destination
/ Frontend β†’ 127.0.0.1:5173
/admin/ Admin β†’ 127.0.0.1:5174
/api/ Backend β†’ 127.0.0.1:4000

The application ports are bound to localhost. Nginx is the public entry point.


πŸš€ Production Deployment

Prescripto currently runs on:

  • AWS EC2
  • Amazon Linux 2023
  • Docker + Docker Compose
  • Nginx
  • Let's Encrypt / Certbot
  • GitHub Actions
  • GitHub Container Registry (GHCR)
  • Custom domain: prescripto.shop

Production topology

GitHub
   β”‚
   β”‚ push to main
   β–Ό
GitHub Actions
   β”‚
   β”œβ”€β”€ Install dependencies
   β”œβ”€β”€ Lint
   β”œβ”€β”€ Build frontend
   β”œβ”€β”€ Build admin
   β”œβ”€β”€ Build Docker images
   └── Push images to GHCR
             β”‚
             β–Ό
        SSH to EC2
             β”‚
             β–Ό
        deploy.sh
             β”‚
             β”œβ”€β”€ Pull latest main
             β”œβ”€β”€ Set IMAGE_TAG
             β”œβ”€β”€ docker compose pull
             β”œβ”€β”€ docker compose up -d
             β”œβ”€β”€ Prune unused images
             └── Health check

🐳 Docker

The production application consists of three containers:

prescripto-backend
prescripto-frontend
prescripto-admin

Production port mappings:

Backend   127.0.0.1:4000 β†’ container:4000
Frontend  127.0.0.1:5173 β†’ container:4173
Admin     127.0.0.1:5174 β†’ container:4173

The frontend and admin applications are built with Vite and served with Vite Preview inside their containers.

SHA-based images

Images are tagged with the Git commit SHA instead of relying only on latest:

ghcr.io/vishwak-tech/prescripto-backend:<commit-sha>
ghcr.io/vishwak-tech/prescripto-frontend:<commit-sha>
ghcr.io/vishwak-tech/prescripto-admin:<commit-sha>

This provides traceable releases and supports deterministic rollback.


πŸ”„ CI/CD

Every push to main triggers the production workflow.

git push
   β”‚
   β–Ό
Checkout
   β”‚
   β–Ό
Install dependencies
   β”‚
   β–Ό
Lint
   β”‚
   β–Ό
Build frontend + admin
   β”‚
   β–Ό
Docker build
   β”‚
   β–Ό
Push images to GHCR
   β”‚
   β–Ό
SSH to EC2
   β”‚
   β–Ό
Deploy with deploy.sh
   β”‚
   β–Ό
Health check
   β”‚
   β–Ό
Production

GitHub Actions responsibilities

  • Checkout source
  • Set up Node.js
  • Run npm ci
  • Lint frontend
  • Lint admin
  • Build frontend
  • Build admin
  • Authenticate to GHCR
  • Build backend/frontend/admin images
  • Push SHA-tagged images
  • Deploy the selected release to EC2

Deployment safety

The deployment script uses:

set -e

so a failed command stops the deployment sequence.

A post-deployment health check verifies that the application is reachable through Nginx.


πŸ” Security

Network exposure

Only the intended public entry points are exposed:

22   β†’ SSH
80   β†’ HTTP
443  β†’ HTTPS

Application services remain bound to localhost:

127.0.0.1:4000
127.0.0.1:5173
127.0.0.1:5174

SSH

Production access uses SSH key authentication.

Configured SSH hardening includes:

PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes

Secrets

Production backend secrets are stored outside Git in:

backend/.env

The production file uses restrictive permissions:

-rw-------

Do not commit .env files or private credentials.

Frontend environment variables

The Razorpay Key ID is a public client-side configuration value required by Razorpay Checkout.

The Razorpay Key Secret must never be exposed in frontend code or a VITE_* variable. It belongs on the backend/server side.


πŸ’³ Razorpay Payment Flow

Patient
   β”‚
   β–Ό
Request appointment payment
   β”‚
   β–Ό
Backend creates Razorpay order
   β”‚
   β–Ό
Frontend receives order
   β”‚
   β–Ό
Razorpay Checkout opens
   β”‚
   β–Ό
Payment completed
   β”‚
   β–Ό
Frontend receives payment response
   β”‚
   β–Ό
Backend verifies payment
   β”‚
   β–Ό
Appointment/payment state updated

The production payment flow has been tested successfully.


🌐 DNS + HTTPS

Production domain:

https://prescripto.shop/

DNS:

A      @      β†’ EC2 public IP
CNAME  www    β†’ prescripto.shop

HTTP traffic is redirected to HTTPS.

TLS

HTTPS is provided using Let's Encrypt and Certbot.

The certificate covers:

prescripto.shop
www.prescripto.shop

Automatic renewal is enabled through the Certbot systemd timer.

Validation commands:

sudo nginx -t
sudo certbot certificates
sudo certbot renew --dry-run

πŸ“‚ Repository Structure

prescripto/
β”œβ”€β”€ frontend/                 # Patient-facing React application
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”‚
β”œβ”€β”€ admin/                    # Admin React application
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/                  # Express REST API
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”‚
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml       # CI/CD pipeline
β”‚
β”œβ”€β”€ docker-compose.yml       # Production service definitions
β”œβ”€β”€ README.md
└── .gitignore

The exact folder structure may evolve as the application grows.


πŸ› οΈ Tech Stack

Layer Technology
Frontend React 19, Vite, Tailwind CSS, Axios
Admin React, Vite, Tailwind CSS
Backend Node.js, Express.js
Database MongoDB, Mongoose
Authentication JWT, bcrypt
File Uploads Multer
Media Storage Cloudinary
Payments Razorpay
Containers Docker, Docker Compose
CI/CD GitHub Actions
Registry GitHub Container Registry
Cloud AWS EC2
Reverse Proxy Nginx
DNS Hostinger DNS
TLS Let's Encrypt / Certbot

πŸ’» Local Development

Prerequisites

Install:

  • Node.js
  • npm
  • Git
  • MongoDB or access to a MongoDB deployment
  • Cloudinary account
  • Razorpay account if payment functionality is required

1. Clone

git clone https://github.com/Vishwak-Tech/prescripto.git
cd prescripto

2. Backend

cd backend
npm install

Create backend/.env with the variables required by the backend configuration, for example:

MONGODB_URI=
JWT_SECRET=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=

Use the variable names expected by the current backend code. Never commit real values.

Start the backend using the project's configured development command, for example:

npm run server

3. Frontend

cd frontend
npm install

Create:

frontend/.env

Example:

VITE_BACKEND_URL=http://localhost:4000
VITE_RAZORPAY_KEY_ID=

Start:

npm run dev

4. Admin

cd admin
npm install

Create:

admin/.env

Example:

VITE_BACKEND_URL=http://localhost:4000

Start:

npm run dev

πŸ§ͺ Testing

Automated testing is the next planned improvement for Prescripto.

The intended testing strategy is:

Unit Tests
    ↓
Component Tests
    ↓
API / Integration Tests
    ↓
End-to-End Tests
    ↓
CI
    ↓
Build
    ↓
Docker
    ↓
Deploy

Planned coverage

Frontend

  • React Testing Library
  • User interactions
  • Forms and validation
  • Protected UI states
  • Critical appointment flows

Backend

  • API integration tests
  • Authentication/authorization
  • Appointment endpoints
  • Doctor endpoints
  • Payment verification

End-to-End

  • Patient login
  • Doctor discovery
  • Appointment booking
  • Payment flow
  • Admin workflows

Deployment principle

Tests should pass before a production deployment is allowed.


πŸ“Š Production Verification

The production system has been audited after deployment.

Application

https://prescripto.shop/                    β†’ 200 OK
https://prescripto.shop/admin/              β†’ 200 OK
https://prescripto.shop/api/admin/dashboard β†’ 200 OK

Containers

All three services were verified running:

Backend
Frontend
Admin

Backend logs

Verified:

Server Is Running on PORT 4000
Database Connected

Nginx

Verified:

systemctl status nginx
nginx -t

TLS

Verified:

  • Valid certificate
  • prescripto.shop
  • www.prescripto.shop
  • Automatic renewal timer enabled
  • Renewal dry-run completed successfully

Security

Verified:

  • Application ports bound to localhost
  • SSH key authentication
  • Root SSH login disabled
  • Password SSH authentication disabled
  • Backend .env protected with restrictive permissions

Resources

Current single-server deployment is intentionally lightweight.

The production audit identified:

  • CPU load: low
  • RAM: limited by the t3.micro size
  • Disk: monitor growth as Docker images/logs accumulate

πŸ” Rollback Strategy

Every release is identified by its Git commit SHA.

Example:

Release A β†’ 77fc010...
Release B β†’ 2fcf70b...
Release C β†’ 8031091...
Release D β†’ 9f201d7...
Release E β†’ 3b0e6bf...

If a future release causes a production issue, a verified previous SHA can be redeployed:

cd ~/prescripto
./deploy.sh <KNOWN_GOOD_COMMIT_SHA>

The deployment script then pulls the corresponding images and recreates the services.

Why SHA-based releases?

Using:

image:<commit-sha>

instead of only:

image:latest

makes releases:

  • Traceable
  • Auditable
  • Easier to debug
  • Easier to roll back

πŸ”§ Production Troubleshooting

Check containers

docker ps

Check Compose

cd ~/prescripto
docker compose ps

Backend logs

docker compose logs --tail=50 backend

Frontend logs

docker compose logs --tail=30 frontend

Admin logs

docker compose logs --tail=30 admin

Nginx

sudo systemctl status nginx --no-pager
sudo nginx -t

Ports

sudo ss -tulpn

Memory

free -h

Disk

df -h

Load

uptime

Certificate

sudo certbot certificates

πŸ—ΊοΈ Roadmap

Completed

  • MERN full-stack application
  • Patient workflows
  • Doctor workflows
  • Admin dashboard
  • JWT authentication
  • Role-based authorization
  • Appointment scheduling
  • Razorpay payments
  • Cloudinary media
  • Dockerization
  • Docker Compose
  • AWS EC2 deployment
  • Nginx reverse proxy
  • Custom domain
  • HTTPS / TLS
  • GitHub Actions CI/CD
  • GHCR image registry
  • SHA-based releases
  • Production security hardening
  • Production troubleshooting
  • Rollback strategy

Next

  • Unit testing
  • React Testing Library coverage
  • Backend integration/API tests
  • End-to-end testing
  • Test-gated CI/CD
  • Infrastructure as Code with Terraform
  • Better production observability
  • Automated alerting
  • Database backup/recovery strategy
  • Advanced AWS architecture
  • Horizontal scaling when required

🀝 Contributing

Contributions are welcome.

1. Fork the repository

2. Create a branch

git checkout -b feature/your-feature

3. Make and test your changes

4. Commit

git add .
git commit -m "feat: describe your change"

5. Push

git push origin feature/your-feature

6. Open a Pull Request

Keep pull requests focused and explain the motivation and impact of the change.


πŸ‘¨β€πŸ’» Author

Vishwak Koleti

Full Stack Developer | Backend | DevOps | AI


⭐ Project Highlights

Prescripto represents an end-to-end engineering workflow:

                    DEVELOPMENT
                         β”‚
                         β–Ό
                       Git
                         β”‚
                         β–Ό
                      GitHub
                         β”‚
                         β–Ό
                 GitHub Actions
                  CI / Build
                         β”‚
                         β–Ό
                       Docker
                         β”‚
                         β–Ό
                       GHCR
                         β”‚
                         β–Ό
                     AWS EC2
                         β”‚
                         β–Ό
                       Nginx
                         β”‚
                         β–Ό
                    HTTPS / TLS
                         β”‚
                         β–Ό
                  prescripto.shop

Built not only to demonstrate full-stack development, but to demonstrate how a real application can be packaged, deployed, secured, automated, verified, and operated in production.


Built with ❀️ by Vishwak Koleti

About

Production-deployed MERN healthcare platform with role-based access, appointment scheduling, Razorpay payments, Docker, CI/CD, AWS EC2, Nginx, and HTTPS.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages