Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e67c542
package.json file
j-emitch May 28, 2025
43cf911
initial server.js file
j-emitch May 28, 2025
9cde420
initial product.js
j-emitch May 28, 2025
8350be6
add /generate-fake-data route and /products route with pagination
j-emitch May 28, 2025
b49180e
add reviews array to ProductSchema
j-emitch May 28, 2025
6f48d84
add fake review generation
j-emitch May 28, 2025
1dbdcf5
add get product by id route
j-emitch May 28, 2025
b165524
add explicit ReviewSchema subdoc
j-emitch May 29, 2025
3687e92
add route to return all reviews for product
j-emitch May 29, 2025
af42f97
initial package-lock.json file
j-emitch May 29, 2025
55911ff
add post new product route
j-emitch May 29, 2025
7e240ec
add route to create new review for single product
j-emitch May 29, 2025
ec64573
add route to delete product by id
j-emitch May 29, 2025
f9d80aa
add route to delete review by review id
j-emitch May 29, 2025
8e23ee6
update /products route to accept an optional query of only products i…
j-emitch May 29, 2025
4a988f9
update /products route to accept optional query to sort products by p…
j-emitch May 29, 2025
5e145bd
add optional query to /products route that returns products that matc…
j-emitch May 29, 2025
df0024a
move backend files into its own directory
j-emitch May 29, 2025
8376902
scaffold next.js frontend
j-emitch May 29, 2025
33323ae
add redux store
j-emitch May 29, 2025
d561da1
add layout.js with redux
j-emitch May 30, 2025
35096ae
add simple product list view in page.js
j-emitch May 30, 2025
f7cf3fc
add CORS
j-emitch May 30, 2025
ec34968
add bootstrap
j-emitch May 31, 2025
00f9c7e
add products slice
j-emitch May 31, 2025
f19f627
product card and product list components
j-emitch Jun 1, 2025
7fcc782
add search bar and sort component
j-emitch Jun 2, 2025
1a8be4b
add category and price sorting
j-emitch Jun 3, 2025
8670bda
add search functionality
j-emitch Jun 4, 2025
4e093cf
refactor /generate-fake-data
j-emitch Jun 4, 2025
1f240ac
add response status
j-emitch Jun 4, 2025
c6e3e92
fix data descrpitions to make clearer
j-emitch Jun 5, 2025
374c136
add page/document states for pagination
j-emitch Jun 8, 2025
5b92b7f
update readme
j-emitch Jun 8, 2025
c1f5e94
add pagination component
j-emitch Jun 8, 2025
7864320
add pagination component to ProductList
j-emitch Jun 8, 2025
2908f0e
fix number of productCards per row in screen size scaling
j-emitch Jun 8, 2025
6d3201b
clean up ProductCard styling
j-emitch Jun 8, 2025
d71a168
deleted/moved files
j-emitch Jun 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 69 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,72 @@
## Product List
# Product List

A full-stack e-commerce application built with Express, MongoDB, React, and Redux.

This project has been created by a student at Parsity, an online software engineering course. The work in this repository is wholly of the student based on a sample starter project that can be accessed by looking at the repository that this project forks.
## Prerequisites

If you have any questions about this project or the program in general, visit [parsity.io](https://parsity.io/) or email hello@parsity.io.
- Node.js (v14 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn

## Getting Started

### 1. Database Setup

```bash
# Start (sign in) your local MongoDB service
mongod --dbpath=/Users/user/data/db

# Verify MongoDB is running
mongosh
```

### 2. Backend Setup

```bash
# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Start the server
npm start
```

The backend will be running at http://localhost:8000

### 3. Generate Test Data

```bash
# In a new terminal, run:
curl http://localhost:8000/generate-fake-data
```

### 4. Frontend Setup

```bash
# In a new terminal
# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start the development server
npm run dev
```

The frontend will be running at http://localhost:3000

## Features

- Product listing with pagination
- Category filtering
- Price sorting
- Search functionality

## Development

- Backend API runs on port 8000
- Frontend development server runs on port 3000
- MongoDB runs on default port 27017
17 changes: 17 additions & 0 deletions backend/models/product.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const ReviewSchema = new Schema({
username: String,
text: String,
});

const ProductSchema = new Schema({
category: String,
name: String,
price: Number,
image: String,
reviews: [ ReviewSchema],
});

module.exports = mongoose.model("Product", ProductSchema);
Loading