GitHub - The-Forge-org/namma_craft · GitHub
Skip to content

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

200 Commits

Folders and files

Repository files navigation

NammaCraft Logo
Tagline



React TypeScript Vite TailwindCSS

Firebase MongoDB Express Capacitor

License Status PRs Welcome PWA


🌐 Live Demo

Netlify


NammaCraft is a full-stack, AI-powered artisan marketplace that bridges India's centuries-old craft traditions with the modern digital economy. Buyers discover authentic handmade goods; artisans gain a voice, a storefront, and fair pricing — powered by Gemini AI.



🖼️ Platform Preview

A premium artisan goods marketplace with cultural discovery, live auctions, AI-assisted pricing, and regional craft maps — built for India's 7 million+ craft artisans.


✨ Feature Highlights

🏛️ Cultural Discovery Engine

Explore crafts by region using an interactive D3.js cultural map of India. Filter by state, craft type, and artisan story. Every product is tied to its origin — not just a SKU.

🔨 Live Auction System

Real-time bidding interface with countdown timers, watcher counts, outbid alerts, and an animated bid stream. Supports auction creation, management, and winner resolution.

🤖 AI-Powered Features

  • Voice Listing (Gemini AI) — Artisans describe their product by voice; Gemini extracts structured product data (name, category, price, origin) via the @google/genai SDK.
  • AI Pricing Suggestions — Estimated price range and demand scoring based on product category and metadata.
  • Sitewide Chat Assistant (Gemini AI) — A Gemini-powered floating assistant embedded across the platform to guide buyers and sellers in real time.

🛍️ Complete Buyer Experience

Full cart → checkout → order tracking flow. Personalized product recommendations, wishlist/favorites, cultural gift bundles, handwritten notes on orders, and a dedicated Buyer Dashboard for order history and account management.

🎨 Multi-Role Dashboard System

Role Dashboard Capabilities
Buyer Buyer Dashboard Browse, cart, wishlist, order history, account
Artisan/Creator Creator Dashboard List products, manage auctions, track sales & earnings
Admin Admin Dashboard Monitor bids, manage users, revenue analytics

🎪 Festival & Cultural Commerce

Seasonal festival homepages (Diwali, etc.), authenticity certificates, traditional food marketplace, artisan story spotlights, and regional artisan profiles.

📱 Mobile App (Android)

Built with Capacitor 8 — the web app is wrapped into a native Android APK. A pre-built APK (namma-craft.apk) is included for direct installation.

🔧 Progressive Web App (PWA)

Installable on desktop and mobile browsers via vite-plugin-pwa. Works offline with service worker caching.

🎬 Live Studio

Live selling sessions where artisans can showcase their craft in real-time, directly from the Creator Dashboard.

📜 Authenticity Certificates

Blockchain-ready certificate generation for handmade goods, verifying artisan origin, craft type, and product authenticity.


🏗️ Architecture Overview

