An open API service indexing awesome lists of open source software.

https://github.com/paishanmadusha/pern-stack-product-store

Product Store is a fullstack web application built using the PERN Stack. It allows users to add, view, edit, and delete product entries with features like theme toggling (light/dark), bot protection, rate limiting, and smooth UI using Tailwind + daisyUI.
https://github.com/paishanmadusha/pern-stack-product-store

arcjet bot-protection client-server-architecture daisyui express helmet javascript lucide-icons neon-postgres nodejs postgresql rate-limiting react-toast reactjs tailwindcss theme-switcher zustand-state-management

Last synced: 2 months ago
JSON representation

Product Store is a fullstack web application built using the PERN Stack. It allows users to add, view, edit, and delete product entries with features like theme toggling (light/dark), bot protection, rate limiting, and smooth UI using Tailwind + daisyUI.

Awesome Lists containing this project

README

          


๐Ÿ›’ Product Store


BUILD WITH THE PERN STACK & CLIENT-SERVER ARCHITECTURE


ย ย ย 
ย ย ย 
ย ย ย 
ย ย ย 

---

**Product Store** is a fullstack web application built with the **PERN stack** (PostgreSQL, Express, React, Node.js). It uses **PostgreSQL via Neon** as the database and allows users to **add**, **view**, **edit**, and **delete** product entries. The app features **light/dark theme toggling**, **Arcjet** for bot protection and rate limiting, and a smooth, responsive UI built with **Tailwind CSS** and **daisyUI**.

---

## ๐Ÿš€ Features:

* ๐ŸŒ Full client-server architecture (Frontend + Backend).
* ๐Ÿ“ Add, edit, and delete products (name, brand, description, price, image).
* ๐ŸŒ™ Theme switcher with Zustand and localStorage.
* ๐Ÿ“ฆ PostgreSQL database hosted on [Neon](https://neon.com/).
* ๐Ÿ›ก๏ธ Arcjet integration for: Bot detection `detectBot`, Rate limiting `tokenBucket`.
* โœจ Clean and responsive UI using Tailwind CSS and daisyUI.
* ๐Ÿ” Helmet & CORS for basic security.

---

## ๐Ÿงฐ Tech Stack:
The following tech stack is used in this project (Frontend & Backend):

| Dependency | Description |
| ---------------------------- | ----------------------------------------- |
| React 19 + Vite: build tool | Modern frontend framework + fast bundler |
| **Zustand** | Lightweight state management |
| **Tailwind CSS** | Utility-first CSS framework |
| **daisyUI** | Tailwind-based UI component library |
| **React Router DOM** | Client-side routing |
| **Axios** | HTTP client for making API requests |
| **Lucide Icons** | Beautiful open-source icon set |
| **React Hot Toast** | Toast notification library |
| ---------------------------- | ----------------------------------------- |
| **Node.js + Express** | Server runtime and web framework |
| **PostgreSQL** | Relational database (via Neon serverless) |
| **@neondatabase/serverless** | Client for Neon-hosted PostgreSQL |
| **Helmet** | Secures HTTP headers |
| **CORS** | Enables Cross-Origin Resource Sharing |
| **Morgan** | HTTP request logger |
| **Arcjet** | Bot detection and rate limiting |

---

## โš™๏ธ How to Run the Project:
Follow these steps to successfully run the project:

### 1. Clone the repository:

```bash
https://github.com/PAIshanMadusha/pern-stack-product-store.git
```

##### And, navigate to the project directory:

```bash
cd pern-stack-product-store
```

### 2. Create `.env` File:

##### At the root of the project, create a `.env` file and add the following credentials.
##### Go to [**Neon**](https://neon.tech/) and sign in or create an account. Create a new project and copy your ** ๐Ÿ” database connection details** from the dashboard.
##### Then go to [**Arcjet**](https://arcjet.com/), log in, create a new site, and get your `๐Ÿ” ARCJET_KEY` from the **SDK Configuration** section.
##### Paste everything in your `.env` like this:

```env
PORT=3000

PGUSER=[your_neon_user]
PGPASSWORD=[your_neon_password]
PGHOST=[your_neon_host]
PGDATABASE=[your_neon_db]

ARCJET_KEY=[your_arcjet_key]

NODE_ENV=production
```

### 3. Install Dependencies, Build & Start (Production):

##### To prepare the app for production:

```bash
npm run build
```

##### Then start the application:

```bash
npm start
```

##### โœ… If everything is successful, your terminal should show:

```
Database initialized
Server is running on port: 3000
```

---

### โš™๏ธ Development Mode (Optional):

##### To run in development mode, edit your `.env` file and set:

```env
NODE_ENV=development
ARCJET_ENV=development
```

##### Then, navigate to the `pern-stack-product-store\server` and `pern-stack-product-store\client` folders and start both:

```bash
npm run dev
```

##### โœ… If successful, you should see the following in the **client** terminal:

```
http://localhost:5173/
```

##### โœ… And in the **server** terminal:

```
Database initialized
Server is running on port: 3000
```

### ๐Ÿงช Add Sample Products (Optional):

##### To quickly populate your database with test products, run this script from the root:

```bash
node server/seeds/products.js
```

##### โœ… This will insert a few sample items you can use to test the UI.

---

## ๐Ÿงพ Scripts:
Use these commands to manage the app in development and production environments:

| Command | Description |
| --------------- | -------------------------------------------------------------------- |
| `npm install` | Install dependencies for both Client and Server |
| `npm run dev` | Run the app in development mode (client & server) |
| `npm run build` | Install all dependencies and build frontend & backend for production |
| `npm start` | Start the app in production mode |

## ๐Ÿ“ธ System Screenshots:
These screenshots illustrate how the system appears on desktop and mobile devices:

---


Screenshot 1



Screenshot 3



Screenshot 4



Screenshot 4



Screenshot 4



Screenshot 4ย ย ย 
Screenshot 4

---

### ๐Ÿ‘จโ€๐Ÿ’ป Created by:
**Ishan Madhusha**
GitHub: [PAIshanMadusha](https://github.com/PAIshanMadusha)

Feel free to explore my work and get in touch if you'd like to collaborate! ๐Ÿš€

---

## ๐Ÿ“ License:
This project is licensed under the MIT License : See the [LICENSE](LICENSE) file for details.