Welcome to the development guide for HEALCONNECT. This document aims to get you from cloning the repository to running the full-stack Next.js and Firebase application on your local machine.
Before you start, ensure you have the following installed on your machine:
- Node.js (v16.x or higher)
- npm (usually bundled with Node.js) or Yarn
- Git
- A text editor (we recommend VS Code)
- A Google Account (to configure a Firebase project)
-
Clone the repository:
git clone https://github.com/Dipanita45/HEALCONNECT.git cd HEALCONNECT -
Install all Node dependencies:
npm install # or yarn install
HEALCONNECT relies on Firebase for Authentication and Firestore. To run it locally, you must provide your own set of Firebase config keys.
- Go to the Firebase Console and create a New Project.
- Within your Firebase project, enable Authentication (specifically Email/Password sign-in).
- Under the Build menu, create a Firestore Database in test mode.
- Go to Project Settings -> General and add a new Web App.
- Note the keys provided in the
firebaseConfigsection.
Create a .env.local file in the root of your HEALCONNECT project, and populate it with your keys:
NEXT_PUBLIC_FIREBASE_API_KEY="your-api-key"
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="your-app.firebaseapp.com"
NEXT_PUBLIC_FIREBASE_PROJECT_ID="your-app-id"
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="your-app.appspot.com"
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="your-sender-id"
NEXT_PUBLIC_FIREBASE_APP_ID="your-app-id"
⚠️ IMPORTANT: Never commit.env.localto version control! The.gitignoreis configured to ignore it automatically.
On the very first run, your Firestore DB will be empty. The app is built to gracefully handle missing collections by creating default documents as users log in.
To seed test data:
- Start the app (see step 5).
- Register a new user using the
/signuproute. - Your Firebase Auth and
usersFirestore collection will automatically populate.
Once your .env.local runs, start the Next.js development server:
npm run dev
# or
yarn devYour terminal will show:
ready - started server on http://localhost:3000- Open your browser to
http://localhost:3000. - You will see the main landing page.
- Test your Firebase configuration by attempting to Create an Account.
By default, any user registering via the website becomes a patient role.
To gain access to the /admin/dashboard or /doctor/dashboard:
- Log into your Firebase Console website.
- Go to Firestore Database ->
userscollection. - Find your user's Document ID.
- Manually edit the
rolefield frompatienttoadminordoctor. - Refresh your local webpage.
When you are ready to check the compiled PWA logic before making a Pull Request: (Note: Do not ignore warnings! PRs that break the React build will not be merged).
npm run lint # Check for ESLint warnings
npm run build # Compiles all Next.js static and server routes
npm run start # Runs the compiled bundle on port 3000To configure the ESP32 firmware with your WiFi and Firebase credentials:
- Navigate to the
HealthConnect_Kit_Arduino_Codedirectory. - Copy
config.example.hto a new file namedconfig.h. - Open
config.hand replace the placeholder values with your actual WiFi and Firebase credentials. - Note:
config.his ignored by git to prevent accidental leaking of credentials.