eSales RPRC Government E-Commerce Platform
Production government e-commerce portal built end-to-end for agricultural and botanical product distribution, featuring automated GST invoicing and dedicated Linux VPS cloud hosting.
Full-Stack MERN Developer & DevOps (Solo Build)
4 Months
RPRC (Govt. of Odisha)
Full-Stack Web


The Problem & Engineering Constraints
Why this system needed to be built
The Regional Plant Resource Centre (RPRC), a premier state government biodiversity and research institute in Odisha, distributed aromatic plants, medicinal herbs, and botanical publications exclusively through manual, in-person cash transactions. They needed a reliable digital storefront allowing citizens to browse catalogs, pay online, and receive automated tax invoices, with a centralized admin dashboard for inventory tracking.
Retail customers, botanical research institutions, farmers, and government store administrators.
Real-World Constraints
Non-Negotiables- Strict infrastructure budget cap: Must run reliably on an affordable Linux VPS ($8 - $10/month) with zero ongoing cloud service subscription costs.
- Zero data-loss requirement: Government financial records, order numbers, and statutory GST tax invoices required ACID transactional consistency.
- Production server orchestration: Sole developer responsible for provisioning the Linux OS, Nginx reverse proxy, SSL certs, DNS routing, and PM2 process management.
*Every architecture decision was framed strictly around these constraints.
System Architecture & Key Decisions
High-Level System Architecture
Engineered with React on the frontend, a Node.js/Express REST backend, and MongoDB database, deployed directly onto a self-managed Hostinger Linux VPS configured with Nginx reverse proxy, Certbot SSL automation, and PM2 cluster management.
Architectural Trade-Off Analysis (Micro-ADRs)
Hostinger Linux VPS with Nginx reverse proxy over managed serverless platforms (Vercel/Heroku)
Satisfied strict government budget constraints ($8/month flat) while giving full control over system daemons, automated cron jobs, and database backups.
Required manual Linux sysadmin responsibilities: configuring firewall (UFW), Nginx gzip compression, SSL renewal, and log rotation.
Managed cloud platforms (AWS Elastic Beanstalk / Heroku)
Automated GST-compliant PDF invoice generation pipeline
Government accounting standards mandated exact sequential order IDs with statutory GST breakdowns generated immediately upon payment confirmation.
Server-side headless PDF rendering can consume CPU bursts; required off-thread generation and stream piping directly to disk and email webhooks.
Client-side window.print() styling
Engineering Challenges & Root-Cause Fixes
Real technical hurdles encountered during production development and how they were solved under the hood.
Zero-Downtime Linux VPS Process Management & Auto-Recovery
Uncaught exceptions or memory spikes on a single 2GB RAM Linux VPS risked terminating the Node.js API process, leaving the public government storefront unreachable.
Node.js runs single-threaded by default; unhandled rejections would kill the process with no automatic restart mechanism.
Configured PM2 in cluster mode across available CPU cores with memory restart thresholds (max-memory-restart 350M), integrated systemd daemon startup, and configured Nginx health check upstream failovers.
Achieved 99.9% uptime with automated zero-downtime reloads and self-healing process restarts.
Payment Webhook Race Conditions & Double-Order Prevention
Unreliable mobile network connections caused duplicate webhook delivery and intermittent browser disconnects during payment gateway redirects.
Simultaneous payment callbacks were executing order creation and inventory decrement routines concurrently without idempotency checks.
Implemented idempotent webhook handlers using unique payment transaction IDs as MongoDB uniqueness keys, wrapped inventory adjustments in atomic database operations ($inc with $gte checks), and validated digital signatures on every callback.
100% transaction consistency with zero duplicate orders or inventory discrepancies recorded across production lifetime.
Key Features & Implementation Mechanics
E-Commerce Catalog & Dynamic Cart System
Browse medicinal plant varieties, organic products, and publications with real-time stock availability, categories, and shopping cart validation.
React frontend with persistent local storage cart synchronization and server-side inventory verification before checkout.
Government-Compliant Invoicing & Order Management
Automatic generation of sequential GST tax invoices with transactional email delivery to customers and warehouse staff.
Server-side PDF generation pipeline using PDFKit with dynamic statutory tax breakdown calculation and Nodemailer SMTP delivery.
Admin Dashboard for Inventory & Sales Telemetry
Secure management interface for store staff to update product stock, process dispatch orders, and export monthly sales reports.
Role-protected Express endpoints with JWT authentication, rate limiting, and aggregate MongoDB revenue reporting pipelines.
Verified Metrics & Telemetry
Server Uptime
Maintained on a single self-managed Hostinger Linux VPS via PM2 clustering and Nginx reverse proxy.
Order & Payment Consistency
Zero duplicate orders or financial discrepancies due to idempotent payment handlers.
Infrastructure Operating Cost
Complete production system hosted within government institute budget constraints.
Solo Delivery
Handled full-stack development, payment gateway integration, Linux OS provisioning, and DNS/SSL setup.
Lessons Learned & Architectural Evolution
What Worked Well & Enduring Takeaways
- ✓Hands-on Linux server administration (Nginx, PM2, UFW, Certbot, systemd) provides unmatched cost-efficiency and deep understanding of network packet flow.
- ✓Payment gateway integration must always be designed defensively: never trust client-side return URLs alone; the signed webhook is the source of truth.
What I Would Build Differently Today
- ↺If building today, I would containerize the application with Docker and Docker Compose for even faster environment reproduction and automated rollback capabilities.
- ↺I would set up a centralized log aggregator (like Grafana Loki or Papertrail) to inspect Nginx access logs and Node.js error traces without SSH-ing into the VPS.