Skip to content

yopem/auth

Repository files navigation

Yopem Auth

A lightweight authentication api with Google OAuth integration using OpenAuth.

Getting Started

Prerequisites

  • Bun 1.2.18 or later
  • PostgreSQL database
  • Cloudflare Workers account
  • Google Cloud Platform account

Installation

  1. Clone the repository
git clone https://github.com/yopem/auth.git
cd auth
  1. Install dependencies
bun install

Configuration

  1. Google Auth Setup:

    • Create OAuth 2.0 credentials in Google Cloud Platform
    • Configure the authorized redirect URI: https://your-domain/google/callback
    • Fill the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in your .dev.vars file
  2. Cloudflare Workers Setup:

    • Create a KV database in Cloudflare Workers dashboard
    • Rename wrangler.jsonc.example to wrangler.jsonc
    • Fill in all required fields using the Wrangler CLI for managing secrets, refer to the Cloudflare Workers Secrets documentation for more details.
  3. Environment Variables:

    • Add DATABASE_URL to your .env file because drizzle cannot read .dev.vars
  4. Databse Migration:

    bun run db:generate
    bun run db:migrate

Run the Application

bun run dev

Deploy

bun run deploy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published