A full-stack e-commerce application built with the PERN stack (PostgreSQL, Express, React, Node.js).
- Product management (CRUD operations)
- Responsive React frontend with Tailwind CSS
- RESTful API with Express.js
- PostgreSQL database with Neon
- Security with Arcjet rate limiting
- Real-time updates and notifications
Frontend:
- React 18 + Vite
- Tailwind CSS + DaisyUI
- Zustand (state management)
- React Router DOM
Backend:
- Node.js + Express
- PostgreSQL (Neon)
- Arcjet (security)
- CORS, Helmet, Morgan
-
Clone and install:
git clone https://github.com/Tirth-955/pern-ecom.git cd pern-ecom -
Set up environment variables in
.env:PORT=3000 DATABASE_URL="your_postgres_connection_string" ARCJET_KEY="your_arcjet_key" ARCJET_ENV="development" -
Start server:
npm run build
npm start
├── frontend/ # React app
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ └── store/
│ └── package.json
├── backend/ # Express API
│ ├── controllers/
│ ├── routes/
│ ├── config/
│ └── server.js
└── package.json # Root dependencies
GET /api/products- Get all productsGET /api/products/:id- Get single productPOST /api/products- Create productPUT /api/products/:id- Update productDELETE /api/products/:id- Delete product
npm run dev- Start backend with nodemonnpm run build- Build frontend for productionnpm start- Start production server
- Frontend: http://localhost:5173
- Backend: http://localhost:3000
- Database: PostgreSQL (Neon)