Full-stack e-commerce web application for reusable bottles and eco-friendly products.
Emerald Sip is a learning-oriented production-style web shop with a complete customer and admin workflow:
- Customer catalog browsing, cart management, and checkout
- Guest and authenticated purchase flows
- JWT-based authentication and profile management
- Admin product, stock, customer, and sales management
- Frontend: React (CRA), React Router v5, Axios
- Backend: Node.js, Express
- Database: MongoDB, Mongoose
- Payments: PayPal (sandbox)
flowchart LR
C[Customer Browser] --> UI[React Client]
A[Admin Browser] --> UI
UI -->|REST API| API[Express Server]
API --> DB[(MongoDB)]
API --> FS[(Uploads Folder)]
UI --> PSP[PayPal JS SDK]
PSP --> PP[PayPal Sandbox API]
subgraph Client
UI
end
subgraph Server
API
end
sequenceDiagram
autonumber
participant U as User
participant C as React Client
participant P as PayPal
participant S as Express API
participant DB as MongoDB
U->>C: Add products to cart
U->>C: Click checkout
alt Logged-in user
C->>S: POST /sales (JWT + order payload)
else Guest user
C->>S: POST /sales (guest payload)
end
C->>P: Start PayPal approval
P-->>C: Payment confirmed
C->>S: Finalize order
S->>DB: Save sale and reduce stock
DB-->>S: Persisted
S-->>C: Order success response
C-->>U: Show confirmation
flowchart TD
L[Login/Register] --> T[Issue JWT]
T --> M[Auth Middleware]
M --> R{Route Access Level}
R -->|0| G[Guest]
R -->|1| CU[Customer]
R -->|2| AD[Admin]
G --> GP[Public catalog and guest checkout]
CU --> CP[Profile, history, authenticated checkout]
AD --> AP[Product/stock/customer/sales management]
- Product catalog with search, filtering, and sorting
- Product details modal with image gallery
- Cart with quantity controls and stock-aware behavior
- Cart icon toggle behavior (click again removes an item)
- PayPal checkout for guest and logged-in users
- Registration and login with JWT authorization
- Profile editing with optional profile photo upload
- Purchase history with search, filtering, and sorting
- Per-item return action in purchase history
- Add, edit, and delete products
- Adjust product stock levels
- View customers
- View customer purchase history
- Route-level and role-based access protection
react16.9react-router-dom5.0axios@paypal/react-paypal-js
express5mongoose8jsonwebtokenbcryptjsmultercorsdotenv
.
├── docs
│ └── screenshots
├── client
│ ├── public
│ └── src
│ ├── components
│ ├── hooks
│ ├── config
│ └── css
├── server
│ ├── config
│ ├── models
│ ├── routes
│ ├── seeds/default
│ └── uploads
├── ProjectProgress.md
└── README.md
Click to open screenshots
1. Product Catalog (Guest View)

5. Product Catalog (Admin Management View)

8. Admin Customer Purchase History

12. Product Catalog (Logged-In Customer View)

Direct link: Watch screencast
- Node.js 18+
- npm
- Local MongoDB on default host/port (
mongodb://localhost)
- Install dependencies:
cd server && npm install
cd ../client && npm install-
Start MongoDB locally.
-
Start backend (port
4000):
cd server
nodemon- Start frontend (port
3000):
cd client
npm start- Open
http://localhost:3000
Main route groups:
/products: public reads + admin create/update/delete/users: register/login, profile actions, admin customer management/sales: checkout, purchase history, returns, admin purchase history









