Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
/ vibe-garden Public template

Secure infrastructure for "Vibe Coding" — allowing engineers to use AI Agents to rapidly build internal tools with zero-config security.

Notifications You must be signed in to change notification settings

davigps/vibe-garden

Repository files navigation

Vibe Garden

Secure infrastructure for "Vibe Coding" — allowing engineers to use AI Agents to rapidly build internal tools with zero-config security.

Overview

Vibe Garden is a Next.js monorepo implementing micro-frontends with a Hybrid Data Model and Global Google Workspace Authentication. The platform enables rapid development of internal tools while automatically enforcing security best practices.

Core Philosophy: Zero-Config Security

The goal is to remove security burdens from the "Vibe Coding" process.

The Vibe: "Make a tool for the sales team."
The Guardrail: The generated tool is automatically behind a Google Login screen. The developer does not write auth code. The app does not launch unless the user is a verified employee.

Architecture

Vibe Garden follows a Three-Tier Architecture:

1. Platform Shell (The Gatekeeper)

  • Technology: Next.js + NextAuth.js
  • Role: Handles Google OAuth 2.0 authentication
  • Enforcement: Middleware intercepts all requests, validates sessions, enforces email domain restrictions
  • Location: Root-level Next.js app (to be implemented)

2. Shared Core (The Foundation)

  • @repo/ui: Design system and shared React components
  • @repo/data-global: Read-only access to production database (to be implemented)
  • @repo/data-local: Per-app SQLite database management (to be implemented)
  • @repo/eslint-config: ESLint configurations
  • @repo/typescript-config: TypeScript configurations
  • @repo/tailwind-config: Tailwind CSS configuration

3. Vibe Nodes (The Apps)

  • Technology: Next.js (App Router) + TypeScript
  • Isolation: Each app has its own SQLite database
  • Security: Zero authentication logic — apps consume sessions from Platform Shell
  • Location: apps/* directory

Key Features

🔒 Zero-Config Security

  • Every route automatically behind Google Workspace authentication
  • Email domain validation (@company.com only)
  • No auth code needed in individual apps
  • Automatic access revocation for ex-employees

📊 Hybrid Data Model

  • Global Data: Read-only access to production database

    • Safe for reporting and analytics
    • SELECT-only operations enforced
    • Credentials managed at Platform Shell level
  • Local Data: Per-app SQLite databases

    • Perfect for user-specific configs
    • Tool-specific records
    • Complete data isolation between apps

🚀 Rapid Development

  • Scaffold new apps in seconds
  • Build with AI agents using natural language
  • Automatic routing and authentication
  • Shared component library for consistent UI

Getting Started

Prerequisites

  • Node.js >= 18
  • Google Cloud Console access (for OAuth setup)

Dependencies

The following tools must be installed before setting up the project:

Installation

# Install dependencies
pnpm install

# Start development
pnpm dev

Create Your First Vibe App

# Scaffold a new app (command to be implemented)
npm run create-vibe-app <app-name>

# Example
npm run create-vibe-app sales-dashboard

Project Structure

vibe-garden/
├── apps/
│   ├── template/              # Template for new Vibe Apps
│   └── {app-name}/            # Individual Vibe Apps
│       ├── app/               # Next.js App Router
│       ├── data/              # SQLite database (optional)
│       └── package.json
├── packages/
│   ├── ui/                    # Design system (@repo/ui)
│   ├── data-global/           # Global data access (to be created)
│   ├── data-local/            # Local SQLite access (to be created)
│   ├── eslint-config/         # ESLint configurations
│   ├── typescript-config/     # TypeScript configurations
│   └── tailwind-config/       # Tailwind CSS configuration
├── .ai/                       # AI assistant instructions
├── package.json               # Root package.json
├── pnpm-workspace.yaml        # pnpm workspace configuration
└── turbo.json                 # Turborepo configuration

Development Workflow

1. Create a Vibe App

Scaffold a new app using the template:

npm run create-vibe-app <app-name>

2. Build with AI

Prompt your AI agent:

"Build a dashboard using Global Data to see active users. Let me add notes to each user and save those notes to my local database."

The AI will:

  • Use @repo/ui components for UI
  • Read user data from @repo/data-global
  • Save notes to @repo/data-local
  • Consume session for user identification
  • Follow all security and architecture rules

3. Test Locally

# Start Platform Shell (when implemented)
cd apps/platform-shell
pnpm dev

# Start your Vibe App
cd apps/{app-name}
pnpm dev

4. Deploy

The Platform Shell automatically wraps your new route:

  • No additional configuration needed
  • Route available at: tools.company.com/vibe/{app-name}
  • Authentication enforced automatically

Security Model

Authentication

  • Provider: Google Workspace OAuth 2.0
  • Enforcement: Platform Shell middleware intercepts all requests
  • Validation: Email must end with @company.com (configurable)
  • Session: Managed by NextAuth.js, passed to apps via cookies/headers

Data Isolation

  • Global Data: Read-only, SELECT-only operations
  • Local Data: One SQLite file per app, namespaced by app ID
  • Credentials: Stored in Platform Shell only, never in apps

Access Control

  • No Public Paths: Every route requires authentication
  • Domain Restriction: Only company email addresses allowed
  • Automatic Revocation: Suspended Google Workspace accounts lose access immediately

Package Management

Workspace Protocol

All internal packages use the workspace:* protocol:

{
  "dependencies": {
    "@repo/ui": "workspace:*",
    "@repo/data-global": "workspace:*",
    "@repo/data-local": "workspace:*"
  }
}

Available Scripts

# Development
pnpm dev              # Start all apps in development mode

# Building
pnpm build            # Build all packages and apps

# Code Quality
pnpm lint             # Lint all packages and apps
pnpm check-types      # Type check all packages and apps
pnpm format           # Format code with Prettier

# AI Rules
pnpm update-ai-rules  # Sync .ai/ folder changes to AI assistant

Technology Stack

  • Framework: Next.js 16+ (App Router)
  • Language: TypeScript (strict mode)
  • Styling: Tailwind CSS
  • Package Manager: pnpm with workspaces
  • Build System: Turborepo
  • Authentication: NextAuth.js (Auth.js)
  • Database: PostgreSQL/MySQL (global), SQLite (local)

Documentation

Comprehensive documentation is available in the .ai/ directory:

Setup Guides

Implementation Status

✅ Completed

  • Monorepo structure (Turborepo + pnpm)
  • @repo/ui package with design system
  • @repo/eslint-config, @repo/typescript-config, @repo/tailwind-config
  • Template app structure
  • AI assistant instructions and documentation

⏳ To Be Implemented

  • Platform Shell (authentication gatekeeper)
  • @repo/data-global package (read-only production DB access)
  • @repo/data-local package (per-app SQLite management)
  • Vibe App scaffolding command
  • Production deployment configuration

Contributing

When contributing to Vibe Garden:

  1. Follow Architecture Rules: Maintain the three-tier architecture
  2. Security First: Never implement auth in apps, always use Platform Shell
  3. Data Isolation: Respect app boundaries, never access other apps' data
  4. Use Shared Packages: Leverage @repo/ui and other shared packages
  5. Document Changes: Update relevant .ai/ documentation
    • After updating .ai/ folder contents, run pnpm update-ai-rules to sync changes

Support

For questions or issues, refer to the documentation in .ai/ or contact the platform team.


Built with ❤️ for rapid, secure internal tool development

About

Secure infrastructure for "Vibe Coding" — allowing engineers to use AI Agents to rapidly build internal tools with zero-config security.

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •