This is full stack web app built for an evaluation for Parsity Coding School.
The API is built for a mock e-commerce store that sells various "products" -- each product is randomly generated using Faker.
This project was built with TypeScript, Node.js, Express, and MongoDB.
The frontend for this project was built using React. It displays an e-commerce storefront that allows the user to view all the products upon first load and then filter results by category, price, and a custom search query.
-
To run locally, you will need to set up a MongoDB database on your computer. This project was created with MongoDB 5.0, but it should be compatible with later versions as well. Follow this link for installation instructions on your operating system of choice. Ensure that as a part of your installation, you specify a data directory. Test that your database is working using the MongoDB Shell. Once you know the database is set up correctly, move on to the next step.
-
Fork and clone this repo.
-
cd
into the repo on your local computer, thencd
intobackend
andnpm install
to install dependencies. -
npm start
to launch the development server onlocalhost:8000
. -
Copy and paste the contents of
swagger/swagger.yaml
into the Swagger Editor. This is the documentation for the API routes.
IMPORTANT: Before you are able to use any of the routes, you will need to generate fake data. You can do so by navigating first to localhost:8000/generate-fake-data
then to localhost:8000/generate-fake-reviews
.
For testing GET
routes, you can simply type the URL into your web browser -- for example, localhost:8000/products
. For POST
and DELETE
routes, you will need to use a CLI tool like curl or download the desktop agent for Postman.
-
To run the frontend, first ensure that you have followed the previous steps to get the API working. Launch the API by
cd
ing into thebackend
folder and runningnpm start
. -
Once the server is running,
cd
into thefrontend
folder and launch the frontend server by runningnpm run dev
. -
Navigate to
localhost:5173
in your browser. If everything was set up correctly, you should be able to interact with your product data with the UI.