https://github.com/developersajadur/doctor-tech-job-task
Doctor Tech is a full-stack web application for managing doctor appointments, built with Node.js, Express, MongoDB, and TypeScript. It allows patients to book appointments, doctors to manage their schedules, and admins to oversee the entire platform.
https://github.com/developersajadur/doctor-tech-job-task
expressjs javascript jwt mongodb mongoose nodejs typescript
Last synced: 26 days ago
JSON representation
Doctor Tech is a full-stack web application for managing doctor appointments, built with Node.js, Express, MongoDB, and TypeScript. It allows patients to book appointments, doctors to manage their schedules, and admins to oversee the entire platform.
- Host: GitHub
- URL: https://github.com/developersajadur/doctor-tech-job-task
- Owner: developersajadur
- Created: 2025-06-27T17:57:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-28T19:34:04.000Z (4 months ago)
- Last Synced: 2025-06-28T19:39:26.514Z (4 months ago)
- Topics: expressjs, javascript, jwt, mongodb, mongoose, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฉบ Doctor Tech โ Online Doctor Appointment Platform
Doctor Tech is a full-stack web application for managing doctor appointments, built with Node.js, Express, MongoDB, and TypeScript. It allows patients to book appointments, doctors to manage their schedules, and admins to oversee the entire platform.
## ๐ Links
- ๐ Live Site: Sorry, I can't provide for security issues
- ๐ GitHub Repository: [https://github.com/yourusername/doctor-tech]
- ๐ฌ Postman Collection: [https://github.com/developersajadur/Doctor-Tech-Job-Task/blob/main/doctor_tech_postman_collection]
## ๐ฆ Features
- ๐จโโ๏ธ Doctor registration, services, and time-slot availability
- ๐งโ๐ฆฑ Patient registration and appointment booking
- ๐
Calendar-based availability filtering
- ๐ง Email notifications on appointment status change
- ๐ก๏ธ Role-based access (Admin, Doctor, Patient)
- ๐ Admin dashboard with stats
- ๐ Secure authentication & authorization
- ๐งช Postman Collection for testing
## ๐ Tech Stack
**Backend:** Node.js, Express, TypeScript
**Database:** MongoDB with Mongoose
**Authentication:** JWT
**Email:** Nodemailer + Handlebars Templates
**Tools:** ESLint, Prettier, dotenv, Husky
## ๐ ๏ธ Local Setup
### 1. Clone the Repository
```bash
https://github.com/developersajadur/Doctor-Tech-Job-Task
cd Doctor-Tech-Job-Task
```
### 2. Install Dependencies
```bash
npm install
```
### 3. Configure Environment
#### Create .env file:
```bash
# Environment
NODE_ENV=development
PORT=5000
# MongoDB Connection
DATABASE_URL=your_mongodb_connection_string
# Bcrypt Salt
SALT_ROUNDS=12
# JWT Config
JWT_TOKEN_SECRET=your_jwt_secret_key
JWT_TOKEN_EXPIRES_IN=30d
# Default Admin Credentials
DEFAULT_ADMIN_EMAIL=admin@gmail.com
DEFAULT_ADMIN_PASSWORD=Admin@123
DEFAULT_ADMIN_PHONE=01000000000
# Email SMTP Credentials (Gmail)
EMAIL=your_email@gmail.com
APP_PASSWORD=your_app_specific_password
```
### 4. Start Development Server
```bash
npm run dev
```
### ๐งช API Testing
Import the Postman collection and set environment variables:
#### BASE_URL:
```bash
http://localhost:5000/api/v1/
```
### ๐ Sample Requests
### ๐ฑ Admin Setup
Seed default admin:
Method: POST
```bash
/seed-admin?secret=your_seed_secret
```
#### Register Doctor
Content-Type: application/json
Method: POST
```bash
/auth/register-doctor
```
```bash
{
"name": "Doctor pro",
"email": "doctorpro@gmail.com",
"phone": "01712345675",
"password": "DoctorPro@123",
"specialization": "Cardiology",
"hospitalName": "City Hospital",
"hospitalFloor": "3rd Floor"
}
```
#### Register Patient
Content-Type: application/json
Method: POST
```bash
/auth/register-patient
```
```bash
{
"name": "Patient pro",
"email": "patientpro@gmail.com",
"phone": "01898765462",
"password": "PatientPro@123",
"age": 18,
"gender": "male"
}
```
#### Create Service
Content-Type: application/json
Authorization: token (Doctor Token)
Method: POST
```bash
/doctor/services
```
```bash
{
"title": "Diabetes Consultation",
"description": "Consultation for diabetes treatment and management.",
"price": 1500,
"duration": 30
}
```
### Set Availability
Content-Type: application/json
Authorization: token (Doctor Token)
Method: POST
```bash
/availability/create-availability
```
```bash
{
"serviceId": "685f1a9d3a56063a2f956f3a",
"day": "Wednesday",
"timeSlots": [
{ "startTime": "10:00", "endTime": "12:00" },
{ "startTime": "16:00", "endTime": "18:00" }
]
}
```
### Book A Appointment
Content-Type: application/json
Authorization: token (Patient Token)
Method: POST
```bash
/appointments
```
```bash
{
"doctorId": "685f0c018c5f018b440b1615",
"serviceId": "685f1a9d3a56063a2f956f3a",
"selectedDate": "2025-07-06",
"timeSlotId": "685fffddfc319a0f427f54ae"
}
```