A platform to manage health teleconsultation, data on pregnant women, and AI-supported tools for health attendants.
- π Firebase Authentication (Email/Password)
- π¨ Modern UI with Tailwind CSS and shadcn/ui
- π± Responsive design with mobile sidebar
- π‘οΈ Permission-based access control (placeholder)
- π§ React Router for navigation
- π Dashboard with activity feed
- π Notification system ready
- β‘ Built with Vite for fast development
- Node.js (v18 or higher)
- npm or yarn
- Firebase project (for authentication)
-
Clone the repository
-
Install dependencies:
npm install
-
Set up Firebase:
- Create a Firebase project at https://console.firebase.google.com
- Enable Authentication with Email/Password
- Copy your Firebase config to
src/App.tsx
-
Start the development server:
npm run dev
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
src/
βββ components/
β βββ layout/
β β βββ MainLayout.tsx # Main application layout
β βββ ui/ # shadcn/ui components
βββ contexts/
β βββ AuthContext.tsx # Authentication context
βββ pages/
β βββ Dashboard.tsx # Dashboard page
β βββ LoginPage.tsx # Login/signup page
βββ lib/
β βββ utils.ts # Utility functions
βββ App.tsx # Main app component
βββ main.tsx # Entry point
βββ index.css # Global styles
- Complete permission management system
- More dashboard widgets
- User profile management
- Project management
- Message system
- Calendar integration
- File upload/management
- Settings page
- Dark mode toggle
- Frontend: React 18, TypeScript, Vite
- Styling: Tailwind CSS
- UI Components: shadcn/ui, Radix UI
- Authentication: Firebase Auth
- Routing: React Router v6
- Icons: Lucide React
- Build Tool: Vite
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.
The Encompass ePlatform is a modern, web-based application designed to streamline patient referrals, appointment scheduling, and administrative tasks within a healthcare network. It provides a centralized system for doctors, nurses, and administrative staff to manage patient information, track referrals, and coordinate care. The platform features a user-friendly interface, role-based access control, and a secure backend to ensure data privacy and compliance with healthcare regulations.
This section details the technical stack, project structure, and other configurations required to understand and work with the Encompass ePlatform codebase.
The project is built using a modern and robust technology stack:
- Frontend:
- React: A JavaScript library for building user interfaces.
- TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
- Vite: A fast build tool and development server for modern web projects.
- React Router: For declarative routing in the application.
- Tailwind CSS: A utility-first CSS framework for rapid UI development.
- Shadcn/ui: A collection of reusable UI components.
- Linting and Formatting:
- ESLint: For identifying and reporting on patterns found in ECMAScript/JavaScript code.
- Prettier: An opinionated code formatter.
- Deployment:
- Docker: For containerizing the application for consistent deployment.
- Nginx: A high-performance web server used to serve the production build.
The project follows a standard structure for a React application, with a clear separation of concerns:
/
βββ public/ # Static assets
βββ src/
β βββ components/ # Reusable UI components
β βββ config/ # Application configuration (e.g., navigation)
β βββ contexts/ # React contexts for state management
β βββ lib/ # Helper functions and utilities
β βββ pages/ # Top-level page components
β βββ types/ # TypeScript type definitions
β βββ App.tsx # Main application component with routing
β βββ main.tsx # Entry point of the application
β βββ index.css # Global CSS styles
βββ Dockerfile # Docker configuration for building the production image
βββ nginx.conf # Nginx configuration for serving the application
βββ package.json # Project dependencies and scripts
βββ vite.config.ts # Vite build and development server configuration
The frontend application communicates with a backend REST API. The API endpoint is configured in vite.config.ts for the development environment. For production, the VITE_API_BASE_URL environment variable is used during the Docker build process to set the API endpoint.
The src/lib/api.ts file contains the core functions for making API requests, handling responses, and managing errors.
- Authentication: The application uses a token-based authentication system. After a user logs in, a JSON Web Token (JWT) is stored in the browser's local storage and sent with each subsequent API request in the
Authorizationheader. - Protected Routes: The
src/components/ProtectedRoute.tsxcomponent ensures that only authenticated users can access certain routes. It checks for the presence of a valid token and redirects unauthenticated users to the login page. - Role-Based Access Control (RBAC): The application implements RBAC to control access to different features and data based on user roles (e.g., admin, doctor, nurse). The user's permissions are fetched from the API and used to conditionally render UI elements and restrict access to certain pages.
This section provides a guide to the different components of the application and how they are used.
To run the project locally, follow these steps:
- Clone the repository:
git clone <repository-url>
- Install dependencies:
npm install
- Configure the API endpoint:
- In
vite.config.ts, update theproxyconfiguration to point to your local backend server.
- In
- Run the development server:
The application will be available at
npm run dev
http://localhost:5173.
To build the application for production, run the following command:
npm run buildThis will create a dist directory with the optimized and minified production assets.
The application is designed to be deployed using Docker. The Dockerfile in the root of the project defines the steps to build a production-ready Docker image.
- Build the Docker image:
docker build -t encompas-eplatform . --build-arg VITE_API_BASE_URL=<your-api-url>
- Run the Docker container:
The application will be accessible on port 80 of the host machine.
docker run -p 80:80 encompas-eplatform
App.tsx: The main component that sets up the application's routing and context providers.MainLayout.tsx: The primary layout for the application, including the header, sidebar, and main content area.LoginPage.tsx: The login page where users authenticate.Dashboard.tsx: The main dashboard that users see after logging in.Referral.tsx: The page for creating and managing patient referrals.Admin.tsx: The admin panel for managing users and other system settings.
This checklist is to ensure a smooth handover to a new team:
- Code Walkthrough: A session to walk through the codebase and explain the architecture and key components.
- Environment Setup: Ensure the new team can set up the development environment and run the project locally.
- Deployment Process: Document and demonstrate the process for building and deploying the application to production.
- API Documentation: Provide access to the backend API documentation.
- Access to Tools: Grant access to any necessary tools, such as the Git repository, project management boards, and deployment servers.
- Contact Information: Provide contact information for key personnel for any follow-up questions.