The LafiaEMR Authentication Module is a core Frontend component of the LafiaEMR SaaS application designed to manage Electronic Medical Records (EMR) for hospitals. This module handles user authentication, including login, registration, password recovery, and user role management. Built with Next.js, Carbon Design System for React, and Yarn, it ensures a seamless and secure authentication process for healthcare professionals and administrators.
- Secure Authentication: Provides secure login and registration flows using modern encryption practices.
- Role-Based Access Control (RBAC): Manages access based on user roles (e.g., Admin, Doctor, Nurse, etc.).
- Password Recovery: Enables users to reset forgotten passwords securely.
- Responsive Design: Fully responsive UI built with the Carbon Design System.
- Multi-Tenant Support: Authentication tailored for hospitals with multi-tenant configurations.
- Frontend Framework: Next.js
- UI Components: Carbon Design System for React
- Package Manager: Yarn
To get started, clone the repository and install the dependencies.
git clone https://github.com/LafiaEMR/lafiacore-esm-auth-onboard.git
cd lafiacore-esm-auth-onboard
**Install dependencies:**
```bash
yarn installCreate a .env.local file in the root directory and add the following variables:
NEXT_PUBLIC_API_URL=http://localhost:3000/api
Adjust the values to match your API URL.
-
Run the development server:
yarn dev
Open http://localhost:3000 to view the application in your browser.
The application relies on several environment variables to connect to various services. Below are key configurations:
NEXT_PUBLIC_BASEURL: URL for API requests from the frontend.NEXT_PUBLIC_TL_DOMAIN: Top level domain (e.g .lafia.com).NEXT_PUBLIC_ADMIN_APP: URL for admin app.NEXT_PUBLIC_STAFF_APP: URL for staff app.
yarn dev: Runs the application in development mode.yarn build: Builds the application for production.yarn start: Starts the production build.yarn lint: Runs linter checks on the code.yarn format: Formats code according to project standards.
├── public # Public assets (images, icons, etc.)
├── src
│ ├── components # Reusable UI components
│ ├── app # Next.js pages
│ ├── styles # Tailwind CSS configuration
│ ├── helpers # Utility functions and helpers
└── README.md
To contribute to this Repo, please follow these steps:
- Clone the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.