Skip to content

Rofiq354/mini-store

Repository files navigation

🏪 GeraiKu - Digital Store Management

GeraiKu Logo

Solusi Digital untuk UMKM Indonesia 🇮🇩

Next.js Supabase Prisma TypeScript Tailwind CSS Zod Biome

Platform manajemen toko & kasir digital yang membantu pedagang kecil mengelola bisnis dengan lebih mudah

DemoDocumentationReport Bug


📖 Tentang Project

GeraiKu adalah aplikasi Point of Sale (POS) dan inventory management yang dirancang khusus untuk UMKM dan warung tradisional Indonesia. Dengan antarmuka yang sederhana namun powerful, GeraiKu membantu pedagang:

  • ✅ Mencatat transaksi penjualan secara digital
  • 📦 Mengelola stok barang dengan mudah
  • 💰 Memantau pendapatan harian/bulanan
  • 📊 Mendapatkan insights bisnis yang berguna

🎯 Target Pengguna

  • Merchant: Pemilik warung, toko kelontong, UMKM
  • Customer: Pembeli yang berbelanja di toko merchant

🚀 Tech Stack

Frontend

  • Next.js 16 - React framework dengan App Router
  • TypeScript - Type safety
  • Tailwind CSS - Utility-first styling
  • Shadcn UI - Beautiful & accessible components

Backend & Database

  • Supabase - PostgreSQL database + Auth + Storage
  • Supabase Auth - Authentication dengan PKCE flow
  • Prisma ORM - Type-safe database client for manage schema and query
  • Row Level Security (RLS) - Data security per user

Tools & Utilities

  • Zod - TypeScript-first schema validation for form and API
  • Biome - High-performance linter & formatter (pengganti ESLint & Prettier)
  • Vercel - Deployment platform

📅 Development Progress

🗓️ Week 1: Foundation & Core Features

📍 Day 1 - Authentication System

✨ What's Done

  • Supabase project setup & configuration
  • Database schema design (initial tables)
  • Authentication flow implementation
    • Sign up (Email/Password)
    • Sign in (Email/Password + Google OAuth)
    • Email verification
    • Password reset
  • User roles system (Customer & Merchant)
  • Protected routes with middleware
  • Auth UI components with Shadcn
    • Login form
    • Register form
    • Role selection

🐛 Known Issues

  • Google OAuth redirect needs production URL setup
  • Email verification template customization pending
📍 Day 2 - Product Catalog ⏳ (In Progress)

🎯 Goals

  • Product CRUD operations
  • Image upload to Supabase Storage
  • Product categories
  • Low stock alerts
  • Search & filter functionality
📍 Day 3 - POS System 🔜

🎯 Planned Features

  • Transaction creation
  • Cart management
  • Multiple payment methods
  • Receipt generation
  • Stock auto-deduction
📍 Day 4 - Sales Dashboard 🔜

🎯 Planned Features

  • Revenue charts
  • Transaction history
  • Top products analytics
  • Daily/monthly reports
📍 Day 5 - Customer Features 🔜

🎯 Planned Features

  • Product browsing
  • Shopping cart
  • Order placement
  • Order history
📍 Day 6 - Polish & Testing 🔜

🎯 Planned Features

  • Mobile responsiveness check
  • Performance optimization
  • Error handling improvements
  • User testing feedback
📍 Day 7 - Deployment 🔜

🎯 Planned Features

  • Production environment setup
  • Vercel deployment
  • Domain configuration
  • Documentation finalization

🗄️ Database Schema (Supabase/PostgreSQL)

-- Core Tables

-- WARNING: This schema is for context only and is not meant to be run.
-- Table order and constraints may not be valid for execution.

