Skip to content

openbrewerydb/openbrewerydb-sveltekit

Repository files navigation

Open Brewery DB

A free, open-source dataset and API for brewery, cidery, brewpub, and bottleshop information worldwide. Built with Svelte 5, SvelteKit 2, TypeScript, and TailwindCSS 4.

🍺 What is Open Brewery DB?

Open Brewery DB is a community-driven project that maintains a comprehensive dataset of breweries and related establishments. Our mission is to provide free, public access to brewery information for developers, data analysts, and beer enthusiasts worldwide.

Features

  • Free API: Access brewery data through our RESTful API
  • Search & Filter: Find breweries by location, type, and various criteria
  • Interactive Maps: Visualize brewery locations with geographic data
  • Community Driven: Contribute and help maintain accurate brewery information
  • Open Source: All data and code is freely available

🚀 Tech Stack

  • Framework: Svelte 5
  • Backend: SvelteKit 2
  • Language: TypeScript
  • Styling: TailwindCSS 4
  • Deployment: Cloudflare Pages/Workers
  • Testing: Playwright for E2E testing
  • Monitoring: Sentry for error tracking
  • Data Visualization: D3.js and Layerchart for maps

🛠️ Development

Prerequisites

  • Node.js (LTS version)
  • npm or pnpm package manager

Getting Started

  1. Clone the repository

    git clone https://github.com/openbrewery/openbrewerydb-sveltekit.git
    cd openbrewerydb-sveltekit
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev

    The application will be available at http://localhost:5173

  4. Optional: Open in browser

    npm run dev -- --open

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run check - Run TypeScript checks
  • npm run lint - Run linting and formatting checks
  • npm run format - Format code with Prettier
  • npm run test:e2e - Run Playwright E2E tests
  • npm run authors:build - Build GitHub authors data
  • npm run changelogs:build - Build changelog data

📁 Project Structure

src/
├── lib/                 # Shared utilities and components
│   ├── components/      # Reusable Svelte components
│   ├── data/           # Static data and generated content
│   └── types.ts        # TypeScript type definitions
├── routes/             # SvelteKit pages and API routes
├── layouts/            # Page layouts
└── styles/             # Global styles and TailwindCSS

🌐 Deployment

This project is configured to deploy on Cloudflare using the @sveltejs/adapter-cloudflare. The build process automatically optimizes for Cloudflare's edge network.

Environment Variables

Create a .env file for local development:

# Sentry (optional)
SENTRY_AUTH_TOKEN=your_sentry_token

# GitHub (for build scripts)
GITHUB_TOKEN=your_github_token

📊 API Documentation

Complete API documentation is available at /documentation in the application or online at openbrewerydb.org/documentation.

API Endpoints

  • GET /breweries - List all breweries with pagination
  • GET /breweries/{id} - Get specific brewery details
  • GET /breweries/search - Search breweries by query

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • How to contribute data
  • Code contributions
  • Bug reports and feature requests
  • Development setup

📄 License

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

🙏 Sponsors

Open Brewery DB is grateful for the support of our sponsors, particularly Sentry for providing application monitoring services.

🔗 Links

About

Official Open Brewery DB website built with SvelteKit

Topics

Resources

Contributing

Stars

Watchers

Forks

Contributors 6