Skip to content

Azhao15/mock_saas

Repository files navigation

Mock SaaS - Tiny SaaS Starter

A minimal demo SaaS application built with Next.js, designed for testing AI issue resolution and showcasing common patterns in early-stage SaaS products.

Tech Stack

  • Next.js 16 (App Router)
  • TypeScript
  • Tailwind CSS
  • Vitest for testing

Getting Started

Install dependencies and run the development server:

npm install
npm run dev

Open http://localhost:3000 to view the app.

Run tests:

npm test

Routes

Public Routes

  • / - Landing page with basic marketing content
  • /login - Login/signup page with toggle between modes

Protected Routes

  • /dashboard - Main dashboard (has beta version via feature flag)
  • /settings - User account settings and preferences
  • /onboarding - Post-signup onboarding flow

API Routes

  • POST /api/login - User authentication
  • POST /api/signup - User registration with onboarding redirect

Features

Mock User System

Users are stored in-memory with the following structure:

  • id, email, name, plan (free/pro/enterprise)
  • Optional preferences object (theme, emailNotifications, language)

Demo users available:

  • demo@example.com - Free plan user (no preferences)
  • pro@example.com - Pro plan user (has preferences)

Feature Flags

Feature flags are managed in lib/featureFlags.ts:

  • ENABLE_BETA_DASHBOARD - Shows enhanced dashboard UI with gradient backgrounds, additional stats, and quick actions panel

Toggle flags by editing the featureFlags object directly.

Onboarding Flow

New users are redirected to /onboarding after signup. The flow shows placeholder content about workspace setup with Continue/Skip options.

Project Structure

/app
  /api
    /login          # Authentication endpoint
    /signup         # Registration endpoint
  /dashboard        # Main dashboard with feature flag
  /login            # Login/signup page
  /onboarding       # Post-signup flow
  /settings         # User settings
  page.tsx          # Landing page

/lib
  mockData.ts       # In-memory user storage
  featureFlags.ts   # Feature flag configuration

Known Issues

  • Settings page crashes for users without preferences defined
  • API error responses are inconsistent between login and signup endpoints
  • No test coverage for signup endpoint or onboarding flow
  • Onboarding state is not persisted - refreshing the page loses context
  • Feature flag cleanup needed - ENABLE_BETA_DASHBOARD should be removed or made permanent
  • No authentication state management - users can access protected routes directly

Development Notes

This is a demo application intentionally kept minimal. Many features are under-specified or have gaps to simulate realistic scenarios for issue tracking and resolution.

Mock data is stored in memory and resets on server restart. No database or persistent storage is configured.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published