Skip to content
OR-BeyondPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ORB API

ORB API is the serverless backend platform for the Origin Realms Beyond ecosystem. It provides API endpoints, integration services, and a small informational website designed for deployment on Vercel.

Features

  • Svelte 5 and SvelteKit 2 application
  • Vercel serverless deployment
  • POST /api/issues GitHub issue proxy
  • Octokit-based GitHub integration
  • Strict TypeScript with reusable types
  • Validation-first request handling
  • Centralized server logging
  • Typed private environment configuration
  • Extensible rate-limiting interface
  • Dark, minimal API-focused website
  • Contributor-friendly documentation

Screenshots

Screenshots can be added after deployment:

  • Homepage: docs/assets/homepage.png
  • API error page: docs/assets/not-found.png

Architecture Summary

Routes receive HTTP requests and return standardized JSON responses. Business logic lives in services. Validators sanitize and validate input before services call external providers.

Current flow:

  1. src/routes/api/issues/+server.ts receives POST /api/issues.
  2. The route checks rate limiting and parses JSON.
  3. GitHubIssueService validates input and formats the issue.
  4. Octokit creates the issue in the configured GitHub repository.
  5. The API returns { "success": true } or { "success": false, "error": "message" }.

Installation

Install Bun 1.3 or newer, then install dependencies:

bun install

Development

bun run dev

Open the local URL printed by Vite.

Environment Variables

Create .env from .env.example:

GITHUB_TOKEN=
GITHUB_OWNER=
GITHUB_REPOSITORY=

These variables are private server variables. Never expose them in client code.

API Usage

Create GitHub Issue

POST /api/issues
Content-Type: application/json
{
  "title": "Issue title",
  "body": "Issue description",
  "reporter": "Application Name",
  "version": "1.0.0"
}

Success:

{
  "success": true
}

Error:

{
  "success": false,
  "error": "title is required"
}

Build

bun run check
bun run lint
bun run build

Deployment

Deploy to Vercel and configure the required environment variables in the Vercel project settings.

The project uses @sveltejs/adapter-vercel and includes vercel.json.

Documentation

Contributing

Contributors should follow the service-oriented structure:

  1. Add shared types.
  2. Add validators.
  3. Add services.
  4. Keep routes thin.
  5. Add or update documentation.
  6. Run check, lint, and build before opening a pull request.

The codebase is intended to be readable for both experienced developers and beginners.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages