GitHub Template Repository — Ready to Use

Build Beautiful Apps.
Share Them With the World.

A welcoming starting point for anyone who wants to turn an idea into a polished Power Apps Code App — whether it's just for you or for thousands across your organization. Powered by Dataverse. Guided by your favorite coding agent. Crafted so your first app feels like your hundredth.

Terminal — Getting Started
# Clone the template and start the wizard (terminal or browser)
$ npx degit martycarreras-psnl/PAppsCAFoundations my-app
$ cd my-app && npm run wizard:ux # ✨ browser experience
# …or stick with the classic terminal flow:
$ cd wizard && npm install && node index.mjs
Prerequisites verified
Project identity captured
Auth profiles created
React + Fluent UI scaffolded
Smoke tests passing
Prototype assets seeded
→ Ready to build. Run npm run dev:local to start prototyping.
0
Instruction Files
0
Wizard Steps
0
Connectors Available
Plan → Ship
Entire Lifecycle Covered

Template to Production — in 10 Steps

From clicking Use this template to promoting through Power Platform Pipelines — Foundations gives every team the same proven path. One picture says it all.

Power Apps Code Apps Foundations — From Template to Production: a 10-step journey showing Use the Template, Run the Wizard, Sample App Live, Plan Mode in VS Code, Agent Mode Builds the POC, Connect Connectors, Bind to Dataverse, Test, Share & Collaborate, and Promote with Pipelines.

Click Use this template on GitHub → run the Wizard → ship your first app. The rest of this page explains how.

The Best of Both Worlds:
Pro-Dev React + Power Platform

Power Apps Code Apps let you write real React + TypeScript applications that run on Power Platform infrastructure — with enterprise auth, Dataverse, 1000+ connectors, and managed ALM built in. No more choosing between developer freedom and platform governance.

Real React, Real TypeScript

Write standard React 18 with Fluent UI v9, TanStack Query, React Router, and Vite. Your existing frontend skills transfer directly. No proprietary low-code canvas to learn.

🔐

Enterprise Auth — For Free

Entra ID authentication is automatic. No OAuth flows to build, no token management, no login screens. Every user is authenticated before your first line of code runs.

🔌

1000+ Connectors, Zero fetch()

Dataverse, SQL, SharePoint, Teams, Office 365, custom APIs — all accessed through generated TypeScript SDKs. The Power Platform sandbox handles auth and DLP enforcement for every call.

📦

Solution-Aware ALM

Your Code App, Dataverse tables, security roles, and connection references all travel together in a single solution. Export from dev, import to prod. Proper version control for enterprise IT.

🧪

Testable from Day One

Vitest + Playwright + MSW ship in the scaffold. Smoke tests pass on first run. Mock providers mean the prototype is testable before Dataverse tables even exist.

🤖

First-Class Multi-Agent Support

Native guidance for GitHub Copilot, Claude Code, Cursor, and Codex. Each agent reads the same 14 scoped instruction files in its own format — .github/instructions/ for Copilot, .claude/rules/ for Claude, .cursor/rules/ for Cursor, and nested AGENTS.md for Codex. Your standards, enforced by whichever agent your team picks.

Strategic context

Need the bigger enterprise argument?

Foundations is the implementation path. Power Apps Code Apps Advantage is the companion narrative for leaders and architecture teams: why Code Apps matter, where they fit, and how they change the build-vs-buy conversation for governed AI-era applications.

Explore the Advantage For stakeholders, architects, and platform owners

Without Foundations vs. With Foundations

What typically takes weeks of tribal knowledge, false starts, and rework — Foundations encodes into a repeatable, tested path.

