..
2025-06-11 10:20:06 -07:00
2025-06-12 09:22:06 -07:00
2025-06-12 09:22:06 -07:00
2025-06-11 23:04:43 -07:00
2025-06-09 18:09:02 -07:00
2025-06-12 09:22:06 -07:00
2025-06-12 09:22:06 -07:00
2025-05-28 09:32:36 -07:00
2025-06-08 20:42:23 -07:00
2025-05-28 16:12:32 -07:00
2025-05-16 14:27:06 -07:00
2025-05-22 11:25:34 -07:00
2025-05-28 16:12:32 -07:00
2025-04-07 17:20:00 -07:00
2025-05-28 13:36:35 -07:00

Disk structure

Below is the general directory structure for the Backstory platform, prioritizing maintainability and developer experience:

src/
├── components/           # Reusable UI components
│   ├── common/          # Generic components (Button, Modal, etc.)
│   ├── forms/           # Form-related components
│   ├── layout/          # Layout components (Header, Sidebar, etc.)
│   └── ui/              # MUI customizations and themed components
├── pages/               # Page-level components (route components)
│   ├── auth/
│   ├── dashboard/
│   ├── profile/
│   └── settings/
├── features/            # Feature-specific modules
│   ├── authentication/
│   │   ├── components/
│   │   ├── hooks/
│   │   ├── services/
│   │   └── types/
│   ├── user-management/
│   └── analytics/
├── hooks/               # Custom React hooks
│   ├── api/            # API-related hooks
│   ├── ui/             # UI state hooks
│   └── utils/          # Utility hooks
├── services/            # API calls and external services
│   ├── api/
│   ├── auth/
│   └── storage/
├── store/               # State management (Redux/Zustand/Context)
│   ├── slices/         # If using Redux Toolkit
│   ├── providers/      # Context providers
│   └── types/
├── utils/               # Pure utility functions
│   ├── constants/
│   ├── helpers/
│   └── validators/
├── styles/              # Global styles and theme
│   ├── theme/          # MUI theme customization
│   ├── globals.css
│   └── variables.css
├── types/               # TypeScript type definitions
│   ├── api/
│   ├── common/
│   └── components/
├── assets/              # Static assets
│   ├── images/
│   ├── icons/
│   └── fonts/
├── config/              # Configuration files
│   ├── env.ts
│   ├── routes.ts
│   └── constants.ts
└── __tests__/           # Test files mirroring src structure
    ├── components/
    ├── pages/
    └── utils/

Key organizational principles:

  1. Feature-Based Architecture The features/ directory groups related functionality together, making it easy to find everything related to a specific feature in one place.

  2. Clear Separation of Concerns

components/ - Pure UI components
pages/ - Route-level components
services/ - Data fetching and external APIs
hooks/ - Reusable logic
utils/ - Pure functions
  1. Scalable Component Organization Components are organized by purpose rather than alphabetically, with subcategories that make sense as the app grows.

  2. Centralized Configuration All app configuration lives in config/, making it easy to manage environment variables, routes, and constants.

  3. Type Safety First Dedicated types/ directory with clear categorization helps maintain type definitions as the app scales.

Naming Conventions

  • Use PascalCase for components (UserProfile.tsx)
  • Use camelCase for utilities and hooks (formatDate.ts, useLocalStorage.ts)
  • Use kebab-case for directories (user-management/)

Index Files

Create index.ts files in major directories to enable clean imports:

// components/common/index.ts
export { Button } from './Button';
export { Modal } from './Modal';

// Import usage
import { Button, Modal } from '@/components/common';

Path Aliases

Configure path aliases in your build tool:

// Instead of: ../../../../components/common/Button
import { Button } from '@/components/common/Button';

This structure scales well while keeping related code co-located and maintaining clear boundaries between different types of functionality.