Application for tracking items added to shopping cart. Includes express backend and react frontend.
- Install Node.js if you haven't already
- Clone this repository
cd
into the downloaded directorycd
into server and runnpm install
from the command line to install all dependencies
- Create mongoDB account - https://account.mongodb.com/account/register
- Create a free AWS cluster
- Go to
collections
(Browse Collections) and create a new database (shopping_cart) for example with two collectionsproducts
andcartitems
. Note: If you are going to work in pairs create two databases (for example team1_shopping and team2_shopping) and each database should have two collectionsproducts
andcartitems
. - Under Security tab, click Database Access, and on the right
add new database user
. After you enter username and password, clickadd user
at the bottom right corner. - Under Security tab, click Network Access, and whitelist your IP address.
- Once your cluster is created, under Clusters tab, click connect and then MongoDB for VSCode and copy the connection string which will look something like this
mongodb+srv://test123:<password>@cluster0-zamyu.mongodb.net/
. Instead oftest123
there will be your username, and you will need to replace<password>
with your password andtest
with the database name. You will have to put the name of your database after the connection string with some flagsmongodb+srv://test123:<password>@cluster0-zamyu.mongodb.net/<databaseName>?retryWrites=true&w=majority
. Change<databaseName>
with the name of your database. - Finally, inside your project folder,
cd
into server, create new file.env
and enterDB=<paste the string from above here>
. It will look similar to thisDB=mongodb+srv://test123:mypass@cluster0-zamyu.mongodb.net/shopping_cart?retryWrites=true&w=majority
.
You can find documentation in the docs
folder in api.md
file.