Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

pcnova/react-challenge-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

React-Docker Test Environment

This is a multi-container docker environment that utilizes Docker to create three seperate but linked containers:

  • MongoDB database
  • Node/Express Server
  • React client

Project Requirements

Running the project

  • After cloning the repo, go into the project's root directory and run docker-compose up. The first time running this the server and client will both go through the build process, but this should only happen once.
  • Your connection target on Mac and Linux is localhost://. For Windows, you will need to run docker-machine ip to find your address to connect to, default is 192.168.99.100:.
  • Database can be found at (target):27017, server at (target):4000, client at (target):3000.

Development process

Shutting down the servers can be done with a Ctrl-C command from your terminal. Alternatively, you can load up Kitematic to close them as well.

If you need to exec into one of the containers, Kitematic has a GUI to do that for you. Otherwise, you will need to run docker ps, find the container ID, and then run docker exec (container_name) -it bash.

Kitematic can also be useful for looking at the logs for one specific container, since all three are tailed in the terminal.

Endpoint testing

The following backend endpoints can be queried via Postman for testing purposes:

  • Login (POST) - (server addr)/api/login (Expects name/password in request body)
  • Current Orders (GET) - (server addr)/api/current-orders
  • Add Order (POST) - (server addr)/api/add-order (Expects ordered_by, quantity, menu_item in request body)
  • Delete Order (POST) - (server addr)/api/delete-order (Expects id in request body)
  • Edit Order (POST) - (server addr)/api/edit-order (Expects id in request body. Will look for ordered_by, quantity, menu_item.)
  • Flush Orders (DELETE) - (server addr)/api/delete-all (This deletes all current orders in the DB)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 82.4%
  • CSS 10.5%
  • HTML 5.2%
  • Dockerfile 1.8%
  • Shell 0.1%