From 2db4aa30e9e99f1620e5285fbfccd8fcc2ecd12e Mon Sep 17 00:00:00 2001
From: arjun544
Date: Fri, 5 Jun 2026 23:49:44 +0500
Subject: [PATCH 1/2] feat: implement usage tracking API and display real-time
platform statistics on landing page
---
app/api/track/route.ts | 5 +++++
app/components/landing/StatsSection.tsx | 17 ++++++++---------
app/page.tsx | 5 +++++
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/app/api/track/route.ts b/app/api/track/route.ts
index 9d73a90..77aa1e9 100644
--- a/app/api/track/route.ts
+++ b/app/api/track/route.ts
@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from "next/server"
+import { revalidatePath } from "next/cache"
import { architectureSchema, navigationSchema, stateManagementSchema } from "@/app/lib/config/schema"
import { createPublishableSupabaseClient } from "@/app/lib/supabase/server"
@@ -86,6 +87,10 @@ export async function POST(req: NextRequest) {
return NextResponse.json({ error: "track_failed" }, { status: 503 })
}
+ // Bust the landing page ISR cache so the next visitor sees updated stats
+ // immediately rather than waiting up to 60 seconds.
+ revalidatePath("/")
+
return NextResponse.json({ ok: true }, { status: 202 })
} catch {
return NextResponse.json({ error: "track_failed" }, { status: 503 })
diff --git a/app/components/landing/StatsSection.tsx b/app/components/landing/StatsSection.tsx
index f685bac..7e30e97 100644
--- a/app/components/landing/StatsSection.tsx
+++ b/app/components/landing/StatsSection.tsx
@@ -1,3 +1,4 @@
+import { createPublishableSupabaseClient } from "@/app/lib/supabase/server"
import { StatsShowcase, StatsShowcaseSkeleton } from "@/app/components/landing/StatsShowcase"
type StatsResponse = {
@@ -14,17 +15,15 @@ type StatsResponse = {
dark_mode_enabled?: number
}
-
async function getStats(): Promise {
try {
- const res = await fetch(`${process.env.NEXT_PUBLIC_VERCEL_URL}/api/stats`, {
- // next: {
- // revalidate: 60,
- // tags: ["generator-stats"],
- // },
- })
- if (!res.ok) return null
- return (await res.json()) as StatsResponse
+ const supabase = createPublishableSupabaseClient()
+ const { data, error } = await supabase
+ .from("stats_summary")
+ .select("*")
+ .single()
+ if (error) return null
+ return data as StatsResponse
} catch {
return null
}
diff --git a/app/page.tsx b/app/page.tsx
index b2c843b..7054a35 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -4,6 +4,11 @@ import { Footer } from "@/app/components/landing/Footer"
import { StatsSection, StatsSectionSkeleton } from "@/app/components/landing/StatsSection"
import { Suspense } from "react"
+// Re-render this page (and re-fetch stats from Supabase) at most every 60 seconds.
+// Without this, Next.js statically renders the page once at build time and the
+// stats count would stay frozen forever regardless of new generations.
+export const revalidate = 60
+
export default function Page() {
return (
From 9048d020ed82ccf61bfcf2f8d50271b02bd90cfe Mon Sep 17 00:00:00 2001
From: arjun544
Date: Sat, 13 Jun 2026 10:16:18 +0500
Subject: [PATCH 2/2] feat: add AppConfig template for multi-provider backend
support and update README documentation
---
README.md | 164 +++++++++++-------
docs/testing.md | 2 +-
.../base/lib/src/config/app_config.dart.hbs | 2 +-
3 files changed, 103 insertions(+), 65 deletions(-)
diff --git a/README.md b/README.md
index a27cb9c..6062b09 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,6 @@
-
@@ -26,13 +25,13 @@
-
+
|
|
-
+
|
@@ -45,68 +44,84 @@
---
-## ποΈ The Architecture of Speed
+**No installation required.** Open **[flutterinit.com](https://flutterinit.com)** and generate.
-**FlutterInit** is an open-source project designed to eliminate the "initial drag" of Flutter development. It provides a highly opinionated yet flexible scaffolding system that maps your architectural vision to a production-ready codebase in seconds.
+## ποΈ What is FlutterInit?
-### π― Why use FlutterInit?
-- **Elite Quality**: Follows `flutter_lints`, SOLID principles, and validated against a comprehensive matrix of critical architectural combinations.
-- **Extreme Speed**: From a blank screen to a running app with routing & state in < 60s.
-- **Enterprise DNA**: Pre-configured with logging, error handling, and environment management.
+FlutterInit is a web-based scaffolding engine for Flutter.
+
+You visit flutterinit.com, pick your architecture, state management, backend, and navigation style β and FlutterInit generates a production-ready Flutter project as a downloadable zip.
+
+No templates to clone. No CLI to install. Open the dashboard, configure, download, build.
---
-## π οΈ Prerequisites
+## π How It Works
-Ensure your environment meets these requirements before starting:
+1. Open **[flutterinit.com](https://flutterinit.com)**
+2. Name your project and choose your options:
+ - **Architecture:** Clean Architecture, MVVM, Feature-First
+ - **State Management:** Riverpod, Bloc, Provider, GetX, MobX
+ - **Backend:** Firebase, Supabase, Appwrite, or none
+ - **Navigation:** GoRouter, AutoRoute, or imperative
+ - **Design:** Material 3, dark mode, ScreenUtil
+ - **Extras:** localization, logging, permissions, image picker, etc.
+3. Click **"Generate Project"**
+4. Download the `.zip`
+5. Unzip β `cd` into the folder β run `flutter pub get` β `flutter run`
+
+---
-* **Flutter SDK**: `^3.5.0` (Latest Stable recommended)
-* **Runtime**: [Node.js](https://nodejs.org/) `^20.0.0` or [Bun](https://bun.sh/) `^1.1.0`
-* **Platforms**: macOS, Windows (WSL2 recommended), or Linux
+## π¦ What's Inside the Generated Project?
+
+Every generated project includes:
+- Folder structure matching your chosen architecture
+- Routing pre-configured with your chosen navigation package
+- State management boilerplate set up and ready to extend
+- `pubspec.yaml` with all chosen dependencies declared
+- Environment config (`.env` support via `flutter_dotenv`)
+- Logging, error handling, and base network layer (if Dio selected)
+- Material 3 theme with dark mode support
+- AI context files: `CLAUDE.md`, `AGENTS.md`, `.cursorrules` β pre-written for your exact stack so AI editors have full project context from day one
+
+---
## β‘ Quick Start
-Get your professional Flutter scaffold running in 3 steps:
+**No installation required.**
+
+1. Go to **[flutterinit.com](https://flutterinit.com)**
+2. Configure your stack using the visual dashboard
+3. Click **Generate Project** and download your `.zip`
+4. Unzip and run:
-1. **Clone & Install**:
- ```bash
- git clone https://github.com/Arjun544/flutter_init.git
- cd flutter_init && bun install
- ```
-2. **Launch Dashboard**:
- ```bash
- bun run dev
- ```
-3. **Generate**: Open `http://localhost:3000`, pick your stack, and download your `.zip`.
+```bash
+cd your_project_name
+flutter pub get
+flutter run
+```
+
+That's it. Your project is ready.
---
-## β¨ Features (Elevated)
-
-
-
-
- π Zero Boilerplate
- Forget the 4-hour setup. We generate the folder structure, base classes, and core utilities so you can focus on building features.
- |
-
- ποΈ Architecture First
- Optimized for Clean Architecture, MVVM, and Feature-First structures. The engine adapts to your team's mental model.
- |
-
-
-
- π¨ Design System Ready
- Material 3 tokens, dark mode support, and responsive scaling (via ScreenUtil) are baked into every scaffold.
- |
-
- βοΈ Industrial Strength
- Includes an intuitive Web Dashboard for managing your project lifecycle from initialization to deployment.
- |
-
-
-
-### π§© Support Matrix
+## π οΈ Prerequisites
+
+### To use a generated project
+- Flutter SDK `^3.5.0` ([install guide](https://docs.flutter.dev/get-started/install))
+
+No other tools required. FlutterInit runs in your browser.
+
+### To run FlutterInit locally (contributors only)
+- Node.js `^20.0.0` or Bun `^1.1.0`
+- Flutter SDK (for running `dart analyze` on generated output during testing)
+- See [CONTRIBUTING.md](CONTRIBUTING.md) for full setup
+
+---
+
+## π§© Support Matrix
+
+You configure all of these options directly in the dashboard β no config files, no flags. The matrix below shows every supported option.
| Category | Supported Options |
| :--- | :--- |
@@ -123,8 +138,22 @@ Get your professional Flutter scaffold running in 3 steps:
---
+## π€ AI-Ready From Day One
+
+Every generated project includes pre-written AI context files tailored to your exact stack:
+
+- `CLAUDE.md` β for Claude Code
+- `AGENTS.md` β for Codex and other agent workflows
+- `.cursor/rules/flutter-project.mdc` β for Cursor
+
+These files give your AI editor full context about your architecture, state management pattern, folder structure, and conventions β without you having to write a single prompt.
+
+---
+
## π Documentation
+New to FlutterInit? Start with the [Getting Started Guide](docs/getting-started.md).
+
Explore our technical guides to understand the architecture and flags:
* **[Getting Started Guide](docs/getting-started.md)**: From download to first successful run.
@@ -137,26 +166,35 @@ Explore our technical guides to understand the architecture and flags:
---
-## π€ Contribution-Based Growth
+## πΊοΈ Roadmap
+
+We use GitHub Projects to track what's in progress and what's coming next.
-This repository is built on the principle of **Contribution Based Evolution**. We don't just want users; we want architects.
+π [View the FlutterInit Roadmap](https://github.com/users/Arjun544/projects/1)
-- **Submit Patterns**: Add architectural overlays (Layer-First, MVC, MVVM) to the `templates/` directory.
-- **Refine the Core**: Improve the Next.js visual wizard or generator logic in `app/lib/`.
-- **Bug Hunter**: Help us identify and fix synchronization issues in the template dev loop.
-- **Template Dev**: Learn our real-time [Template Dev workflow](docs/template-development.md).
+Want to contribute? Pick up any open issue labeled [`good first issue`](https://github.com/Arjun544/flutter_init/issues?q=label%3A%22good+first+issue%22).
-> [!TIP]
-> Every contributor who gets a PR merged receives a special place in our contributors' hall of fame.
---
-## πΊοΈ Roadmap
+## π§βπ» Running FlutterInit Locally (Contributors)
-We use GitHub Projects to track what's in progress and what's coming next.
+If you want to contribute to FlutterInit's engine or templates, you'll need to run it locally.
-π [View the FlutterInit Roadmap](https://github.com/users/Arjun544/projects/1)
+**Clone & install:**
+```bash
+git clone https://github.com/Arjun544/flutter_init.git
+cd flutter_init
+bun install
+```
-Want to contribute? Pick up any open issue labeled [`good first issue`](https://github.com/Arjun544/flutter_init/issues?q=label%3A%22good+first+issue%22).
+**Start the development server:**
+```bash
+bun run dev
+```
+
+Open `http://localhost:3000` to use the local dashboard.
+
+See [CONTRIBUTING.md](CONTRIBUTING.md) and the [Architecture Overview](docs/architecture.md) for how the Handlebars templating engine works.
---
diff --git a/docs/testing.md b/docs/testing.md
index 2339e0e..2febcc6 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -226,7 +226,7 @@ When a test fails in GitHub Actions, these detailed logs are preserved as artifa
If a specific combination fails (e.g., `layer-first|none|none|auto_route`):
```bash
# Generate and debug a specific combo
-bun scripts/validate-dart.ts --combo "layer-first|none|none|auto_route" --keep-output
+bun scripts/validate-dart.ts --combo "mvvm|bloc|supabase|auto_route" --keep-output
```
Inspect the generated code in `./.temp/flutterinit/` and run `dart analyze` manually.
diff --git a/templates/flutter/base/lib/src/config/app_config.dart.hbs b/templates/flutter/base/lib/src/config/app_config.dart.hbs
index 3976328..e2e967f 100644
--- a/templates/flutter/base/lib/src/config/app_config.dart.hbs
+++ b/templates/flutter/base/lib/src/config/app_config.dart.hbs
@@ -59,7 +59,7 @@ class AppConfig {
{{#if (eq backend.provider "supabase")}}
await Supabase.initialize(
url: dotenv.get('SUPABASE_URL', fallback: 'https://YOUR-PROJECT.supabase.co'),
- anonKey: dotenv.get('SUPABASE_ANON_KEY', fallback: 'YOUR-ANON-KEY'),
+ publishableKey: dotenv.get('SUPABASE_ANON_KEY', fallback: 'YOUR-ANON-KEY'),
);
supabase = Supabase.instance.client;
{{/if}}