Categorygithub.com/PragaL15/med_admin_backend
modulepackage
0.0.0-20250215055647-15c03a6ad1b1
Repository: https://github.com/pragal15/med_admin_backend.git
Documentation: pkg.go.dev

# README

šŸ„ Medical Record Backend - Secure API with JWT & Role-Based Authentication šŸš€


🌟 Key Features

āœ… JWT Authentication - Secure login and token-based access control šŸ”‘
āœ… Role-Based Access (RBAC) - API access controlled by user roles (Admin, Doctor, Patient) šŸ›‚
āœ… Secure API Endpoints - Restricted access to medical records based on role šŸ›”ļø
āœ… Complete CRUD Operations - Supports GET, POST, PUT, DELETE, and UPDATE methods šŸ”„
āœ… Doctor-Patient Interaction Tracking - Stores records of conversations securely šŸ“œ
āœ… Scalable & Optimized - Built with Go (Golang) and Fiber for high performance ⚔


šŸ› ļø Tech Stack

  • šŸš€ Golang - High-performance backend
  • ⚔ Fiber - Lightweight & fast web framework
  • šŸ—„ļø PostgreSQL - Reliable database
  • šŸ” JWT Authentication - Secure API access
  • šŸ›‚ Role-Based Access Control (RBAC) - Fine-grained permissions
  • šŸ“” Docker (Future Scope) - Containerized deployment

šŸš€ How to Set Up Locally

šŸ”¹ Prerequisites

1ļøāƒ£ Install Go (v1.19+) šŸ› ļø
2ļøāƒ£ Install PostgreSQL - PostgreSQL v.16šŸ—„ļø
3ļøāƒ£ Clone the repository

git clone https://github.com/PragaL15/med_admin_backend

4ļøāƒ£ Install dependencies šŸ“¦

go mod tidy
go get import_file_name

5ļøāƒ£ Create a .env file for environment variables šŸŒ

PORT=4000
DB_HOST=localhost
DB_USER=your_username
DB_PASSWORD=your_password
DB_NAME=medical_db
JWT_SECRET=your_secret_key

6ļøāƒ£ Run the server šŸš€

go run main.go

Now, the backend is running on http://localhost:4000 šŸŽ‰


šŸ“Œ Project Structure

medical_record/
│── handlers/        # API handlers (Patients, Doctors, Conversations)
│── middleware/      # JWT Authentication & Role-Based Access Control
│── routes/          # API Route definitions
│── db/              # Database connection setup
│── models/          # Database models & schemas
│── main.go          # Main entry point of the server
│── go.mod           # Go module dependencies
│── .env             # Environment variables (Port, DB config, JWT secret)

šŸ”‘ Authentication & Role-Based Access

šŸ‘„ User Roles

  • Admin šŸ›ļø - Full access to all APIs (Manage doctors, patients, and records)
  • Doctor 🩺 - Can fetch and update patient details, add medical records
  • Patient šŸ§‘ā€āš•ļø - Can only view their own records

šŸ”’ Secured API Paths

RoleAccessible EndpointsMethods
Admin šŸ›ļø/users /patients /doctors /recordsGET, POST, PUT, DELETE
Doctor 🩺/patients /recordsGET, POST, UPDATE
Patient šŸ§‘ā€āš•ļø/records/{patient_id}GET

šŸš€ JWT Authentication is required for all API calls. Every request must include a valid token in the header:

Authorization: Bearer <your-jwt-token>

šŸ”„ Upcoming Features

  • Audit Logs - Track changes to medical records šŸ“Š
  • Two-Factor Authentication (2FA) - Extra layer of security šŸ”
  • Email & SMS Notifications - Appointment reminders šŸ“©
  • Docker & Kubernetes Deployment - Scalable containerized setup 🐳

šŸ‘Øā€šŸ’» Contributors

šŸ’” Pragalya Kanakaraj - Backend Developer šŸš€


šŸ“ License

šŸ“œ MIT License - Use it freely, modify it responsibly!

# Packages

No description provided by the author
No description provided by the author