Development Setup Guide
Complete guide to setting up the Cascadia Marquee website development environment
Development Setup Guide
Complete guide to setting up the Cascadia Marquee website development environment.
Prerequisites
- Node.js 18+ - Download from nodejs.org
- pnpm (recommended) or npm/yarn - Install with
npm install -g pnpm - Git - For version control
Installation
1. Clone the Repository
git clone <repository-url>
cd cascadia-marquee_website2. Install Dependencies
pnpm install3. Environment Variables
Create a
.env.local file in the root directory:cp .env.local.example .env.localRequired environment variables:
# Canonical app URL (OAuth callbacks use APP_URL + fixed paths)
APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Google Calendar Integration (redirect URI is built from APP_URL: .../api/google-calendar/oauth/callback)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CLIENT_EMAIL=your-service-account@project.iam.gserviceaccount.com
GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYour private key here\n-----END PRIVATE KEY-----\n"
GOOGLE_CALENDAR_ID=your-email@gmail.com
# Email Service
RESEND_API_KEY=your_resend_api_key
# Analytics (production / optional for local testing with next start)
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
NEXT_PUBLIC_CLARITY_PROJECT_ID=
# Facebook Pixel
FACEBOOK_PIXEL_ID=your_pixel_id4. Run Development Server
pnpm devThe site will be available at http://localhost:3000
Development Commands
Core Commands
# Start development server
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
# Type check
pnpm type-checkContent Management
# Build content (MDX processing)
pnpm build:content
# Build component registry
pnpm build:registryCode Quality
# Lint code
pnpm lint
# Fix linting issues
pnpm lint:fix
# Check import order
pnpm lint:importsDevelopment Workflow
1. Content Development
- Blog Posts: Add
.mdxfiles tosrc/content/posts/ - Documentation: Add
.mdxfiles tosrc/content/docs/ - Services: Add
.mdxfiles tosrc/content/services/
2. Component Development
- UI Components: Use shadcn/ui or create custom components in
src/components/ui/ - Layout Components: Add to
src/components/layout/ - Feature Components: Add to appropriate subdirectories
3. Styling
- Tailwind CSS: Use utility classes for styling
- Custom CSS: Add to
src/app/globals.css - Component Styles: Use CSS modules or styled-components
Project Structure Deep Dive
App Router Structure
src/app/
├── api/ # API routes
│ ├── debug/ # Debug endpoints
│ ├── emails/ # Email handling
│ └── google-calendar/ # Calendar integration
├── blog/ # Blog pages
│ ├── [[...slug]]/ # Dynamic blog post routes
│ ├── [category]/ # Category pages
│ └── tags/ # Tag pages
├── contact/ # Contact page
├── docs/ # Documentation
│ └── [[...slug]]/ # Dynamic doc routes
├── legal/ # Legal pages
├── services/ # Service pages
└── layout.tsx # Root layoutComponent Architecture
src/components/
├── ui/ # shadcn/ui components
├── layout/ # Layout components
│ ├── layouts/ # Page layouts
│ ├── partials/ # Header, footer, etc.
│ └── sections/ # Page sections
├── contact/ # Contact form components
├── charts/ # Data visualization
├── icons/ # Custom icons
└── text/ # Typography componentsContent Management
src/content/
├── docs/ # Documentation content
│ ├── 1_guides/ # Technical guides
│ └── 2_documentation/ # Project documentation
├── posts/ # Blog posts
│ ├── case-studies/ # Client case studies
│ ├── posts/ # General blog posts
│ └── tutorials/ # Tutorial content
├── services/ # Service descriptions
└── legal/ # Legal documentsConfiguration Files
Next.js Configuration (next.config.ts)
import { withContentlayer } from "next-contentlayer2";
const nextConfig = {
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
images: {
remotePatterns: [
{
protocol: "https" as const,
hostname: "images.unsplash.com",
},
],
},
eslint: {
ignoreDuringBuilds: true,
},
webpack: (config) => {
config.resolve.fallback = {
...config.resolve.fallback,
process: require.resolve("process/browser"),
};
return config;
},
};
export default withContentlayer(nextConfig);Tailwind Configuration (tailwind.config.ts)
import type { Config } from "tailwindcss";
export default {
darkMode: ["class"],
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
colors: {
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
// ... more color definitions
},
},
},
plugins: [require("tailwindcss-animate")],
} satisfies Config;Contentlayer Configuration (contentlayer.config.ts)
The contentlayer configuration defines document types for:
- Doc - Documentation pages
- Post - Blog posts
- LegalDoc - Legal documents
- Service - Service descriptions
Development Tools
ESLint Configuration
The project uses a custom ESLint configuration with:
- Import ordering - Automatic import sorting
- TypeScript rules - Type checking and best practices
- React rules - React-specific linting
- Prettier integration - Code formatting
TypeScript Configuration
- Strict mode enabled
- Path mapping for clean imports (
@/aliases) - Next.js types included
- Contentlayer types generated automatically
Troubleshooting
Common Issues
"Module not found" errors:
- Run
pnpm installto ensure all dependencies are installed - Check that file paths are correct
- Verify TypeScript path mappings
Content not updating:
- Run
pnpm build:contentto rebuild content - Check that MDX files have proper front matter
- Verify file naming conventions
Build errors:
- Run
pnpm type-checkto identify TypeScript errors - Check ESLint output with
pnpm lint - Verify environment variables are set
Styling issues:
- Ensure Tailwind classes are properly configured
- Check that CSS variables are defined
- Verify component imports
Performance Optimization
- Image optimization - Use
next/imagefor all images - Font optimization - Use
next/fontfor custom fonts - Code splitting - Leverage Next.js automatic code splitting
- Bundle analysis - Use
@next/bundle-analyzerfor optimization
Next Steps
- Set up your development environment following this guide
- Explore the content structure in
src/content/ - Check out the component library in
src/components/ui/ - Review the technical guides in the documentation section
- Start contributing to the project!
For questions or help, check the other documentation sections or contact the development team.