Skip to content

YashPandit09/KGW

Repository files navigation

Kulswamini Grinding Works - React + Node.js Monorepo

Version 2.0 - Modern full-stack e-commerce application

πŸš€ Quick Start

Prerequisites

  • Node.js v14+ installed
  • MongoDB Atlas account
  • npm or yarn

Installation

# Install all dependencies for root, server, and client
npm run install:all

# Or install manually:
npm install                    # Root dependencies
cd server && npm install       # Server dependencies
cd ../client && npm install    # Client dependencies

Environment Setup

Create a .env file in the /server directory:

MONGODB_URI=mongodb+srv://username:[email protected]/kulswamini?retryWrites=true&w=majority
JWT_SECRET=your-secret-key-here
PORT=5000

Running the Application

# Development mode (runs both client and server concurrently)
npm run dev

# Or run separately:
npm run server    # Backend on http://localhost:5000
npm run client    # Frontend on http://localhost:3000

Visit http://localhost:3000 in your browser!


πŸ“ Project Structure

/kulswamini-grinding-works
β”œβ”€β”€ /client                  # React Frontend
β”‚   β”œβ”€β”€ /public
β”‚   β”‚   └── /images         # Product images
β”‚   β”œβ”€β”€ /src
β”‚   β”‚   β”œβ”€β”€ /components     # Reusable components
β”‚   β”‚   β”œβ”€β”€ /pages          # Page components
β”‚   β”‚   β”œβ”€β”€ /context        # React Context (Auth, Cart)
β”‚   β”‚   β”œβ”€β”€ /styles         # CSS files
β”‚   β”‚   └── App.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ /server                 # Node.js Backend
β”‚   β”œβ”€β”€ /models             # MongoDB models
β”‚   β”œβ”€β”€ /routes             # API routes
β”‚   β”œβ”€β”€ /middleware         # Auth middleware
β”‚   β”œβ”€β”€ server.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ /legacy                 # Old HTML files (backup)
└── package.json            # Root monorepo config

🎨 Design System

Color Palette (Nature-Inspired)

  • Primary: Warm amber/copper tones (#f59e0b, #d97706)
  • Accents: Sunset orange (#fb923c), steel gray (#71717a)
  • NO blues or indigos (following constraint-based design)

Border Radius (Unconventional)

  • Small: 5px (not 8px)
  • Medium: 14px (not 12px)
  • Large: 22px (not 16px or 24px)
  • Extra Large: 38px (not 32px or 40px)

Gradients

  • Sunrise-inspired: Orange β†’ Amber β†’ Yellow
  • Metallic: Copper β†’ Amber
  • Steel: Light gray β†’ Dark gray

πŸ› οΈ Features

Frontend (React)

  • βœ… Responsive navigation with mobile menu
  • βœ… Product browsing with category filtering
  • βœ… Shopping cart management
  • βœ… User authentication (login/signup)
  • βœ… Protected routes
  • βœ… Context API for state management

Backend (Node.js/Express)

  • βœ… RESTful API
  • βœ… JWT authentication
  • βœ… MongoDB integration
  • βœ… Product CRUD operations
  • βœ… Contact form management
  • βœ… Role-based access control (Admin/User)

πŸ“‘ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user

Products

  • GET /api/products - Get all products (public)
  • GET /api/products/:id - Get single product
  • POST /api/products - Create product (admin only)
  • PUT /api/products/:id - Update product (admin only)
  • DELETE /api/products/:id - Delete product (admin only)

Contact

  • POST /api/contact - Submit contact form
  • GET /api/contact - Get all submissions (admin only)
  • PUT /api/contact/:id - Update submission status (admin only)

πŸ” Default Admin Account

Email: [email protected]
Password: admin123

⚠️ Change this in production!


πŸ§ͺ Development

Server Only

cd server
npm run dev    # Uses nodemon for auto-restart

Client Only

cd client
npm start      # React dev server with hot reload

Build for Production

npm run build  # Creates optimized production build in client/build

🚒 Deployment

Backend

  • Deploy /server to Heroku, Railway, or Render
  • Set environment variables
  • Ensure MongoDB Atlas IP whitelist includes deployment server

Frontend

  • Deploy /client/build to Netlify, Vercel, or similar
  • Update API base URL if not using proxy

πŸ“ Scripts

Command Description
npm run dev Run both client and server concurrently
npm run server Run backend server only
npm run client Run frontend client only
npm run install:all Install dependencies for all packages
npm run build Build React app for production

🎯 Tech Stack

Frontend

  • React 19.2
  • React Router DOM 7
  • Axios
  • Context API
  • CSS3 (Custom design system)

Backend

  • Node.js
  • Express.js 4.21
  • MongoDB + Mongoose 8.13
  • JWT Authentication
  • bcryptjs

πŸ”„ Migration from v1.0

Old HTML files are preserved in /legacy folder. The new React architecture provides:

  • Better state management
  • Improved performance
  • Modern development experience
  • E-commerce capabilities
  • Scalable component architecture

πŸ“ž Contact

Kulswamini Grinding Works
Ground Floor Plot No.268, Near Thakur Engg Work
Pokhran Road No.01, Thane - 400606

πŸ“ž +91 8104999122
βœ‰οΈ [email protected]


πŸ“„ License

Copyright Β© 2025 Kulswamini Grinding Works. All rights reserved.


Built with ❀️ using React + Node.js

About

Ecomm Website

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors