How guni2605/praneiz works
Project type and purpose
• This is a monorepo for a full-stack e-commerce application named “PRANEIZ.”
• It contains three distinct front-end React apps (public storefront, admin panel) and a Node.js/Express REST API backend.
• Purpose: allow end-users to browse and purchase clothing items; allow admins to add/update products; handle auth, image hosting, and payments.
File structure
• Top level:
• admin/ → React-Vite admin panel
• frontend/ → React-Vite public storefront
• backend/ → Express REST API (controllers, models, routes, config)
• Key patterns:
• “src/Components” & “src/Pages” in both frontends → component-based UI (React)
• “store/ContextStore.jsx” → React Context for state management
• backend/config → external integrations (MongoDB, Cloudinary, Razorpay, Passport auth)
• backend/controllers + routes → MVC-style separation
• middlewares for auth, file uploads
• Deployment config: Vercel for both frontends, Render (or similar) for backend
README for additional insights
• Tech Stack: React, Node.js/Express, MongoDB (Mongoose), JWT, Cloudinary, Tailwind CSS
• Features: user auth, product catalog, image upload, admin CRUD, payment processing
• Environment variables: endpoints and secrets for JWT, DB, Cloudinary, payment gateway
• API surface: /api/auth, /api/users, /api/products, /api/upload, /api/orders
a. Main components
• Public Storefront (React app)
• Admin Panel (React app)
• REST API Server (Node.js/Express)
• MongoDB Database (Atlas)
• Cloudinary Media Storage
• External Payment Gateway (Razorpay)
• Authentication layer (JWT + Passport)
b. Relationships & interactions
• Both frontends ↔ REST API: HTTP(S) calls carrying JWT in headers
• REST API ↔ MongoDB: data persistence for Users, Items, Orders
• REST API ↔ Cloudinary: image upload/download via Cloudinary SDK
• REST API ↔ Razorpay: create and verify payment orders
• User’s browser ↔ Razorpay widget (for checkout flow)
c. Architectural patterns & design principles
• Componentized frontends with Context API (state + auth)
• MVC-style separation in backend (routes → controllers → models)
• Middleware chain for authentication and authorization
• Separation of concerns: UI, API, persistence, third-party services
d. Key technologies/libraries
• React + Vite, Context API, Tailwind CSS
• Node.js, Express.js, Mongoose, Passport.js, Multer
• Cloudinary SDK, Razorpay Node SDK, JSON Web Tokens (JWT)