namma_craft/
├── 📁 src/
│   ├── App.tsx                   # Route definitions (React Router v7)
│   ├── AuthContext.tsx           # Firebase Auth + MongoDB user sync
│   ├── db.ts                    # Frontend API service (REST → Express)
│   ├── firebase.ts              # Firebase app init (Auth + Firestore)
│   ├── index.css                # Global styles + Tailwind v4 theme
│   └── components/              # 37 components total
│       ├── AdminDashboard.tsx   # Analytics, user/auction management
│       ├── BuyerDashboard.tsx   # Buyer order history & account
│       ├── CreatorDashboard.tsx # Artisan storefront & earnings
│       ├── LiveAuction.tsx      # Real-time bidding UI
│       ├── AuctionListing.tsx   # Auction browse/filter
│       ├── CreateAuction.tsx    # Auction creation wizard
│       ├── Marketplace.tsx      # Product browse + filters
│       ├── ProductDetail.tsx    # PDP with authenticity cert
│       ├── ArtisanProfile.tsx   # Public artisan page
│       ├── ArtisanStory.tsx     # Individual artisan story page
│       ├── ArtisanSpotlight.tsx # Featured artisan highlight widget
│       ├── Checkout.tsx         # Shipping + payment + tracking
│       ├── CulturalMap.tsx      # D3.js India regional map
│       ├── CulturalDiscovery.tsx# Cultural exploration page
│       ├── TraditionalFoods.tsx # Traditional food section
│       ├── FoodDetail.tsx       # Traditional food product detail
│       ├── AddFoodItem.tsx      # Add traditional food listing
│       ├── FestivalHome.tsx     # Seasonal festival pages
│       ├── VoiceAssistant.tsx   # Gemini voice → product form
│       ├── AIPricingPanel.tsx   # AI price suggestion widget
│       ├── HumanAssistant.tsx   # Sitewide Gemini chat widget
│       ├── LiveStudio.tsx       # Live selling session UI
│       ├── GiftBundles.tsx      # Curated gift sets
│       ├── SellProduct.tsx      # Artisan product listing form
│       ├── CartSidebar.tsx      # Slide-out cart
│       ├── AuthenticityCertificate.tsx # Artisan cert generator
│       ├── FeaturedProducts.tsx # Homepage featured items
│       ├── CategoryGrid.tsx     # Category browse grid
│       ├── Recommendations.tsx  # AI product recommendations
│       ├── Hero.tsx             # Homepage hero section
│       ├── Navbar.tsx           # Responsive navigation
│       ├── Footer.tsx           # Global footer
│       ├── Login.tsx            # Sign in / Sign up
│       ├── FuturePlans.tsx      # Roadmap section
│       ├── HandwrittenNote.tsx  # Personalized order note UI
│       ├── Toast.tsx            # Notification toast system
│       └── NotFound.tsx         # 404 page
│
├── 📁 server/
│   ├── index.ts                 # Express app + all API routes
│   └── models/
│       ├── User.ts              # Mongoose User schema
│       ├── Product.ts           # Mongoose Product schema
│       ├── Order.ts             # Mongoose Order schema
│       ├── Cart.ts              # Mongoose Cart schema
│       └── Favorite.ts          # Mongoose Favorites schema
│
├── 📁 android/                  # Capacitor Android project
├── 📁 public/images/            # Static craft photography assets
├── namma-craft.apk              # Pre-built Android APK
├── capacitor.config.ts          # Capacitor mobile config
├── vite.config.ts               # Vite + Tailwind v4 + PWA config
├── firebase.json                # Firebase Hosting config
├── netlify.toml                 # Netlify deploy config
├── start_all.bat                # Windows: run frontend + backend together
└── package.json

🧰 Tech Stack

Frontend

Technology Version Purpose
React 19.0 UI framework
TypeScript 5.8 Type safety
Vite 6.2 Build tool & dev server
Tailwind CSS v4.1 Utility-first styling
React Router v7 Client-side routing
Motion (Framer) 12 Animations & transitions
Recharts 3.7 Dashboard charts & analytics
D3.js 7.9 Cultural map visualization
Lucide React 0.546 Icon system
clsx 2.1 Conditional class management
tailwind-merge 3.5 Tailwind class conflict resolution

Backend

Technology Version Purpose
Express 4.21 REST API server
Mongoose 9.2 MongoDB ODM
MongoDB Atlas — Primary database
tsx 4.21 TypeScript execution for Node
Zod 4.3 Schema validation & type inference
express-validator 7.3 Request body validation
express-rate-limit 8.3 API rate limiting
better-sqlite3 12.4 Local SQLite (dev/cache)
dotenv 17.2 Environment variable management

Auth & Cloud

Technology Purpose
Firebase Auth Google OAuth sign-in
Firebase Firestore Realtime data (supplemental)
Firebase Admin SDK Server-side token verification
Firebase Hosting Static hosting option
Google Gemini AI Voice-to-product listing & sitewide chat

Mobile & PWA

Technology Version Purpose
Capacitor 8.2 Native Android wrapper
@capacitor/android 8.2 Android platform
@capacitor/assets 3.0 App icon & splash assets
vite-plugin-pwa 1.2 Progressive Web App support

🚀 Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB Atlas account
  • Firebase project
  • Google Gemini API key

1. Clone & Install

git clone https://github.com/mahi-2-ron/namma_craft.git
cd namma_craft
npm install

2. Configure Environment Variables

Create a .env file in the root:

