Skip to content

GitWitAnish/Inkspire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 

Repository files navigation

Inkspire

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.

Highlights

  • 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

Stack

  • Frontend: React, Vite, SCSS
  • Backend: Node.js, Express, MongoDB
  • Payment: esewa epay
  • Email: Resend

envConfig

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

Payment Flow (eSewa)

  1. User clicks Checkout in cart.
  2. Backend validates cart, re-checks stock, and creates an order snapshot.
  3. Backend signs the payload and returns eSewa form fields.
  4. Frontend auto-submits the form to eSewa.
  5. eSewa redirects to success or failure URL with Base64 callback data.
  6. Backend verifies HMAC signature, total, product code, and UUID.
  7. Cart is cleared only when payment is verified as COMPLETE.

Email (Resend)

  • Signup triggers a welcome email via sendMail.
  • Order creation triggers a detailed order confirmation email via sendOrderPlacedEmail (items, totals, payment provider, and payment status).

API Overview

Auth

  • POST /api/auth/signup
  • POST /api/auth/login
  • POST /api/auth/logout

Books

  • GET /api/books
  • GET /api/books/:id

Cart (protected)

  • GET /api/cart
  • POST /api/cart/items
  • PATCH /api/cart/items/:bookId
  • DELETE /api/cart/items/:bookId

Orders and eSewa

  • POST /api/orders/checkout (protected)
  • POST /api/orders/esewa/success
  • POST /api/orders/esewa/failure
  • GET /api/orders/esewa/status/:uuid (protected)

Docs

About

Inkspire is a full-stack bookstore with a modern cart, real-time stock validation, secure, server-verified eSewa payments, and transactional email updates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors