This is a web application built using Node.js and PostgreSQL with Sequelize ORM.
Before you can build and deploy this application locally, ensure you have the following prerequisites installed:
-
Ensure you have Node.js installed (preferably the latest LTS version). You can download it from Node.js official website.
To check if Node.js is installed, run:
node -v
-
PostgreSQL must be installed on your local machine or on a server. You can download and install PostgreSQL from PostgreSQL official website
To check if PostgreSQL is installed, run:
psql --version
-
Git is required for cloning the repository. You can download Git from Git official website.
To check if Git is installed, run:
git --version
Start by cloning the repository to your local machine using the following command:
git clone https://github.com/your-username/your-repository.git
cd your-repositoryOnce you’ve cloned the repository, install the required dependencies by running:
npm installThis will install all necessary Node.js packages, including express, sequelize, pg (PostgreSQL client), and others.
Make sure you have PostgreSQL running on your local machine or server. Then, create a .env file in the root of your project directory (if it does not exist) and add the following environment variables for connecting to PostgreSQL:
# Environment configuration
NODE_ENV=development
PORT=3000
DEV_DATABASE_URL=postgres://<your_username>:<your_password>@127.0.0.1:5432/HealthzDev
TEST_DATABASE_URL=postgres://<your_username>:<your_password>127.0.0.1:5432/HealthzTest
DATABASE_URL=postgres://<your_username>:<your_password>@127.0.0.1:5432/HealthzProductionTo start the application, run:
npm startOnce the server is running you can open your web browser and access the application at:
http://localhost:3000