# Project Structure

This project has been reorganized with TypeScript and a clean folder structure.

## Directory Structure

```
onestep-wellness-site/
├── src/                    # TypeScript source files
│   ├── config/            # Configuration files
│   │   └── services.ts    # Service pricing configuration
│   ├── routes/            # API route handlers
│   │   ├── checkout.ts    # Checkout session creation
│   │   ├── sessions.ts  # Session retrieval
│   │   ├── services.ts   # Services listing
│   │   └── webhook.ts     # Stripe webhook handler
│   ├── types/             # TypeScript type definitions
│   │   └── index.ts       # Shared types
│   └── server.ts          # Main server file
├── public/                 # Static frontend files
│   ├── pages/             # HTML, styles.css, design-tokens.css (design tokens)
│   ├── assets/            # Images and other media
│   └── scripts/           # Frontend JavaScript
├── DESIGN.md               # Design bible (tokens + usage)
├── dist/                   # Compiled TypeScript output (generated)
├── node_modules/          # Dependencies (generated)
├── .env                   # Environment variables (not in git)
├── .gitignore            # Git ignore rules
├── package.json           # Project dependencies and scripts
├── tsconfig.json          # TypeScript configuration
├── README.md              # Project documentation
├── SETUP.md               # Setup instructions
└── PROJECT_STRUCTURE.md   # This file
```

## Key Changes from Previous Structure

1. **TypeScript Migration**
   - All server code is now in TypeScript (`src/`)
   - Type-safe API routes and configurations
   - Better IDE support and error catching

2. **Organized Structure**
   - `src/` - Backend TypeScript code
   - `public/` - Frontend static files
   - `dist/` - Compiled JavaScript (gitignored)

3. **Modular Routes**
   - Routes are separated into individual files
   - Easier to maintain and test
   - Clear separation of concerns

4. **Type Safety**
   - Type definitions in `src/types/`
   - Service configuration typed
   - API request/response types

## Development Workflow

1. **Development**: `npm run dev` - Runs with hot reload
2. **Build**: `npm run build` - Compiles TypeScript to `dist/`
3. **Production**: `npm start` - Runs compiled code from `dist/`

## File Organization Principles

- **Backend code** → `src/`
- **Frontend code** → `public/`
- **Configuration** → `src/config/`
- **Type definitions** → `src/types/`
- **Route handlers** → `src/routes/`

