Inkspire is a full-stack bookstore that blends a clean shopping experience with a secure, server-verified eSewa checkout flow and transactional email updates. It is built to keep pricing, stock, payment validation, and email delivery authoritative on the backend while the frontend stays fast and polished.
- Authenticated cart tied to user accounts
- Real-time stock checks before checkout
- eSewa payment with server-side signature verification
- Clean payment status pages for success and failure
- Transactional email for signup and order confirmations
- Frontend: React, Vite, SCSS
- Backend: Node.js, Express, MongoDB
- Payment: esewa epay
- Email: Resend
PORT_NUMBER=8000
CLIENT_URL=http://localhost:5173
MONGODB_URL=YOUR_MONGO_CONNECTION
JWT_SECRET=YOUR_JWT_SECRET
EMAIL_SECRET_KEY=YOUR_EMAIL_SECRET
EMAIL_FROM=YOUR_VERIFIED_SENDER
# eSewa (UAT defaults shown)
ESEWA_PRODUCT_CODE=EPAYTEST
ESEWA_SECRET_KEY=YOUR_ESEWA_SECRET
ESEWA_FORM_URL=https://rc-epay.esewa.com.np/api/epay/main/v2/form
ESEWA_STATUS_URL=https://rc.esewa.com.np/api/epay/transaction/status/
ESEWA_SUCCESS_URL=http://localhost:8000/api/orders/esewa/success
ESEWA_FAILURE_URL=http://localhost:8000/api/orders/esewa/failure
- User clicks Checkout in cart.
- Backend validates cart, re-checks stock, and creates an order snapshot.
- Backend signs the payload and returns eSewa form fields.
- Frontend auto-submits the form to eSewa.
- eSewa redirects to success or failure URL with Base64 callback data.
- Backend verifies HMAC signature, total, product code, and UUID.
- Cart is cleared only when payment is verified as COMPLETE.
- Signup triggers a welcome email via
sendMail. - Order creation triggers a detailed order confirmation email via
sendOrderPlacedEmail(items, totals, payment provider, and payment status).
POST /api/auth/signupPOST /api/auth/loginPOST /api/auth/logout
GET /api/booksGET /api/books/:id
GET /api/cartPOST /api/cart/itemsPATCH /api/cart/items/:bookIdDELETE /api/cart/items/:bookId
POST /api/orders/checkout(protected)POST /api/orders/esewa/successPOST /api/orders/esewa/failureGET /api/orders/esewa/status/:uuid(protected)
- eSewa ePay: https://developer.esewa.com.np/pages/Epay
- resend: https://resend.com/docs/send-with-nodejs