Skip to content

Open source, localhost supported, drop-in replacement and self-hosted alternative for Firebase using Node.js, Express.js, BetterAuth and PostgreSQL (JSONB) - Firebase πŸ’” | Supabase πŸ’” | Postbase ❀️

License

Notifications You must be signed in to change notification settings

umrashrf/postbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

82 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Postbase (Demo)

Open Source, localhost supported, Drop-in Replacement and Self-Hosted Alternative for Firebase using Node.js, Express.js, BetterAuth and PostgreSQL (JSONB), node-pg-migrate

Firebase πŸ’” | Supabase πŸ’” | Postbase ❀️

Demo Preact app is included !

Disclaimer !!!

Brand new project launched 02 Nov 2025, this is boiler plate but working! Expect heavy changes coming every few hours until stable

Mostly all code is ChatGPT generated but manually tested by human.

Docs

Authentication (Firebase Like API)

Sign Up

import { signIn } from './auth';

await signUp.email({ 
    email: 'umrashrf@gmail.com', 
    password: 'secure-password', 
    name: 'Umair Ashraf', 
    callbackURL: "/dashboard",
});

Sign In

import { signIn } from './auth';

await signIn.email({ 
    email: 'umrashrf@gmail.com',
    password: 'secure-password',
    callbackURL: '/dashboard',
});

auth.onAuthStateChanged, auth.currentUser and auth.currentUser.getIdToken()

import { auth } from './auth';

auth.onAuthStateChanged(user => {
    // user
    auth.currentUser === user // true
});

const token = auth.currentUser.getIdToken();
// token for API authentication and rules engine

Document Storage (Firestore Like API)

Collections, get/set/where/orderBy/limit/delete

import { db } from "./postbase";

const data = await db.collection('users').doc('docId').get();

await db.collection('users').set({ name: "Umair" }, { merge: true });

const reference = db.collection('users')
    .where('name', '==', 'Umair')
    .orderBy('createdAt')
    .limit(5);

const docs = await reference.get();

reference.onSnapshot(docs => {
    // use docs
});

Todo

  • Firebase Functions Replacement (Backend API can be used for now)
  • Firebase Storage Replacement (Support S3 and other backend)

In Progress

  • Testing

Done

  • Firebase Authentication Replacement
  • Firebase Firestore Replacement
  • Firebase Storage Replacement (Filebased Only)
  • Firebase Storage Replacement (HTTPS Based Upload)

License

MIT

About

Open source, localhost supported, drop-in replacement and self-hosted alternative for Firebase using Node.js, Express.js, BetterAuth and PostgreSQL (JSONB) - Firebase πŸ’” | Supabase πŸ’” | Postbase ❀️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published