New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@g-1/example

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@g-1/example

Example application demonstrating the `@g-1/core` framework

latest
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

@g-1/example

A complete example application demonstrating how to build production-ready APIs with the @g-1/core framework.the @g-1/core framework.

Features

  • 🚀 Built on Cloudflare Workers for edge performance
  • 🔐 Authentication with better-auth
  • 📊 Database integration with Drizzle ORM
  • 🛡️ Comprehensive security middleware
  • 📝 OpenAPI documentation with Scalar
  • ⚡ Rate limiting and request validation
  • 🧪 Testing setup with Vitest
  • 📦 Modular architecture with @g-1/templates

Quick Start

  • Install dependencies:

    bun install
    
  • Set up environment variables:

    cp .env.example .env
    # Edit .env with your configuration
    
  • Generate authentication secret:

    bun run auth:generate
    
  • Set up database:

    bun run db:generate
    bun run db:migrate
    
  • Start development server:

    bun run dev
    

Environment Variables

VariableDescriptionRequired
BETTER_AUTH_SECRETSecret key for authentication (min 32 chars)Yes
BETTER_AUTH_URLBase URL for auth callbacksYes
RESEND_API_KEYAPI key for email serviceNo
FROM_EMAILEmail address for outgoing emailsNo

Scripts

  • bun run dev - Start development server
  • bun run build - Build for production
  • bun run deploy - Deploy to Cloudflare Workers
  • bun run test - Run tests
  • bun run lint - Lint code
  • bun run db:generate - Generate database migrations
  • bun run db:migrate - Apply database migrations

Architecture

This boilerplate uses the @g-1/core framework which provides:

  • Core Framework (@g-1/core): Router, middleware, utilities
  • Templates (@g-1/templates): Pre-built auth, database, and API routes
  • Utilities (@g-1/util): Shared utility functions

Deployment

  • Configure Cloudflare:

    bun run cf:login
    
  • Set up D1 database:

    wrangler d1 create g1-api-db
    # Update wrangler.toml with database_id
    
  • Set up KV namespace:

    wrangler kv:namespace create "MY_API_PROJECT_KV_AUTH"
    # Update wrangler.toml with namespace id
    
  • Deploy:

    bun run deploy
    

License

MIT

Keywords

api

FAQs

Package last updated on 25 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts