Welcome to the backend repository of our Electronic Health Record (EHR) application. This backend component serves as the server-side logic and database management system for the EHR application.
This backend repository houses the server-side codebase responsible for handling authentication, managing user data, and serving API endpoints to the frontend application.
- User Authentication: Secure authentication system using Google OAuth and OTP verification with Amazon SES.
- Role-based Access Control: Different access levels for hospital administrators, patients, and doctors.
- Database Management: Storage and management of patient records, treatment details, and medical history.
- RESTful API: Provides endpoints for CRUD operations on user data, medical records, and other application entities.
- File Storage Bucket: Secure storage for saving records such as X-rays, scans, and other medical documents.
- Integration with Frontend: Seamless integration with the frontend application for a complete EHR solution.
- Node.js: JavaScript runtime for building server-side applications.
- Express.js: Minimalist web framework for building RESTful APIs.
- TypeScript (TS): Typed superset of JavaScript for improved code quality and developer experience.
- PostgreSQL: Relational database for storing application data.
- Superbase: Hosted PostgreSQL database with built-in authentication and real-time capabilities.
- Passport.js: Authentication middleware for Node.js applications, used for Google OAuth integration.
- JSON Web Tokens (JWT): Used for authentication and authorization of API requests.
To set up the backend locally, follow these steps:
- Clone this repository to your local machine.
- Install dependencies using
npm install. - Create a PostgreSQL database instance, either locally or using a cloud service like Superbase.
- Set up environment variables in a
.envfile with the following details:PORT=6969 DB_USER=<database-username> DB_PASS=<database-password> DB_NAME=<database-name> DB_HOST=<database-host> TEST_MSG=:bitspace DOCTOR_SECRET=<doctor-secret> HOSPITAL_SECRET=<hospital-secret> PATIENT_SECRET=<patient-secret> SECURE=f ACCESS_KEY=<aws-access-key> SECRET_ACCESS_KEY=<aws-secret-access-key> REGION=<aws-region> VERIFIED_EMAIL=<verified-email> PY_URL=<python-api-url> - Build the server (for typescript) using
npm run build. - Run the server using
npm run devfor development mode. - Access the API endpoints at
http://localhost:3000or the specified port.
Contributions to the development and enhancement of this backend application are welcome! To contribute, please fork the repository, make your changes, and submit a pull request with descriptive comments.


