npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gopherbase

v1.0.6

Published

The official JavaScript/TypeScript client for GopherBase.

Readme

GopherBase

GopherBase is a PostgreSQL-based database management system with a Go backend and React frontend. It provides a Supabase-like experience for managing your data, schema, and storage with built-in AI capabilities.

Prerequisites

  • Docker
  • Docker Compose

Quick Start

docker-compose up -d

Access the dashboard at http://localhost:4173

Docker Compose Configuration

To run GopherBase locally, you can use the following docker-compose.yml configuration:

version: '3.8'

services:
  backend:
    image: ethicalgopher/gopherbase:latest
    ports:
      - "8080:8080"
    environment:
      - DATABASE_URL=postgres://gopherbase:gopherbase@postgres:5432/gopherbase?sslmode=disable
      - JWT_SECRET=${JWT_SECRET:-dev-secret}
      - OLLAMA_HOST=http://ollama:11434
    restart: unless-stopped
    depends_on:
      - postgres
      - ollama
    networks:
      - gopherbase-network

  frontend:
    image: ethicalgopher/gopherbase-frontend:latest
    ports:
      - "4173:4173"
    restart: unless-stopped
    depends_on:
      - backend
    networks:
      - gopherbase-network

  postgres:
    image: postgres:16-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: gopherbase
      POSTGRES_PASSWORD: gopherbase
      POSTGRES_DB: gopherbase
    restart: unless-stopped
    networks:
      - gopherbase-network

  ollama:
    image: ollama/ollama:latest
    volumes:
      - ollama_data:/root/.ollama
    restart: unless-stopped
    entrypoint: >
      /bin/bash -c "
      ollama serve &
      until ollama list > /dev/null 2>&1; do sleep 2; done &&
      ollama pull mistral:7b-instruct &&
      wait
      "
    networks:
      - gopherbase-network

volumes:
  postgres_data:
  ollama_data:

networks:
  gopherbase-network:
    driver: bridge

Services Overview

| Service | Image | Port | Description | |---------|-------|------|-------------| | backend | ethicalgopher/gopherbase:latest | 8080 | Go Fiber API server | | frontend | ethicalgopher/gopherbase-frontend:latest | 4173 | Vite React application | | postgres | postgres:16-alpine | 5432 | PostgreSQL database | | ollama | ollama/ollama:latest | 11434 | Local LLM service (mistral:7b-instruct) |

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | DATABASE_URL | postgres://gopherbase:gopherbase@postgres:5432/gopherbase?sslmode=disable | PostgreSQL connection string | | JWT_SECRET | dev-secret | JWT authentication secret | | OLLAMA_HOST | http://ollama:11434 | Ollama service URL |

Ports Mapping

| Service | Internal | External | |---------|----------|----------| | Backend API | 8080 | 8080 | | Frontend | 4173 | 4173 | | PostgreSQL | 5432 | - | | Ollama | 11434 | - |

Common Tasks

# Start services
docker-compose up -d

# Stop services
docker-compose down

# View logs
docker-compose logs -f

# Rebuild images
docker-compose build --no-cache

JavaScript/TypeScript SDK

Installation

npm install gopherbase

Quick Start

import { createClient } from 'gopherbase';

const client = createClient('http://localhost:8080', 'your-public-key');

// Fetch data
const users = await client
  .from("users")
  .select("id, name, email")
  .where("age.gt.18")
  .execute();

// Insert data
await client
  .from("users")
  .insert({
    name: "John",
    email: "[email protected]",
    age: 25
  })
  .execute();

Authentication (React)

import { AuthProvider, useAuth } from 'gopherbase';

function App() {
  return (
    <AuthProvider url="http://localhost:8080">
      <MyComponent />
    </AuthProvider>
  );
}

function MyComponent() {
  const { user, signIn, signOut } = useAuth();
  
  const handleSignIn = () => signIn('[email protected]', 'password');
  
  return user ? (
    <button onClick={signOut}>Sign Out</button>
  ) : (
    <button onClick={handleSignIn}>Sign In</button>
  );
}

Raw SQL Execution

const result = await client.execute("SELECT * FROM users WHERE age > 18");

API Reference

createClient(url, key)

Creates a new GopherBase client instance.

  • url: The GopherBase server URL.
  • key: Your API key.

client.schema.create(table)

Starts a schema creation chain.

  • .column(name, type): Define a column.
  • .primary(): Set as primary key.
  • .autoIncrement(): Enable auto-increment.
  • .notNull() / .nullable(): Set nullability.
  • .unique(): Set UNIQUE constraint.
  • .default(value): Set default value.
  • .references(table, column): Add foreign key reference.
  • .execute(): Execute the schema creation.

client.from(table)

Returns a QueryBuilder for the specified table.

  • .select(columns): Select specific columns (default: *).
  • .where(condition): Add string-based where clauses (e.g., age.gt.18).
  • .match(object): Filter by exact key-value pairs.
  • .insert(data): Insert a record.
  • .update(data): Update records matching .match().
  • .delete(): Delete records matching .match().
  • .execute(): Execute the query.

client.ai.query(prompt, mode?)

Perform an AI-powered query using natural language.

client.storage.from(bucket)

Manage files in a specific bucket.

  • .listFiles()
  • .upload(file)
  • .delete(filename)
  • .getPublicUrl(filename)

Supported Column Types

  • INT, BIGINT
  • VARCHAR, TEXT
  • BOOLEAN
  • TIMESTAMP, DATE, TIME
  • FLOAT, DOUBLE

License

MIT