Installation

API Installation

Required

To run the API on your local machine, make sure these items are installed on your computer:

The other items that You need to setup are:

Steps

To run the API on your local machine, make sure You follow these steps:

Clone the Repository

git clone https://github.com/IndraSty/GreenBasket.git
 
cd GreenBasket

Initialize Go module and download dependencies:

go mod init GreenBasket
go mod download

Start up a docker container running MongoDB and Redis. A docker-compose file is provided to make this easier.Make sure you are in the same root folder as docker-compose is located.

docker compose up

Create an .env file and fill it according to the .env.example file which has been completed according to the required items explained previously.

Import data from the /data folder to your database. We recommend using a GUI like MongoDB Compas to make this easier.

Run the API on Your local machine

go run cmd/server/main.go

To build the source code running

go build