This repository is a solution to Shopify’s Developer Challenge: Building the the barebones backend for an e-commerce store.
This solution uses NodeJS and Express to create a RESTful API.
- Docker (version 18.09.1) or
- Node (version 9.10.1) and MongoDB (version 4.0.0)
- Postman (version 6.7.1)
Docker Setup
docker-compose up --build -d
This will build and link the containers for the NodeJS app and MongoDB
docker exec -it webAPI npm run seed
This will seed the database with a subset of initial products and one user
Congratulations! The server is up and the database is seeded.
You can begin browsing at localhost:3000/api/v2/products
!
See the documentation for resource information.
Stopping the server
docker-compose stop
This will stop both the NodeJS app and MongoDB containers
- Start MongoDB locally
npm install
This installs all required node modules
npm run seed:local
This will seed the database with a subset of initial products and one user
npm start
This will start the Node app locally
- Open the Postman desktop application
- File → Import →
path/to/app/postman/Local.postman_environment.json
This will setup your environment in Postman so no configuration is needed.
- File → Import →
path/to/app/postman/Shopify2019DeveloperChallenge.postman_collection.json
Learn more about:
If any problems arise, for the sake of this challenge most will be fixed by simply reseeding the database
docker exec -it webAPI npm run seed
(if running on docker) ORnpm run seed:local
(if running locally)
Contact: [email protected]