Skip to content

Repository files navigation

TebbiPlus Web

The React and TypeScript client for TebbiPlus, a medical appointment platform with dedicated experiences for patients, doctors, clinic administrators, and system administrators.

Backend repository

Features

Patients

  • Register, sign in, and maintain an authenticated session
  • Browse specialties and filter doctors
  • View doctor details and available appointment slots
  • Book, review, and cancel appointments
  • Maintain profile and medical information

Doctors

  • Complete and update a professional profile with image upload
  • Configure specialties, fees, biography, and availability
  • Review today's and upcoming appointments
  • Update appointment statuses and view patient history

Administrators

  • View platform and clinic dashboard information
  • Manage users and account status
  • Manage specialties and doctor records
  • Review appointments across the platform

Shared Experience

  • Role-protected routes and layouts
  • Access-token injection and refresh-token request queue
  • Centralized API endpoint adapters
  • Redux Toolkit domain slices
  • Lazy-loaded route pages
  • Responsive Material UI components, data tables, forms, dialogs, and feedback states

Tech Stack

  • React 19
  • TypeScript
  • Vite 7
  • React Router 7
  • Redux Toolkit and React Redux
  • Material UI and Emotion
  • Axios
  • Day.js

Getting Started

Prerequisites

Installation

git clone https://github.com/TabibPlus/Frontend.git
cd Frontend
npm install

Create .env.local and point the client at the backend's /api root:

VITE_API_BASE_URL=http://localhost:5000/api

When the variable is omitted, the client defaults to http://localhost:5000/api.

Start the development server:

npm run dev

Scripts

Command Description
npm run dev Start the Vite development server
npm run build Type-check and create a production bundle
npm run lint Run ESLint
npm run preview Preview the production build

Application Structure

src/
├── app/                 # Typed Redux hooks and store
├── components/common/   # Reusable cards, forms, tables, modals, and feedback
├── features/
│   ├── admin/           # Platform administration
│   ├── auth/            # Login, registration, route protection
│   ├── clinic/          # Clinic dashboard and doctor management
│   ├── doctor/          # Doctor profile and appointment workflows
│   ├── patient/         # Discovery, booking, appointments, profile
│   └── snackbar/        # Global feedback state
├── layouts/             # Role-specific navigation shells
├── models/              # API-facing TypeScript models
├── routes/              # Lazy-loaded route tree
├── services/api/        # Axios instances and endpoint functions
└── theme/               # Material UI theme

Authentication Flow

  1. Login or registration returns an access token, refresh token, and user.
  2. The client stores session data in local storage.
  3. Axios attaches the access token to API requests.
  4. A 401 response triggers one refresh request while other failed requests wait in a queue.
  5. Successful refresh retries the original requests; refresh failure clears the session and returns to login.

Role-aware route guards direct each account to its patient, doctor, clinic, or administrator workspace.

Backend Integration

API calls are centralized in src/services/api/endpoints.ts. The client currently integrates these main groups:

  • /users for identity and session actions
  • /doctors for profiles, specialties, discovery, and schedules
  • /appointments for booking and status management
  • /patients for patient profile and history
  • /admin for users, specialties, appointments, and dashboard data

File uploads use a separate multipart Axios instance with the same authorization behavior.

Production Build

npm run build
npm run preview

Configure VITE_API_BASE_URL in the deployment environment before building. Since this is a single-page application, configure the host to route unknown paths back to index.html.

License

No license file is currently included in this repository.

About

React and TypeScript client for a role-based medical appointment platform, with patient, doctor, and admin dashboards and booking workflows.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages