Skip to content

Arjuna-Ragil/Localbase

Repository files navigation

Localbase


CI checks License

React Version Node Version Go Version Postgres

An open-source, self-hosted Backend-as-a-Service (BaaS) that flows in your local environment.


📝 About Project

Localbase is a Self-hosted Backend-as-a-Service (BaaS) that is similar to other BaaS like Firebase, Supabase, etc. The main focus is Self-host, developer can use this app to minimize work in creating and maintaining a database, storage bucket, AI, hosting, monitoring and private blockchain while keeping everything private in their own server, no third-party needed. There is also a private blockchain implemented to log every change in the app.

Target user: Developer, student, company owner

💡 Features

The current ready feature as of 21/01/2026

  • 🔐 Secure Authentication: JWT-based auth with HttpOnly Cookies (XSS protected).
  • 👑 Auto-Admin System: The first user to register automatically becomes the Super Admin. Subsequent users are standard Users.
  • 🛡️ Middleware Protection: Role-based access control (RBAC) ready.
  • 🏗️ Monorepo Architecture: Frontend and Backend live in harmony under one roof.

🛠️ TechStack

  • Frontend:

    • Build tool: Vite
    • Framework: React,
    • Styling: tailwind, shadcn/ui
    • Router: React Router
    • Data Fetching: Axios, TanStack Query
  • Backend:

    • Language: Golang
    • Framework: Gin
    • Main database: PostgresSQL
    • Audit database: SQLite
    • ORM/SQL: GORM + sqlx
  • Infrastructure:

    • Deployment: Docker
    • Demo and landing page host: self-host + Cloudflare

🛡️ Security & Isolation strategy

  • SQL Injection Protection: Validate input field
  • Project Isolation: Using table name prefix
  • Tamper-proofing: ledger will be separated from postgres to avoid loosing data

🌱 Getting Started (Local Development / Use)

Prerequisites

  • Go 1.22+
  • Node.js 20+
  • PostgreSQL (Local or Docker)

1. Clone the Repository

git clone https://github.com/Arjuna-Ragil/Localbase.git
cd localbase

2. Create env

Place in root folder

# Server Config
APP_ENV=                -> local (default) / dev / production
APP_PORT=
API_PREFIX=            

# Database Config
DB_HOST=
DB_PORT=
DB_USER=
DB_PASSWORD=
DB_NAME=

# Storage Path
STORAGE_PATH=
LEDGER_PATH=

# Middleware Config
AUTH_MODE=              -> true / false
SECRET_KEY=

3. Run the system

Recommended to install make for easier run command

  • For normal use case of the web, its recommended to run the whole docker:

    docker compose up -d --build
  • For developing the web, its recommended to run only the database docker:

    # database (Port 5432)
    docker compose up -d --build db
    
    # backend (Port 8080)
    make run_be
    
    # frontend (Port 5173)
    cd Lb-web
    npm ci
    npm run dev     # make run_fe can also work

🗺️ Roadmap

  • Milestone 1: System Foundation (Auth, Repo Pattern, CI/CD).
  • Milestone 2: Project Management (Create "Projects", API Keys).
  • Milestone 3: Database Manager (Create Tables/Columns via UI).
  • Milestone 4: Realtime Data & Storage.

🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Made with 💙 and ☕ by Juna

This is my first ever "kinda" big project, so sorry if there is something wrong with the planning or my coding habit. I'm open for any type of critics :)

About

A self-host, open-source BaaS that help to shorten development time by creating backend feature using a dashboard, similar to Firebase, Supabase, etc.

Topics

Resources

License

Stars

Watchers

Forks

Contributors