App for Teamleader, using React with Apollo Client and GraphQL.js served by Node.js/Express.js. Test database uses JSON Server.
This app allows the user to manage existing orders in a database. The user has the ability to add and remove items for each order, and adjust the quantity of items that have already been added. In the end, an order can be "placed." When the user clicks this button, the order is removed from the "orders"
collection (and thus from the order list), and moved to a new collection titled "dispatch"
. The successfully placed order is logged to the console on both the browser client and on the server.
All components responsively update with refreshed information after each user action on the database, exactly as we would want. Invalid inputs have not been extensively tested.
Database operations target API endpoints which are declared in the APIEndpoints.js file in the root directory. To test the program with a real REST API, update this file with the desired endpoints.
- Test for bugs/error-handling.
- Have node.js installed.
- Clone this repository.
- Open two terminal windows, navigating each to the local repository directory.
- Install dependencies with
npm install
. - Globally install JSON server (
npm install -g json-server
). - Run
npm run dev
in one window andnpm run db
in another. - Navigate to http://localhost:4000. The database will automatically be served from http://localhost:3000
- If desired, update the API endpoints in the APIEndpoints.js file.
- React.js
- Express.js
- GraphQL.js
- Apollo Client
- Axios
- Materialize CSS
- lodash