Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
/ telecare Public archive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Telecare System

Python FastAPI SQLAlchemy Vanilla JS

A real-time telecare system designed to connect patients with medical operators through an agile workflow and an intuitive, modern interface. Built with performance and security in mind.

✨ Core Features

  • Real-Time Communication: Instant assistance requests and status updates powered by WebSockets. No page reloads required.
  • Secure Role Management: Three deeply segregated authorization levels with dedicated dashboards: Technicians (Admin), Operators, and Patients.
  • Comprehensive Audit Trail: All critical actions (creation, editing, deletion of users and requests) are logged in real-time for security auditing.
  • Modern UI/UX: Responsive design with glassmorphism aesthetics, dark mode support, and smooth micro-animations.

πŸ› οΈ Tech Stack

  • Backend: FastAPI (Python)
  • Database: SQLite (Development) / PostgreSQL Ready (Production)
  • ORM: SQLAlchemy 2.0
  • Frontend: Jinja2 Templates, Vanilla JavaScript, CSS3 variables
  • Security: CSRF Protection, Bcrypt Password Hashing, SlowAPI (Rate Limiting)

πŸ“‚ Project Structure

telecare/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py          # FastAPI application, routing, and WebSockets
β”‚   β”œβ”€β”€ models.py        # SQLAlchemy database schemas
β”‚   β”œβ”€β”€ config.py        # Environment variables and secrets
β”‚   β”œβ”€β”€ auth.py          # Hashing, CSRF generation, and session validation
β”‚   β”œβ”€β”€ db.py            # Database engine and sessionmaker
β”‚   β”œβ”€β”€ init_db.py       # Script to initialize tables
β”‚   β”œβ”€β”€ templates/       # Jinja2 HTML views
β”‚   └── static/          # CSS stylesheets and SVG assets
β”œβ”€β”€ run.py               # Uvicorn server launcher
└── requirements.txt     # Python dependencies

πŸš€ Installation

1. Prerequisites

Ensure you have Python 3.9+ installed on your system.

2. Setup Environment

Clone the repository and set up an isolated environment:

# Create virtual environment
python -m venv venv

# Activate it (Windows)
.\venv\Scripts\activate
# Activate it (Linux/Mac)
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

βš™οΈ Configuration & Initialization

STOP: Do not skip this section. You must configure your application secrets before initializing the database or starting the server.

Step 1: Configure Secrets & Database

CRITICAL: You must manually edit the app/config.py file before doing anything else. Scroll down to the ⚠️ PRODUCTION CONFIGURATION ⚠️ section of the file. Running the application with the default configuration will leave your system completely vulnerable.

Open app/config.py in your code editor and change the following values:

Security & Sessions:

  • SECRET_KEY: Change this to a long, random string. It is used to encrypt session cookies.
  • USE_HTTPS: Set this to True if you are deploying to a production server with an SSL certificate (HTTPS).

Database (PostgreSQL Migration):

  • DATABASE_URL: By default, this is set to use SQLite (sqlite:///./teleassist.db). For production, it is highly recommended to migrate to PostgreSQL. Simply change this string to your PostgreSQL connection URL (e.g., postgresql://username:password@localhost:5432/telecare_db). Note: The PostgreSQL driver (psycopg2-binary) is already included.

First-Time Admin:

  • TECHNICIAN_EMAIL: Your admin email to log into the Technician Dashboard.
  • TECHNICIAN_PASSWORD: Your admin password.

Step 2: Initialize Database

Once you have saved your changes in app/config.py, initialize the database schemas by running:

python -m app.init_db

πŸ’» Usage

  • Run the Server: Start the application by executing python run.py in your terminal.
  • Access the App: Open your web browser and navigate to http://127.0.0.1:8000.
  • First Steps: Log in to /technician/login with your configured credentials to start registering Operators and Patients.

πŸ“Έ Visual Overview

Telecare: Landing Page

Landing page of the Telecare platform. Navbar with logo and three role-based login entries (Technician, Operator, Patient). Hero section featuring the headline "Operational assistance, delivered in real time," supporting subtext, "Get Started"/"Explore Features" CTAs, and a dashboard preview mockup.

Telecare: Landing Page

Telecare: Technician Login

Technician Login screen for the Telecare admin role. Centered card with gear icon, email and password fields, and a "Login" call-to-action button, keeping the same navbar with role-based access shortcuts.

Telecare: Technician Login

Telecare: Technician Dashboard

Technician Dashboard with key metrics (requests today, pending requests, avg. response time), a 7-day requests trend chart, a requests-by-shift donut chart, and operator management tools: create new operator form, searchable operators table with edit/delete actions, and CSV export.

Telecare: Technician Dashboard

Telecare: Operator & Patient Management

User management section of the Technician Dashboard. Includes a "Create New Operator" form with shift assignment, a paginated, searchable Registered Operators table, plus a "Create New Patient" form and a Registered Patients table with Edit, Profile, and Delete actions.

Telecare: Operator & Patient Management

Telecare: Assistance History

Assistance History table logging every patient request: ID, patient, operator, status, observations, and timestamp, with searchable/paginated records, "View" detail links, Edit/Delete actions, and CSV export. Bottom preview of the Security Audit Logs section.

Telecare: Assistance History

Telecare: Security Audit Logs

Security Audit Logs panel tracking system activity in real time: timestamp, IP address, user, action type (login/logout), and event details. Filterable by action, searchable, paginated, and exportable to CSV for full traceability.

Telecare: Security Audit Logs

Telecare: Operator Dashboard

Operator Dashboard showing real-time shift status: unassigned emergencies, longest unassigned wait time, and requests handled today. Live "Incoming Help Requests" table with patient, status, assignment, and action columns, plus a notification volume control for instant alert awareness.

Telecare: Operator Dashboard

Telecare: Patient Dashboard

Patient Dashboard with a one-click "Request Assistance Now" emergency button, live status indicator ("Safe / Idle"), and a searchable, paginated Request History table showing each request's ID, status, creation, and last-updated timestamps.

Telecare: Patient Dashboard

Telecare: Active Emergency Request

Patient Dashboard right after submitting an emergency request. Current Status updates instantly to "REQUESTED" with a timestamp, while Request History logs the new entry (#123) alongside prior resolved requests, demonstrating the platform's real-time responsiveness.

Telecare: Active Emergency Request

Telecare: Live Emergency Alert

Operator Dashboard receiving the patient's request in real time via WebSockets: a warning icon and updated "Unassigned Emergencies" counter appear instantly, with wait time tracking and a one-click "Acknowledge" action to claim the incoming request.

Telecare: Live Emergency Alert

Telecare: Resolve Request Modal

"Resolve Request" modal giving operators full patient context at a glance: name, age/blood type, allergies, conditions, medications, emergency contact, and a live elapsed-time counter. Operators select patient condition (Stable/Observation/Critical), choose an action taken, add optional notes, and save to close the case.

Telecare: Resolve Request Modal

License

GPL v3 β€” see LICENSE

About

A real-time telecare system built with FastAPI and WebSockets to securely connect patients with medical operators.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages