API that let users create, read, update and delete labs
To deploy Lablabee API, you need the following services:
- Mongodb - You can get free hosting at https://cloud.mongodb.com
- Node.js (>=v16) - You can install it at https://nodejs.org/en/download/
- Yarn - You can install it at https://classic.yarnpkg.com/en/docs/install#debian-stable
- Install dependencies with
yarn install
- Create a
.env
file at the root of the project with the following properties:
APP_PORT_PROD={port}
APP_PORT_DEV={port}
// using localhost or docker service name
MONGODB_URL=mongodb://{ localhost || docker service name}:27017/LabLabee
// using mongodb cloud
MONGODB_URL=mongodb+srv://{username}:{password}@{cluster}/LabLabee?retryWrites=true&w=majority
- Run
yarn run dev
and the application will start at the designated port (default 3500 if not explicitly set) fordevelopment
- Run
yarn run start
and the application will start at the designated port (default 3000 if not explicitly set) forproduction
- Go to
localhost:{PORT}/api-docs/
- There will be UI page with API'S
- Test it out
- Run
yarn run test
to run tests and produce a detailed report using the verbose reporter.
- Refer to
docker-compose.yml
in the project root to proceed - Run
docker-compose up {service name}
Create and start containers for all services defined in the docker-compose.yml file. If the containers don't exist, it builds them first. - Run
docker-compose down
Stop and remove containers, networks, and volumes defined in the docker-compose.yml file. - Run
docker-compose start {service name}
Start existing containers defined in the docker-compose.yml file. - Run
docker-compose stop {service name}
Stop running containers defined in the docker-compose.yml file. - Run
docker-compose restart {service name}
Restart containers. It stops and starts containers defined in the docker-compose.yml file.