Smart Checkout is a mobile app that allows users to self-checkout from supermarkets without having to stand in long queues. This is the backend of the application, check the Frontend Repo of the application done with react native.
- Node.JS
- Express
- MongoDB
- Docker
This project requires node and npm to be installed on your machine. It has been tested on node version 10.15.0. The project uses the Atlas cloud by MongoDB to host the database, you need to make an account to be able to use Atlas's services.
- git clone the repo or download as a zip file.
git clone https://github.com/Lujine/smart-checkout-backend.git- Install the dependancies.
npm i- add .env file. Check the example file for more information about the required configurations.
- Set Mongo URI (can be obtained from your Atlas account)
- Configure JWT Secret which is a key that encodes the user passwords saved in the database
npm start- build the docker image
docker build -t smart-checkout .
- get image id
docker image ls
- run
docker run -p 8080:8080 -d <image id>
- get container id
docker ps
- check logs to make sure app is running
docker logs <container id>
- test connection
curl -i localhost:8080
- If the test returned status 200 OK, then you can start sending requests to localhost:8080
commands to run
docker-compose up
- The backend is deployed on smart checkout backend, you can send your requests to the url straight away