This is a Next.js project bootstrapped with create-next-app.
To run the project you must have Node installed (some older version of Node is not compatible with some particular package so I suggest to use a recent package such use 16).
When Node is working install modules by running
npm install
# or
yarnAfter that, you can start the webserver by running:
npm run dev
# or
yarn devThis is a really basic "shop" website. Open http://localhost:3000 with your browser and then you can Login throught the shop using username and password. Each user has a certain category and can see a particular shop and its products. In each shop user can logout or interact with each product can be:
-
"Added to Cart": By clicking the button, a
POSTrequest will be made and the quantity value will decrease. There is no cart and nothing else can be done trought this button. -
"Requested": This will appear only if available quantity is 0. By clicking the button, a
POSTrequest will be made and the "request" value will increase.
In Admin category, you will find a the whole product list, ordered by category, logout, interact with products or create a new product.
In each existing product admin can:
- "Edit": Edit Name or Description
- "Update quantity": Update avalilable quantitiy
- "Delete": Delete the entire product.
As said before, Admin can also add a product in a category, by clicking the button, he can fullfill and then sumbit the form. Remember that admin can also chose productId, that cannot be duplicated. (Farily, not the best idea that I've ever had, actually I would use autogenerated ids, but initially I didnt' expect to have that type of interactions).
I've set 2 tracking endpoints:
- "pageViews": When a Shop is visited (not the admin one) a
POSTrequest is made and updates the valueviewsinside the fileSystem. - "productInteractions": When a user (not admin) clicks on product buttons a
POSTrequest is made and updates the valueproductInteractionsinside the fileSystem.
For this webapp I've created a JSON file that contains shop's data.
Here you can find the whole users list:
| Username | Password | Category |
|---|---|---|
| SportMaster | gym1234! | Sport |
| GreatestFootballer | Best-123 | Sport |
| MrPancake | Food_531 | Food |
| WineTaster | Red1990 | Drinks |
| admin | superuser!2022! | Drinks |
Thank you very much for your interest, I'm honoured to be part of your selections and really sorry for not being that faster as you aspected or I wanted neither, but I had to finish also my main work tasks always on "crunch-mode". I usually work on Typescript but for this project I didn't had the time I wanted to setup everything as better as I could/would.
I would appreciate very much your opinion and expecially your critics to improve myself.