Challenge Without Foundations With Foundations
Project Setup Scattered docs, tribal knowledge, days of config Interactive wizard — terminal or beautiful browser experience — working app from zero
Architecture Decisions Ad hoc, inconsistent across projects Opinionated 4-layer architecture, enforced by your coding agent
Dataverse Schema Create tables in portal, forget solution context, orphan artifacts Plan-first artifact workflow with validation scripts
Business Problem → Code Jump to code, discover missing requirements in production Narrative-first decomposition → prototype validation → then code
Authentication Manual PAC auth setup, secrets in plain text, broken CI 1Password integration, encrypted .env, pre-commit secret guard
Testing "We'll add tests later" (they never get added) Smoke tests pass on scaffold, MSW for connector mocking
Deployment Manual pac code push, no CI/CD blueprint, no solution export Documented CI/CD blueprint + solution export script + Power Platform Pipelines model
Agent Quality Generic suggestions that don't match your patterns Native guidance for 4 agents: Copilot, Claude Code, Cursor, Codex + AGENTS.md fallback for others

A Consulting-Grade Methodology,
Encoded in Your Repo

Foundations doesn't just scaffold a project — it encodes an iterative discovery-to-deployment methodology that consulting firms charge millions to deliver. Every phase has clear inputs, outputs, and stop conditions.

1

Business Problem Decomposition

Start with a freeform narrative. Your coding agent decomposes it across 12 business dimensions — actors, workflows, approvals, exceptions, reporting needs, collaboration surfaces. No rigid questionnaires. Just structured thinking about what you're actually building.

Instruction: 00a
2

Scope Refinement & Solution Shaping

Challenge the happy path. Surface approvals, automation boundaries, Teams integration needs, document outputs, governance requirements, and phased delivery decisions. Enterprise completeness checks ensure you don't discover missing requirements in production.

Instruction: 00b
3

Solution Concept → Dataverse Plan

Translate refined scope into candidate entities, relationships, ownership patterns, lifecycle states, and automation boundaries. The conceptual model feeds into a structured planning artifact — the Dataverse planning payload.

Instruction: 00c + schema-plan.json
4

Prototype Validation

Build a clickable UX against mock providers. Pressure-test every screen with stakeholders using realistic edge-case data. Capture findings in a structured feedback artifact. Refine the planning payload before you freeze a single Dataverse table.

Instruction: 00d + seed scripts
5

Schema Provision & Connector Binding

Execute the golden sequence: Option Sets → Tables → Columns → Lookups → Security Roles → Publish → Register Data Sources. Every API call includes the solution context header. Scripts are re-runnable and idempotent.

Instruction: 07 + helper scripts
6

Build, Test, Deploy

Swap mock providers for real adapters. Run the full test suite. Build with Vite. Deploy via pac code push to dev, then promote through Power Platform Pipelines to test and production. CI/CD enforces the gate: no test evidence, no deploy.

Instructions: 01–06

Nine Steps. Terminal or Browser.

Same `.wizard-state.json`, same opinionated sequence — pick the surface that fits the moment. Every step is self-contained, idempotent, and re-runnable. Every decision lands in audit-friendly state on disk. Smart paste handling means you never hand-edit a URL again.

Browser wizard home page showing the nine-step grid: Prerequisites, Project & Environment, App Registration, PAC Auth Profiles, Publisher, Solution, Scaffold the Code App, Bind Connectors, and Verify & Deploy.
🌐

Browser experience

npm run wizard:ux opens a Fluent UI v9 web app on 127.0.0.1:5174 with a step navigator, status pills, theme switching, and embedded terminal handoffs for device-code or biometric prompts.

📋

Smart paste handling

Paste an environment URL with or without https:// and the wizard normalizes it. Paste a Maker Portal connection URL and it extracts the connector apiId plus connection GUID in one shot.

🔌

Any connector, by URL

The connector step starts with common choices, then lets you add another connector by URL or apiId. Drop in Approvals, Outlook Tasks, or any published custom connector.

Dataverse Is Your Unfair Advantage

