How to Extend
LaunchFast is a founding state, not a finished product. You will add features. This page explains how to do so while maintaining correctness.
The extension principle
Add features by following existing patterns, not by introducing new mechanisms. The codebase has opinions. Adopt them.
Adding a new route
- Create file in
app/routes/following flat file convention - Use existing layout routes where applicable
- Follow the loader/action pattern from similar routes
- Use existing utilities from
app/utils/
Adding a database table
- Update schema in
prisma/schema.prisma - Run
npx prisma migrate devto create migration - Access data only through
db.server.ts - Never modify existing migrations
Adding authentication
Authentication is already implemented. To protect new routes:
- Use
requireUserId(request)in loader/action - Use
userHasRole(user, role)for role-based access - Do not create alternative auth mechanisms
Adding a third-party service
- Add API key to
env.server.ts(never client-accessible) - Create server-only module:
services/[name].server.ts - Use fetch directly instead of adding SDK dependencies when simple
- Add MSW handlers for testing
Adding UI components
- Check if component exists in
app/ui/ - Use
npx shadcn@latest add [component]for shadcn components - Follow existing component patterns and naming
- Use existing design tokens (colors, spacing, typography)
What not to do
These actions violate correctness:
- Creating alternative ways to access the database
- Implementing a second authentication system
- Adding multi-cloud abstraction layers
- Building a plugin or extension mechanism
- Exposing server environment variables to the client
When patterns don't fit
If you need something that doesn't fit existing patterns:
- Verify the need is real, not speculative
- Consider if it belongs in a separate service
- If adding to the codebase, document the deviation
- Update CLAUDE.md to include new constraints