In order to setup this project and avoid running into errors, you need to have Docker and Git installed
- Naviagte into the preferred location of your machine (preferrably in your $HOME directory) and clone the project repo with the command
git clone git@github.com:Varsilias/mainstack-assessment.git
- Navigate into the project directory by running the command
cd mainstack-assessment
- Install project dependencies with
npm install
oryarn install
- For local development, you need to have a
.env
file in the root of the project directory. In your terminal window, navigate to the project directory and create a.env
with the commandcp .env.example .env
- Fill in the required environment information
- Start the MongoDB, Mongo Express (DBMS for Mongo) and the API development server by running
docker compose up
, you can run all the services in the background withdocker compose up -d
- Open your browser and navigate to http://localhost:8081 to view your database, you also have a choice to use your favourite MongoDB visualization tool to view your database. The Connection string should be: mongodb://<DB_USER>:<DB_PASSWORD>@localhost:27017/<DB_NAME>?authSource=admin NB: DB_USER, DB_PASSWORD and DB_NAME are from the Environment Variables set earlier
- If you did everything well, you local development server will be running at: (
http://localhost:<PORT>
) NB: PORT is from the Environment Variables set earlier - Send a GET Request to (
http://localhost:<PORT>/health-check
), you should see this response "All Systems Up" - Run all unit test cases with the command
npm run test:unit
oryarn test:unit