Every Power Apps Code App sits on Microsoft Dataverse — a petabyte-scale, security-aware, relationship-rich data platform that would cost a fortune to build from scratch.

  • Row-Level Security Built In

    Business unit hierarchies, security roles, and field-level security enforce access at the data layer — not in your React code. Your app UI can be simpler because the platform does the hard work.

  • Relationships & Polymorphic Lookups

    One-to-many, many-to-many with real junction tables, and polymorphic lookups that can reference multiple entity types. Data modeling that rival databases charge premium tiers for.

  • Solution-Portable Schema

    Tables, columns, option sets, security roles — they all travel inside your solution. Export from dev, import to prod. Schema changes are version-controlled and ALM-ready.

  • Business Rules & Calculated Fields

    Push validation logic into the data layer where it applies to every client — your Code App, model-driven apps, Power Automate flows, and direct API calls.

  • Audit Trail & Compliance

    Built-in change tracking, audit logging, and data retention policies. Your compliance team will thank you for not building this from scratch.

React + Fluent UI Presentation Layer — your components
TanStack Query + Hooks Business Logic — caching, mutations, state
📋
Provider Contracts Mock ↔ Real swap point — one composition root
🗄
Generated SDK + Dataverse Auto-generated TypeScript from pac code add-data-source

Access Everything.
Build Nothing From Scratch.

Every Power Platform connector generates a strongly-typed TypeScript SDK. No REST endpoints to discover, no auth to configure, no middleware to build. Just pac code add-data-source and write your business logic.

🗄
Dataverse
💾
SQL Server
📄
SharePoint
👤
O365 Users
🏢
O365 Groups
💬
MS Teams
📊
Azure Data Explorer
📁
OneDrive
📧
Outlook
🔗
Custom APIs
🤖
Copilot Studio
1000+ More

Embed Copilot Studio Agents
Directly in Your App

When your solution needs conversational AI, Foundations has you covered. Full integration guidance for Microsoft Copilot Studio — from connection discovery to multi-turn chat UIs with real-time streaming.

🤖
Project Insights Agent ● Online — Copilot Studio
What's the status of the Q4 budget review?
The Q4 budget review has 3 line items pending approval from Finance. Two were flagged for overspend on contractor costs. The review deadline is December 15th — 8 days from now. Want me to summarize the flagged items?
Yes, and draft a follow-up email to the budget owners.
I've summarized the 2 flagged items and drafted an email for Sarah Chen and Marcus Rivera. I included the variance amounts and suggested corrective actions. Review it in the action panel →
  • 🔍

    Automated Connection Discovery

    The discover-copilot-connection.mjs script finds existing Copilot Studio connections in your environment. Zero connections? It walks you through creation in the Maker Portal.

  • ExecuteCopilotAsyncV2 — The Right API

    Foundations documents the one method that actually works for synchronous agent responses. No more discovering the hard way that ExecuteCopilot is fire-and-forget.

  • 💬

    Multi-Turn Chat Hook

    A production-ready useCopilotAgent hook with TanStack Query integration, conversation state management, and safe response-casing normalization.

  • 🧩

    Drop-In When You Need It

    Copilot Studio integration is optional. Add it when your solution benefits from conversational guidance, summarization, or assisted decision-making — not because it's trendy.

"

Most teams spend their first month discovering the hard way that Dataverse tables need solution context, that pac code push rejects service principals, and that the generated SDK breaks without moduleResolution: "bundler". Foundations encodes every one of those lessons — so your team starts building features on day one, not debugging platform quirks.

— The experience of every team that built Code Apps before this template existed

Everything a Team Needs,
Nothing They Don't

Foundations is not a kitchen-sink boilerplate. Every file has a purpose. Every instruction is scoped. Every script is re-runnable.

