Files
aniplay-api/README.md
Rushil Perera 9da626f17b docs: update README
add folder info about middleware
2025-12-18 08:54:29 -05:00

1.5 KiB

Aniplay API

API for Aniplay, built with Cloudflare Workers, Hono, and Drizzle ORM.

Tech Stack

  • Cloudflare Workers: Serverless execution environment.
  • Hono: Ultrafast web framework (OpenAPI).
  • GraphQL: Used internally for communicating with the AniList API.
  • Drizzle ORM: TypeScript ORM for D1 (Cloudflare's serverless SQL database).
  • Vitest: Testing framework.

Prerequisites

  • Node.js
  • pnpm: Package manager.

Getting Started

  1. Installation

    pnpm install
    
  2. Environment Setup Generate the environment types:

    pnpm exec wrangler types
    
  3. Database Setup Apply migrations to the local D1 database:

    pnpm exec wrangler d1 migrations apply aniplay
    

Development

Running Locally

Start the development server:

pnpm run dev

Testing

Run the tests using Vitest:

pnpm test

Deployment

Deploy to Cloudflare Workers:

pnpm run deploy

Project Structure

  • src/controllers: API route handlers (titles, episodes, search, etc.)
  • src/libs: Shared utilities and logic (AniList integration, background tasks)
  • src/middleware: Middleware handlers (authentication, authorization, etc.)
  • src/models: Database schema and models
  • src/scripts: Utility scripts for maintenance and setup
  • src/types: TypeScript type definitions