lauragift21/developer-labs

โ˜… 0Forks 0MDXGitHub โ†—Compare

README

Cloudflare Developer Labs

Interactive tutorials and hands-on labs to build production-ready applications on Cloudflare's developer platform.

๐ŸŽฏ What You'll Learn

Cloudflare Workers

  • Build serverless applications at the edge
  • Create HTTP APIs with routing
  • Integrate with KV storage and D1 databases
  • Add AI-powered features with Workers AI

Model Context Protocol (MCP)

  • Build intelligent AI assistants
  • Connect to external systems and APIs
  • Create custom AI tools and workflows
  • Deploy MCP servers globally

๐Ÿš€ Quick Start

Prerequisites

Development Setup

# Clone the repository
git clone https://github.com/lauragift21/developer-labs.git
cd developer-labs

# Install dependencies
npm install

# Start development server
npm run dev

Visit http://localhost:4321 to see the site locally.

Deploy to Cloudflare

# Login to Cloudflare (first time only)
wrangler login

# Deploy to production
npm run deploy

๐Ÿ“ Project Structure

developer-labs/
โ”œโ”€โ”€ public/                    # Static assets
โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”‚   โ”œโ”€โ”€ css/              # Stylesheets
โ”‚   โ”‚   โ”œโ”€โ”€ js/               # JavaScript files
โ”‚   โ”‚   โ””โ”€โ”€ og-image.png      # Social media image
โ”‚   โ””โ”€โ”€ favicon.svg           # Site favicon
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/           # Reusable Astro components
โ”‚   โ”‚   โ”œโ”€โ”€ Alert.astro
โ”‚   โ”‚   โ”œโ”€โ”€ Callout.astro
โ”‚   โ”‚   โ””โ”€โ”€ CodeBlock.astro
โ”‚   โ”œโ”€โ”€ content/              # Markdown content
โ”‚   โ”‚   โ”œโ”€โ”€ mcp-steps/        # MCP tutorial steps
โ”‚   โ”‚   โ””โ”€โ”€ workers-steps/    # Workers tutorial steps
โ”‚   โ”œโ”€โ”€ layouts/
โ”‚   โ”‚   โ””โ”€โ”€ Layout.astro      # Main layout template
โ”‚   โ””โ”€โ”€ pages/                # Site pages
โ”‚       โ”œโ”€โ”€ labs/
โ”‚       โ”‚   โ”œโ”€โ”€ index.astro   # Labs overview
โ”‚       โ”‚   โ”œโ”€โ”€ mcp/          # MCP tutorial
โ”‚       โ”‚   โ””โ”€โ”€ workers/      # Workers tutorial
โ”‚       โ””โ”€โ”€ index.astro       # Homepage (redirects to /labs)
โ”œโ”€โ”€ astro.config.mjs          # Astro configuration
โ”œโ”€โ”€ wrangler.jsonc            # Cloudflare Workers config
โ””โ”€โ”€ package.json

๐Ÿ› ๏ธ Available Commands

Command Action
npm install Install dependencies
npm run dev Start development server at localhost:4321
npm run build Build production site to ./dist/
npm run preview Preview build locally
npm run deploy Build and deploy to Cloudflare Workers
npm run astro ... Run Astro CLI commands

๐ŸŽจ Features

  • Interactive Tutorials: Step-by-step labs with hands-on coding
  • Progressive Learning: From basics to advanced concepts
  • Real Deployments: Every lab results in a working application
  • Modern Stack: Built with Astro, deployed on Cloudflare Workers
  • Responsive Design: Works perfectly on desktop and mobile
  • SEO Optimized: Complete meta tags and structured data

๐Ÿงช Lab Content

Cloudflare Workers Labs

  1. Hello World - Your first Worker
  2. HTTP APIs - Building REST endpoints
  3. KV Storage - Persistent data storage
  4. D1 Database - SQL database integration
  5. Workers AI - AI-powered applications
  6. Advanced Routing - Complex request handling
  7. Production Deploy - Going live globally

MCP Labs

  1. MCP Basics - Understanding the protocol
  2. First Server - Building your first MCP server
  3. Custom Tools - Creating AI assistant tools
  4. External APIs - Connecting to third-party services
  5. Persistent State - Using KV for data storage
  6. Advanced Features - Complex workflows and patterns

๐Ÿค Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and test thoroughly
  4. Commit your changes: git commit -m 'Add amazing feature'
  5. Push to the branch: git push origin feature/amazing-feature
  6. Open a Pull Request

Adding New Labs

To add a new lab step:

  1. Create a new markdown file in src/content/workers-steps/ or src/content/mcp-steps/
  2. Follow the existing frontmatter format:
    ---
    stepNumber: 8
    title: "Your Lab Title"
    description: "Brief description of what students will learn"
    duration: "15 min"
    learningObjectives:
      - "Objective 1"
      - "Objective 2"
    ---
  3. Write your tutorial content in markdown
  4. Test locally with npm run dev

๐Ÿ“š Resources

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built by the Cloudflare Developer Relations team
  • Powered by Astro and Cloudflare Workers
  • Community feedback and contributions

Ready to start building? Visit developer-labs.examples.workers.dev and choose your first lab!

Contributors

lauragift21astrobot-houston

Issues