# Gemini AI
GEMINI_API_KEY=your_gemini_api_key_here

# MongoDB
MONGO_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/nammacraft

# Server
PORT=5000

⚠️ Never commit .env to version control. See Security Notes below.

3. Firebase Setup

Update src/firebase.ts with your own Firebase project credentials from the Firebase Console.

4. Run Development Servers

Option A — Run both together (Windows)

start_all.bat

Option B — Run separately

# Terminal 1: Frontend
npm run dev

# Terminal 2: Backend API
npm run server

Frontend runs on → http://localhost:3000
Backend API runs on → http://localhost:5000

5. Build for Production

npm run build

Deploy the dist/ folder to Firebase Hosting or Netlify (configs included).


📱 Mobile (Android)

NammaCraft ships as a native Android app using Capacitor 8.

Install the pre-built APK

Download and install namma-craft.apk directly on any Android device (enable "Install from unknown sources").

Build your own APK

# Sync web build with Capacitor
npm run mobile:sync

# Open in Android Studio
npm run mobile:open

🌐 PWA (Progressive Web App)

NammaCraft is installable as a PWA on desktop and mobile browsers.

  • Visit nammacraft.netlify.app
  • Click "Install" in your browser's address bar
  • App launches offline with service worker caching

📡 API Reference

Base URL: http://localhost:5000/api

Method Endpoint Description
GET /health Server + DB status
POST /users Create/update user after sign-in
GET /users/:uid Get user profile
GET /products List all products
GET /products/:id Get single product
POST /products Add a new product
PUT /products/:id Update product
DELETE /products/:id Delete product
POST /orders Place an order
GET /orders/user/:userId Get user's orders
PATCH /orders/:id/status Update order status
POST /cart Add/update cart item
GET /cart/:userId Get cart items
DELETE /cart/:userId/:productId Remove cart item
DELETE /cart/:userId Clear cart
POST /favorites Add to favorites
DELETE /favorites/:userId/:productId Remove favorite
GET /favorites/:userId Get user favorites

🗺️ Application Routes

Route Component Description
/ Home Landing page with all sections
/marketplace Marketplace Product browse + filters
/artisan ArtisanProfile Artisan public profile
/product/:id ProductDetail Product detail page
/auction LiveAuction Live bidding room
/auction-listing AuctionListing Browse auctions
/create-auction CreateAuction Create new auction
/creator CreatorDashboard Artisan seller dashboard
/sell-product SellProduct New product listing form
/buyer BuyerDashboard Buyer order history & account
/admin AdminDashboard Admin analytics
/checkout Checkout Order & payment flow
/discovery CulturalDiscovery Cultural exploration
/festival-home FestivalHome Festival landing page
/food-detail FoodDetail Traditional food detail
/add-food AddFoodItem Add traditional food
/login Login Sign in
/signup Login Sign up

🔒 Security Notes

These are important considerations for production deployment.

  • Environment Variables: Firebase config and Gemini API key must be stored in .env — never hardcoded in source files.
  • CORS: The backend should be configured with an explicit allowed-origin list rather than a wildcard in production.
  • Rate Limiting: express-rate-limit is configured to protect API endpoints from abuse.
  • Input Validation: express-validator and Zod schemas validate and sanitize all incoming request bodies.
  • Route Protection: Admin and Creator routes should be wrapped with role-based authentication guards before going live.
  • API Security: All write endpoints (POST, PUT, DELETE) should validate Firebase JWT tokens server-side before processing requests (Firebase Admin SDK is included).

🔮 Roadmap

  • Real-time WebSocket auction bidding (Socket.io)
  • Payment gateway integration (Razorpay)
  • iOS app (Capacitor)
  • Artisan video stories
  • Multi-language support (Hindi, Kannada, Tamil, Bengali)
  • Blockchain-backed authenticity certificates
  • AR product preview
  • Artisan co-operative group stores
  • International shipping integrations
  • Push notifications (Firebase Cloud Messaging)

🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m 'feat: add your feature'
  4. Push to the branch: git push origin feature/your-feature
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.



Built with ❤️ to preserve India's artisan heritage


GitHub stars GitHub forks


"Every craft tells a story. NammaCraft makes sure it's heard."

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages