This is a full-stack Patient Management Application developed using React (frontend) and Node.js with Express and SQLite (backend). It allows users to manage patient records, including adding, editing, deleting, and viewing patient details.

- Frontend: React, TypeScript, Material UI
- Backend: Node.js, Express.js, Axios, MySQL
- Database: SQLite
- Testing: Jest, React Testing Library
- Tools: Docker, Postman (for API testing)
components: Reusable UI components.services: Axios services for API interaction.types: TypeScript interfaces.tests: Automated test cases using Jest.
index.js: Main server entry point.controllers: Logic for handling CRUD operations.routes: API route definitions.database: SQLite database configuration.
Ensure you have the following installed:
- Node.js (v18+)
- SQLite3
- npm (v9+)
Git clone- Install dependencies:
npm install npm start
The app will be available at http://localhost:3000.
-
Navigate to the backend directory:
cd patients-backend -
Install dependencies:
npm install -
Create a
.envfile and configure the database path and server port:
PORT=5000
DB_PATH=./database.db
-
Start the backend server:
node server.js -
The backend server will run at
http://localhost:5000.
The backend uses SQLite, a lightweight database. If the database file (patients.db) does not already exist, it will be created automatically when you run the project.
Manual Database Creation: If you need to manually create the database, you can use the following schema:
-- Create the patients table CREATE TABLE patients ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, dob TEXT NOT NULL, condition TEXT NOT NULL, appointment_date TEXT NOT NULL );
-- Create the appointments table with a foreign key reference CREATE TABLE appointments ( id INTEGER PRIMARY KEY AUTOINCREMENT, patient_id INTEGER, appointment_date TEXT NOT NULL, details TEXT, FOREIGN KEY(patient_id) REFERENCES patients(id) );
Open http://localhost:3000 in your browser
Patients:
GET /api/patients - Fetch all patients.
GET /api/patients/:id - Fetch a specific patient by ID.
POST /api/patients - Add a new patient.
PUT /api/patients/:id - Update a patient by ID.
DELETE /api/patients/:id - Delete a patient by ID.
Appointments:
GET /api/appointments - Fetch all appointments.
POST /api/appointments - Create a new appointment.
DELETE /api/appointments/:id - Delete an appointment by ID.
Run npm test -- --watchAll