Inflate Web App Plan

1. App Overview

2. User Roles & Dashboards

2.1 Admin

Core Capabilities

Phase 2 Enhancements

2.2 Merchant

Core Capabilities

Phase 2 Enhancements

2.3 Customer

Core Capabilities

Form fields: First/Last Name, Mobile, Email, Birthday, Gender, Current Credit Balance, QR Code

Phase 2 Enhancements

3. Data Models (Prisma Schema Sketch)

model User {
  id          Int       @id @default(autoincrement())
  role        Role
  firstName   String
  lastName    String
  email       String    @unique
  mobile      String
  birthday    DateTime?
  gender      Gender?
  credits     Int       @default(0)
  qrCode      String?
  merchant    Merchant?
  transactions Transaction[]
}

model Merchant {
  id            Int           @id @default(autoincrement())
  user          User          @relation(fields: [userId], references: [id])
  userId        Int
  packages      CreditPackage[]
  transactions  Transaction[]
  isBlocked     Boolean       @default(false)
}

model CreditPackage {
  id          Int       @id @default(autoincrement())
  merchant    Merchant  @relation(fields: [merchantId], references: [id])
  merchantId  Int
  name        String
  credits     Int
  priceCents  Int
  expiresAt   DateTime?
}

model Transaction {
  id               Int         @id @default(autoincrement())
  type             TransactionType
  date             DateTime    @default(now())
  amount           Int
  user             User        @relation(fields: [userId], references: [id])
  userId           Int
  merchant         Merchant?   @relation(fields: [merchantId], references: [id])
  merchantId       Int?
  postBalance      Int
  creditPackage    CreditPackage? @relation(fields: [packageId], references: [id])
  packageId        Int?
}

enum Role    { ADMIN MERCHANT CUSTOMER }
enum Gender  { MALE FEMALE OTHER }
enum TransactionType { PURCHASE REDEMPTION REFUND }

4. Core Flows & API Routes

FeatureAPI RouteMethodAuth
Register / Login (SMS OTP)/api/auth/otp/sendPOSTpublic
Verify OTP/api/auth/otp/verifyPOSTpublic
Password reset (email)/api/auth/password-resetPOSTpublic
CRUD credit packages/api/merchant/packagesGET/POST/PUT/DELETEmerchant
Purchase credits/api/customer/purchasePOSTcustomer
Redeem credits (QR scan)/api/customer/redeemPOSTcustomer
Fetch transaction history/api/transactionsGETany logged-in
Admin load credits/api/admin/load-creditsPOSTadmin
User profile (view/edit)/api/user/profileGET/PUTany logged-in
Delete user account/api/userDELETEany logged-in

5. Phase 2 Features & Roadmap

  1. Security & Privacy: 2FA, role-based access control, field encryption
  2. UX Enhancements: Onboarding/tutorial modals; Map view for merchant discovery; Ratings & reviews
  3. Analytics & Reporting: Admin fraud detection; Merchant sales trends
  4. Monetization: Per-transaction merchant fee; Merchant premium subscriptions

6. Development Plan & Milestones

SprintGoals
1Project setup, auth (OTP & email), user models
2Merchant flows: packages CRUD + dashboard basics
3Customer flows: purchase, redeem, transaction history
4Admin flows: load credits, global dashboards
5Polish UI, add Tailwind components, basic styling
6Testing: end-to-end, security, performance
7+Phase 2 features (analytics, map, notifications)