CREATE TABLE public.products (
  id uuid NOT NULL DEFAULT gen_random_uuid(),
  merchant_id uuid NOT NULL,
  name text NOT NULL,
  description text,
  price numeric NOT NULL CHECK (price >= 0::numeric),
  stock integer DEFAULT 0 CHECK (stock >= 0),
  category text,
  image_url text,
  created_at timestamp with time zone DEFAULT timezone('utc'::text, now()),
  CONSTRAINT products_pkey PRIMARY KEY (id),
  CONSTRAINT products_merchant_id_fkey FOREIGN KEY (merchant_id) REFERENCES public.profiles(id)
);
CREATE TABLE public.profiles (
  id uuid NOT NULL,
  full_name text,
  email text UNIQUE,
  phone_number text,
  avatar_url text,
  role USER-DEFINED DEFAULT 'customer'::user_role,
  shop_name text,
  business_address text,
  updated_at timestamp with time zone DEFAULT now(),
  description text,
  is_active boolean DEFAULT true,
  is_verified boolean DEFAULT false,
  created_at timestamp with time zone DEFAULT now(),
  CONSTRAINT profiles_pkey PRIMARY KEY (id),
  CONSTRAINT profiles_id_fkey FOREIGN KEY (id) REFERENCES auth.users(id)
);
CREATE TABLE public.transaction_items (
  id uuid NOT NULL DEFAULT gen_random_uuid(),
  transaction_id uuid NOT NULL,
  product_id uuid NOT NULL,
  quantity integer NOT NULL CHECK (quantity > 0),
  price_at_time numeric NOT NULL,
  CONSTRAINT transaction_items_pkey PRIMARY KEY (id),
  CONSTRAINT transaction_items_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.transactions(id),
  CONSTRAINT transaction_items_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.products(id)
);
CREATE TABLE public.transactions (
  id uuid NOT NULL DEFAULT gen_random_uuid(),
  merchant_id uuid NOT NULL,
  total_price numeric NOT NULL DEFAULT 0,
  payment_method text DEFAULT 'cash'::text CHECK (payment_method = ANY (ARRAY['cash'::text, 'transfer'::text, 'qris'::text])),
  created_at timestamp with time zone DEFAULT timezone('utc'::text, now()),
  CONSTRAINT transactions_pkey PRIMARY KEY (id),
  CONSTRAINT transactions_merchant_id_fkey FOREIGN KEY (merchant_id) REFERENCES public.profiles(id)
);

🚀 Getting Started

Prerequisites

  • Node.js 18+ installed
  • Supabase account
  • Git installed

Installation

  1. Clone the repository

    git clone https://github.com/Rofiq354/mini-store.git
    cd geraiku
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Setup environment variables

    cp .env.example .env.local

    Fill in your Supabase credentials:

    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
  4. Run the development server

    npm run dev
  5. Open http://localhost:3000 in your browser 🎉


📁 Project Structure

geraiku/
├── app/
│   ├── (auth)/                # Route Group untuk login & register
│   │   ├── login/
│   │   │   └── page.tsx
│   │   └── signup/
│   │       └── page.tsx
│   ├── (admin)/               # Route Group khusus Admin
│   │   ├── dashboard/
│   ├── (user)/                # Route Group khusus User/Customer
│   │   ├── profile/
│   │   └── orders/
│   ├── validation/            # Folder untuk skema Zod
│   │   └── auth.schema.ts
│   ├── api/
│   ├── layout.tsx
│   └── page.tsx               # Landing page utama
├── components/
│   ├── ui/                    # Shadcn UI components
│   ├── Logo.tsx               # Komponen Logo
│   └── Navbar.tsx             # Komponen Navbar
├── lib/
│   ├── supabase/              # Konfigurasi Supabase
│   │   ├── client.ts
│   │   └── server.ts
│   ├── prisma.ts              # Database client
│   └── utils.ts               # Utility (cn untuk Tailwind, dll)
└── types/                     # TypeScript types/interfaces

🎨 Design Principles

Mobile-First 📱

Pedagang lebih sering menggunakan HP daripada laptop - UI dioptimalkan untuk layar kecil terlebih dahulu.

High Contrast 🌞

Mudah dibaca di bawah sinar matahari (penting untuk pedagang pasar/kaki lima).

Minimalist ✨

Menghindari istilah akuntansi yang rumit. Gunakan bahasa sehari-hari:

  • ✅ "Uang Masuk" (bukan "Revenue")
  • ✅ "Barang Terjual" (bukan "Items Sold")
  • ✅ "Stok Menipis" (bukan "Low Inventory Alert")

🗺️ Roadmap

Phase 1: MVP (Week 1) 🎯

  • Authentication system
  • Product management
  • Basic POS
  • Sales dashboard

Phase 2: Enhancement (Week 2)

  • Advanced analytics
  • Multi-store support
  • Employee management
  • Expense tracking

Phase 3: Advanced Features (Week 3)

  • Mobile app (React Native)
  • Loyalty program
  • WhatsApp integration
  • Payment gateway integration

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

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


👨‍💻 Author

Ainur Rofiq


🙏 Acknowledgments


Made with ❤️ for Indonesian UMKM

⭐ Star this repo if you find it helpful!

About

Mini store platform for local SME shops. Browse products, get real-time stock updates, cart & checkout, pay via Midtrans, and track orders. Sellers can manage products, orders, revenue, and delivery status in one place.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages