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.
- 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.
- 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)
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
Ensure you have Python 3.9+ installed on your system.
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.txtSTOP: Do not skip this section. You must configure your application secrets before initializing the database or starting the server.
CRITICAL: You must manually edit the
app/config.pyfile 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 toTrueif 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.
Once you have saved your changes in app/config.py, initialize the database schemas by running:
python -m app.init_db- Run the Server: Start the application by executing
python run.pyin your terminal. - Access the App: Open your web browser and navigate to
http://127.0.0.1:8000. - First Steps: Log in to
/technician/loginwith your configured credentials to start registering Operators and Patients.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
"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.
GPL v3 β see LICENSE