The canonical instruction files live in .github/instructions/ with applyTo scopes. Native projections are generated for each agent: .claude/rules/ for Claude Code, .cursor/rules/ for Cursor, and nested AGENTS.md files for Codex. A top-level AGENTS.md provides non-negotiable architectural guardrails that every coding agent honors — including Cline, Aider, and any tool that reads root-level context.
  • 00-series: Environment setup, business decomposition, scope refinement, Dataverse planning, prototype validation
  • 01: Project scaffolding, solution-first rules, tech stack (React 18 + Fluent UI v9 + TanStack Query + Vite)
  • 02: Connector patterns — Dataverse, SQL, SharePoint, O365, custom APIs
  • 03: Component architecture — 4-layer separation, Fluent UI v9 patterns, hook contracts
  • 04: Deployment — CI/CD blueprint, GitHub Actions, solution export, Power Platform Pipelines
  • 05: Testing — Vitest, Playwright, MSW mocking, coverage thresholds
  • 06: Security — secrets management, 1Password, pre-commit hooks, input validation
  • 07: Dataverse schema — golden sequence, naming conventions, planning artifact workflow
  • 08: Copilot Studio — agent integration, connection discovery, multi-turn chat
A 9-step setup flow you can run two ways — pick whichever feels right:
  • Terminal wizard (node wizard/index.mjs) — Node.js CLI that runs natively on macOS, Linux, and Windows. No WSL required.
  • ✨ Browser wizard (npm run wizard:ux) — a beautiful localhost web app at http://127.0.0.1:5174 built with the same Fluent UI v9 design language you'll use in your Code Apps. Step navigator with status pills, jump-to-step, resume detection, light/dark/system themes, live log panel with SSE streaming, and one-click terminal-handoff cards for steps that need interactive auth. CSRF-protected, localhost-only, auto-shutdown on idle.
Both flows share .wizard-state.json, so you can switch between them at any time without losing progress. Both check prerequisites, collect project identity, guide portal steps, set up auth (1Password or encrypted .env.local), scaffold React + Fluent UI, seed prototype assets, and run smoke tests. Save progress with Ctrl+C, resume anytime, or --reset to start over.
Three composable scripts that form the Dataverse execution pipeline:
  • validate-schema-plan.mjs — validates the planning payload before any provisioning
  • generate-dataverse-plan.mjs — emits normalized execution plans for tables, relationships, and registration
  • register-dataverse-data-sources.mjs — runs pac code add-data-source in order, regenerating the SDK for each table
The seed-prototype-assets.mjs script generates domain contracts, mock providers, a provider factory, and a feedback artifact from your planning payload. This means your UX is buildable and testable against mock data before a single Dataverse table exists. Stakeholders review a real app, not wireframes.
Supports 1Password CLI integration (secrets never touch disk) or AES-256-GCM encrypted .env.local (machine-specific decryption keys). A pre-commit hook blocks accidental secret commits. CI/CD uses GitHub secrets with SPN profiles for solution export/import, and separate user profiles for pac code push to dev.
The sync-foundations.mjs script pulls the latest instruction files, agent-native guidance, scripts, and wizard from the template repo into your downstream project. No fork management, no merge conflicts with your app code. Your project gets the accumulated lessons of every team that came before — automatically. A .foundations-version.json bundle tag lets downstream repos see which version they are on.
MIT LICENSE, SECURITY.md, CODE_OF_CONDUCT.md, and CONTRIBUTING.md are included. The repository is hardened for public release: no secrets in history, pre-commit secret scanner, .env gitignored by default, and personal vault references stripped. Fork it, template it, or contribute back — it meets Microsoft open-source governance standards on day one.

Ready to Build Something Real?

Get from zero to a working, testable, deployable Power Apps Code App in a single session. Your team. Your standards. Your pace.

1
Clone the template
Use this template →
2
Run the wizard
npm run wizard:ux
or node wizard/index.mjs
3
Start building
npm run dev:local
Disclaimer
This content is not a formal statement, position, or endorsement from Microsoft. It is an open source project from Marty Carreras, Microsoft's US Healthcare & Life Sciences AI Business Solutions CTO, offered to help individuals and organizations increase their productivity with Power Apps Code Apps. Opinions are the author's own.