git clone https://github.com/marten-sova/warehouse.git
Go to the root of your repository's folder, and install all dependencies:
cd ~/warehouse
npm install
open terminal
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
open terminal
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community to start service
brew services stop mongodb-community to stop service
mongosh
Note the address and port displayed after "Connecting to: mongodb://..."
By default, mongodb://localhost:27017/
If it isn't the default location, configure your database within server/constants/index.js, by configuring the MONGO_URI variable to the location observed in the previous step.
From the root of your project run:
npm start
Open terminal #1 (backend)
cd ./server
npm start
Open terminal #2 (frontend)
cd ./client
npm start
From the root of your project run:
npm test
- Switch to TypeScript
- Add more unit tests to warehouse API (may want to consider a different testing framework as well)
- Add front end tests to warehouse form
- Warehouse form is not mobile friendly
- Add e2e test for warehouse creation
- Add API methods for getting one warehouse, updating a warehouse, and deleting a warehouse
- Must shelf names be unique per warehouse, or across all warehouses? Currently they are only checked for duplicates within the single warehouse when creating it.
- Lookup by shelf may be expensive if the ability to query all warehouses at once is required. Shelf names are nested heirarchically within warehouses and zones in the database so would require scanning many entries. May be mitigatable by indexing the shelf names.
- I chose noSQL because this is a simple assignment and it is easier to use. However, SQL may be more optimal due to the set schema and requirements of unique values etc.
- Current database implementation requires more space than necessary for incomplete warehouse entries. A warehouse with one shelf in Zone 1 still creates all 12 zones with empty arrays of shelves. Easier to unpack the data this way but not optimal.
GraphQL might be beneficial to reduce network usage, depending largely on the scale of the app, whether entries will be queried from all warehouses or just one, and whether more data will be integrated into the system – e.g., items on shelves. I chose to use a REST API because I am more familiar, and the assignment was to create a warehouse creation route – which will always require sending the full object regardless.
