# SEO4BUZ Website

## Overview

Full-stack multi-page website for SEO4BUZ — a digital marketing and SEO services company based in Delhi, India. Built as a pnpm monorepo with a React + Vite frontend and Express API backend.

## Stack

- **Monorepo tool**: pnpm workspaces
- **Node.js version**: 24
- **Package manager**: pnpm
- **TypeScript version**: 5.9
- **Frontend**: React + Vite + Tailwind CSS + shadcn/ui + Framer Motion
- **Routing**: Wouter
- **Data fetching**: TanStack React Query
- **Forms**: react-hook-form + zod
- **API framework**: Express 5 with express-session
- **Database**: PostgreSQL + Drizzle ORM
- **Validation**: Zod (zod/v4), drizzle-zod
- **API codegen**: Orval (from OpenAPI spec)

## Pages

### Public
- `/` — Home (hero, stats, services overview, testimonials, blog preview, CTA)
- `/about` — About SEO4BUZ
- `/services` — Services grid with detail
- `/blog` — Blog listing with pagination
- `/blog/:slug` — Individual blog post
- `/contact` — Contact form + contact details

### Admin (password protected)
- `/admin/login` — Admin login
- `/admin/dashboard` — Overview stats
- `/admin/blog` — Manage blog posts (CRUD)
- `/admin/services` — Manage services (CRUD)
- `/admin/testimonials` — Manage testimonials (CRUD)
- `/admin/contacts` — View contact submissions
- `/admin/settings` — Edit site settings (hero text, about content, contact info)

## Admin Credentials

- **Username**: admin
- **Password**: seo4buz2025

(Set via `ADMIN_USERNAME` and `ADMIN_PASSWORD` environment variables)

## Structure

```text
artifacts/
├── api-server/           # Express 5 API server
│   └── src/routes/       # blog, services, testimonials, contacts, settings, admin
├── seo4buz/              # React + Vite frontend
│   └── src/
│       ├── pages/
│       │   ├── public/   # Home, About, Services, Blog, BlogPost, Contact
│       │   └── admin/    # Login, Dashboard, ManageBlog, ManageServices, ManageContacts, Settings
│       ├── components/
│       │   └── layout/   # PublicLayout, AdminLayout
│       └── hooks/        # use-auth.ts
lib/
├── api-spec/             # OpenAPI spec + Orval codegen config
├── api-client-react/     # Generated React Query hooks
├── api-zod/              # Generated Zod schemas
└── db/
    └── src/schema/       # blogPosts, services, testimonials, contacts, settings
scripts/
└── src/seed.ts           # Database seeder
```

## Database Tables

- `blog_posts` — Blog articles
- `services` — Service offerings
- `testimonials` — Client testimonials
- `contacts` — Contact form submissions
- `settings` — Site configuration (one row)

## API Endpoints

All endpoints under `/api`:
- `GET /healthz` — Health check
- `GET/POST /blog`, `GET/PUT/DELETE /blog/:slug` — Blog CRUD
- `GET/POST /services`, `PUT/DELETE /services/:id` — Services CRUD
- `GET/POST /testimonials`, `PUT/DELETE /testimonials/:id` — Testimonials CRUD
- `POST/GET /contacts` — Submit / list contacts
- `GET/PUT /settings` — Site settings
- `POST /admin/login`, `POST /admin/logout`, `GET /admin/me` — Auth

## Seeding

Run `pnpm --filter @workspace/scripts run seed` to seed initial data (services, testimonials, blog posts, settings).

## Root Commands

- `pnpm run build` — runs typecheck then builds all packages
- `pnpm run typecheck` — runs full TypeScript check
- `pnpm --filter @workspace/api-spec run codegen` — regenerate API client from OpenAPI spec
- `pnpm --filter @workspace/db run push` — push schema changes to database
- `pnpm --filter @workspace/scripts run seed` — seed initial data
