Skip to content

Chinonye1/Borderless-app-server

Repository files navigation

Borderless Health — API

The backend for Borderless Health, a cross-border telemedicine platform. Built with Express and MongoDB (Mongoose), with JWT auth and Cloudinary for image/document uploads.

🔗 Client repo / demo: https://borderless-app-client.vercel.app/

Features

  • Auth — register (patient / physician), login, and a /auth/me endpoint that returns the user and their profile.
  • Users — patient and physician profiles with image (and document, for patients) uploads via Cloudinary.
  • Departments — CRUD-ish endpoints with images, specialties, and reviews.
  • Reviews — patients review departments (rating + comment).
  • Connections — patient ↔ physician consultation requests with accept / decline.

Tech stack

  • Express + Mongoose (MongoDB)
  • JWT (jsonwebtoken) + bcrypt for auth
  • Multer + Cloudinary for file uploads
  • CORS, morgan

Getting started

Prerequisites

  • Node.js 18+
  • A MongoDB database (local or Atlas)
  • A Cloudinary account (for uploads)

Setup

npm install

Create a .env file in the project root:

PORT=5005
ORIGIN=http://localhost:5173          # client URL, for CORS
MONGODB_URI=mongodb://127.0.0.1:27017/borderless
TOKEN_SECRET=your-jwt-secret
CLOUDINARY_NAME=your-cloud-name
CLOUDINARY_KEY=your-api-key
CLOUDINARY_SECRET=your-api-secret

Run

npm run dev     # start with --watch (auto-restart on changes)
npm start       # start normally

Server runs at http://localhost:5005, with all routes mounted under /api.

API overview

Method Endpoint Notes
POST /api/auth/login returns { authToken }
GET /api/auth/me current user + profile (auth)
POST /api/users/patient register patient (multipart)
POST /api/users/physician register physician (multipart)
GET /api/users/physicians list/filter physicians (auth)
GET /api/users/patients list patients (physician only)
GET/POST /api/departments /api/department list / create departments
PATCH /api/department/:id update a department (auth)
GET/POST /api/reviews list / create reviews
GET/POST/PATCH /api/connections manage connection requests (auth)

Protected routes expect an Authorization: Bearer <token> header.

Notes

  • GET /departments and GET /reviews are public so the client can show them before login.
  • The ORIGIN value must match the deployed/local client URL, or requests are blocked by CORS.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors