Skip to content

Latest commit

Β 

History

60 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FreshIn10 πŸ›’βš‘

Ultra-fast grocery delivery platform β€” groceries in 10 minutes.

Built with Next.js 15, TypeScript, Prisma, PostgreSQL, Razorpay, Socket.io, and Tailwind CSS in a Turborepo monorepo.


πŸ“– New Here? Start Here!

πŸ‘‰ START_HERE.md - Complete navigation guide to all documentation

Quick Links:


Project Structure

freshin10/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/          # Customer frontend (Next.js 15) β€” port 3000
β”‚   β”œβ”€β”€ admin/        # Admin dashboard (Next.js 15) β€” port 3001
β”‚   β”œβ”€β”€ delivery/     # Delivery partner app (Next.js 15) β€” port 3002
β”‚   └── api/          # Backend API (Express + Socket.io) β€” port 3003
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ ui/           # Shared UI components
β”‚   └── utils/        # Shared utilities, validators, constants
β”œβ”€β”€ .env.example
└── turbo.json

Tech Stack

Layer Technology
Frontend Next.js 15 (App Router), TypeScript, Tailwind CSS
State Zustand
Animations Framer Motion
Backend Express.js, TypeScript
Database PostgreSQL + Prisma ORM
Auth JWT (access + refresh tokens)
Payments Razorpay
Real-time Socket.io
Monorepo Turborepo

πŸš€ Quick Start

Windows Users (Easiest Way)

  1. Install dependencies: npm install
  2. Setup database: Double-click setup-database.bat
  3. Start everything: Double-click start-all.bat
  4. Open browser: http://localhost:3000

Or start apps separately:

  • Backend: start-backend.bat
  • Customer App: start-frontend-web.bat
  • Admin Dashboard: start-frontend-admin.bat
  • Delivery App: start-frontend-delivery.bat

Manual Setup

  1. Install dependencies:

    npm install
  2. Setup environment:

    cp .env apps/api/.env
    # Edit apps/api/.env with your values
  3. Setup database:

    cd apps/api
    npm run db:generate
    npm run db:push
    npm run db:seed
  4. Start development:

    # From root directory
    npm run dev

πŸ“š Detailed Guides

  • ⚑ Quick Start: See QUICK_START.md - Get running in 5 minutes
  • πŸ”§ Run Separately: See RUN_SEPARATELY.md - Run backend/frontend independently
  • πŸ—οΈ Architecture: See ARCHITECTURE.md - Understand the system design

Default Credentials (after seeding)

Role Email Password
Admin admin@freshin10.com Admin@123

API Endpoints

Auth

POST /api/auth/register
POST /api/auth/login
POST /api/auth/refresh
POST /api/auth/logout
GET  /api/auth/me
POST /api/auth/send-otp

Products

GET  /api/products
GET  /api/products/search?q=
GET  /api/products/featured
GET  /api/products/trending
GET  /api/products/:id

Cart

GET    /api/cart
POST   /api/cart/add
PUT    /api/cart/update
DELETE /api/cart/remove/:productId
DELETE /api/cart/clear

Orders

POST /api/orders/create
GET  /api/orders/history
GET  /api/orders/track/:id
POST /api/orders/:id/cancel

Payment

POST /api/payment/create-order
POST /api/payment/verify

Admin (requires ADMIN role)

GET  /api/admin/dashboard
GET  /api/admin/products
POST /api/admin/products
PUT  /api/admin/products/:id
GET  /api/admin/orders
PUT  /api/admin/orders/:id/status
GET  /api/admin/users
POST /api/admin/coupons

Deployment

Frontend (Vercel)

  1. Connect your GitHub repo to Vercel
  2. Set root directory to apps/web (or apps/admin)
  3. Add environment variables
  4. Deploy

Backend (Railway)

  1. Create a new Railway project
  2. Connect GitHub repo, set root to apps/api
  3. Add environment variables
  4. Railway auto-detects Node.js

Database (Supabase)

  1. Create a Supabase project
  2. Copy the connection string to DATABASE_URL
  3. Run npm run db:push

Features

Customer App

  • 🏠 Premium homepage with hero, categories, offers, trending products
  • πŸ” Real-time search with autocomplete
  • πŸ›’ Cart with live updates + mobile sticky bar
  • πŸ’³ Razorpay + COD + Wallet payments
  • πŸ“ Address management
  • 🎟️ Coupon system
  • πŸ“¦ Order tracking with real-time updates
  • ❀️ Wishlist
  • ⭐ Product reviews
  • πŸ”” Notifications

Admin Dashboard

  • πŸ“Š Revenue & orders analytics with charts
  • πŸ“¦ Products CRUD with inventory management
  • πŸ›οΈ Order management with status updates
  • πŸ‘₯ User management
  • 🎟️ Coupon management
  • ⚠️ Low stock alerts
  • 🚚 Delivery partner management

Delivery Partner App

  • πŸ“± Mobile-optimized PWA
  • 🟒 Online/Offline toggle
  • πŸ“‹ Active orders list
  • βœ… Pickup & delivery confirmation
  • πŸ—ΊοΈ Google Maps navigation
  • πŸ’° Earnings dashboard
  • πŸ“‘ Real-time location tracking

Socket Events

Event Direction Description
order:created Server β†’ Customer New order placed
order:confirmed Server β†’ Customer Payment confirmed
order:status Server β†’ Customer Status update
order:delivered Server β†’ Customer Order delivered
order:new Server β†’ Admin New order alert
delivery:location Partner β†’ Server Location update

License

MIT Β© FreshIn10

About

πŸ›’ A production-grade 10-minute grocery delivery platform. Features a Next.js monorepo powering Customer, Admin, and Delivery apps with real-time Socket.io tracking.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages