App Boilerplate
FAQ
Frequently Asked Questions
Common questions about using the Boilerplate App template to create new FlowState applications.
General
What is the Boilerplate App?
The Boilerplate App is a template package that provides a complete, working application structure for creating new FlowState micro-applications. It includes pre-configured routing, layout components, plugin architecture, and development tooling so you can start building features immediately rather than setting up infrastructure.
Who should use this template?
This template is designed for:
- FlowState developers creating new micro-applications
- Contributors adding new apps to the FlowState ecosystem
- Teams building internal tools using the FlowState platform
Why use a template instead of starting from scratch?
Using the boilerplate ensures:
- Consistency - All apps follow the same patterns and conventions
- Compatibility - Pre-configured integration with the host container
- Speed - Skip setup and start building features immediately
- Best practices - Includes proven patterns for routing, state, and lifecycle
Creating Apps
How do I create a new app from this template?
Copy the boilerplate directory:
cp -r packages/apps/flowstate-app-boilerplate packages/apps/flowstate-app-myappUpdate
package.json,flowstate.json, andsrc/plugin.tswith your app's identityRun
yarn installandyarn dev
See Creating a New App for detailed steps.
What should I name my app?
Follow these naming conventions:
| Item | Convention | Example |
|---|---|---|
| Package name | @epicdm/flowstate-app-{name} | @epicdm/flowstate-app-inventory |
| Directory | flowstate-app-{name} | flowstate-app-inventory |
| Plugin export | {name}Plugin | inventoryPlugin |
| App ID | lowercase alphanumeric | inventory |
| Route | /apps/{name} | /apps/inventory |
Which port should I use for development?
Choose a unique port in the 3200-3299 range. Check packages/apps/*/vite.config.mts to see which ports are already in use. Common assignments:
| App | Port |
|---|---|
| Boilerplate | 3210 |
| Your app | 3211-3299 (pick one) |
Can I use a different icon for my app?
Yes. Icons come from Lucide React. Update both:
flowstate.json- use the icon name as a string (e.g.,"layout-grid")src/plugin.ts- import and use the React component (e.g.,import { LayoutGrid } from 'lucide-react')
Development
What's the difference between standalone and embedded mode?
| Mode | Use Case | Features |
|---|---|---|
| Standalone | Development/testing | Mock auth, in-memory DB, independent routing |
| Embedded | Production | Shared services, host routing, real auth |
The standalone prop controls mode-specific behavior in components.
How do I add a new page to my app?
Create a page component in
src/pages/:export function MyPage() { return <div>My Page Content</div>; }Add a route in
src/App.tsx:<Route path="mypage" element={<MyPage />} />Add a navigation link in
src/components/Sidebar.tsx:{ path: '/mypage', label: 'My Page', icon: 'file', priority: 20 }
How do I access database collections?
Use RxDB hooks from @epicdm/flowstate-rxdb-react:
import { useRxCollection, useRxQuery } from '@epicdm/flowstate-rxdb-react';
function MyComponent() {
const collection = useRxCollection('tasks');
const { result: tasks } = useRxQuery(
collection?.find({ selector: { status: 'pending' } })
);
return <TaskList tasks={tasks} />;
}
How do I add custom commands to my app?
Register commands in flowstate.json:
{
"contributes": {
"commands": [
{
"id": "myapp.createItem",
"title": "Create New Item",
"category": "My App"
}
]
}
}
Building & Deployment
How do I build my app for production?
yarn build
This generates:
dist/index.js- CommonJS bundledist/index.mjs- ESM bundledist/index.d.ts- TypeScript declarationsdist/index.css- Bundled styles
Why are some dependencies marked as external?
External dependencies (React, React Router, framework packages) are provided by the host container. Marking them external:
- Reduces bundle size
- Prevents duplicate instances
- Ensures consistent versions across apps
How do I add the app to the host container?
Register your plugin in the host container's plugin configuration:
import { myappPlugin } from '@epicdm/flowstate-app-myapp';
const plugins = [
// ... other plugins
myappPlugin,
];
The host container handles lazy loading, routing, and lifecycle management.
Technical
Which browsers are supported?
The boilerplate targets modern browsers:
- Chrome/Edge (last 2 versions)
- Firefox (last 2 versions)
- Safari (last 2 versions)
The Vite build configuration handles necessary transpilation.
What TypeScript version is required?
TypeScript 5.0 or higher. The template uses strict mode and modern features like:
satisfiesoperatormoduleResolution: "bundler"- Strict null checks
Can I use different styling than Tailwind CSS?
Yes, but Tailwind is recommended for consistency with other FlowState apps. If you need custom styles:
- Add your CSS framework to dependencies
- Update
postcss.config.jsif needed - Import your styles in
src/index.ts
The framework components use Tailwind, so some Tailwind configuration is still needed.
How do plugin lifecycle hooks work?
Plugins have two lifecycle hooks:
{
onLoad: async (services) => {
// Called when app is activated
// Initialize resources, subscribe to services
const db = services.get('database');
},
onUnload: async () => {
// Called when app is deactivated
// Clean up subscriptions, release resources
},
}
Still Have Questions?
If your question isn't answered here:
- Check Getting Started for setup guidance
- Review Template Structure for technical details
- See Troubleshooting for common issues
- Ask in the development channel for additional help