Directory Structure Guide

Back to Home

A comprehensive guide to understanding and navigating the FM Bridge project structure. Use this page to determine where to place new files and components.

🤔 Where Should I Put...?

Where should I put a new authentication page?

app/auth/ - All NextAuth.js related pages go here (login, logout, error pages, etc.)

Where should I put a new core system page?

app/core/ - Pages that are reusable across different projects and integrations

Where should I put a new Roundup-specific page?

app/roundup/ - Pages specific to the Roundup integration

Where should I put a new API endpoint?

app/api/ - Create subdirectories based on functionality (auth, roundup, supabase, etc.)

Where should I put a new authentication component?

components/auth/ - Components related to user authentication and session management

Where should I put a new core component?

components/core/ - Reusable components that work across different projects

Where should I put a new Roundup component?

components/roundup/ - Components specific to Roundup functionality

Where should I put a new utility function?

lib/ - All utility functions, services, and helper modules go here

Where should I put a new integration?

Create new directories in both app/ and components/ (e.g., app/integration-name/, components/integration-name/)

📁 Project Structure

📁
app/Next.js App Router pages and API routes/app
└─
api/API routes (server-side endpoints)/app/api
└─
auth/NextAuth.js configuration and session management/app/api/auth
└─
[...nextauth]/Directory/app/api/auth/[...nextauth]
└─
filemaker-auth/FileMaker OAuth proxy for Microsoft SSO/app/api/filemaker-auth
└─
dapi-test/Directory/app/api/filemaker-auth/dapi-test
└─
[id]/Directory/app/api/filemaker-auth/dapi-test/[id]
└─
oauth/Directory/app/api/filemaker-auth/oauth
└─
callback/Directory/app/api/filemaker-auth/oauth/callback
└─
roundup/Roundup-specific API endpoints/app/api/roundup
└─
irpm/Directory/app/api/roundup/irpm
└─
[id]/Directory/app/api/roundup/irpm/[id]
└─
reporting/Directory/app/api/roundup/reporting
└─
documentPackDeletion/Directory/app/api/roundup/reporting/documentPackDeletion
└─
supabase/Supabase connectivity and testing endpoints/app/api/supabase
└─
test/Directory/app/api/supabase/test
└─
auth/Authentication pages (NextAuth.js)/app/auth
└─
login/Directory/app/auth/login
└─
logout/Directory/app/auth/logout
└─
magikLinkError/Directory/app/auth/magikLinkError
└─
oauth-error/Directory/app/auth/oauth-error
└─
oauth-success/Directory/app/auth/oauth-success
└─
core/Core system pages (reusable across projects)/app/core
└─
about-fm-bridge/Directory/app/core/about-fm-bridge
└─
directory-structure/Directory/app/core/directory-structure
└─
exampleProtectedPage/Directory/app/core/exampleProtectedPage
└─
filemaker-dapi-test/Directory/app/core/filemaker-dapi-test
└─
oauth-test/Directory/app/core/oauth-test
└─
supabase-test/Directory/app/core/supabase-test
└─
testcomponent/Directory/app/core/testcomponent
└─
oauth/Directory/app/oauth
└─
redirect/Directory/app/oauth/redirect
└─
roundup/Roundup-specific pages/app/roundup
└─
irpm/Directory/app/roundup/irpm
└─
[id]/Directory/app/roundup/irpm/[id]
└─
reporting/Directory/app/roundup/reporting
└─
documentPackDeletion/Directory/app/roundup/reporting/documentPackDeletion
📁
components/Reusable React components/components
└─
auth/Authentication-related components/components/auth
└─
core/Core system components (reusable across projects)/components/core
└─
layout/Directory/components/core/layout
└─
roundup/Roundup-specific components/components/roundup
└─
irpm/Directory/components/roundup/irpm
└─
reporting/Directory/components/roundup/reporting
└─
documentPackDeletion/Directory/components/roundup/reporting/documentPackDeletion
└─
ui/Directory/components/ui
📁
lib/Utility functions and services/lib

✅ Best Practices

  • Keep related functionality grouped together in the same directory
  • Use descriptive directory names that clearly indicate their purpose
  • Follow the established pattern: app/ for pages, components/ for UI components, lib/ for utilities
  • Create subdirectories for complex features (e.g., reporting/, layout/)
  • Place shared/reusable code in core/ directories
  • Place integration-specific code in dedicated directories
  • Keep API routes organized by functionality in app/api/
  • Use consistent naming conventions (camelCase for files, kebab-case for directories)

🚀 Quick Reference

Pages

  • app/auth/ - Authentication pages
  • app/core/ - Core system pages
  • app/roundup/ - Roundup pages
  • app/api/ - API endpoints

Components

  • components/auth/ - Auth components
  • components/core/ - Core components
  • components/roundup/ - Roundup components
  • lib/ - Utilities & services