A scalable, multi-tenant Backend-as-a-Service (BaaS) platform built with Java Spring Boot and PostgreSQL.
BaaS Platform provides developers with production-ready backend infrastructure including authentication, project isolation, API key management, and dynamic JSON document storage.
The platform is designed around modern backend engineering principles such as stateless authentication, layered architecture, dynamic schema handling, and multi-tenant system design.
The API also speaks MCP, so Claude (or any MCP client) can set up a backend for you: tell it "create a backend for my todo app with a few sample todos and a test user" and it creates the project, collections, data and users.
Try it on the live demo server, https://baas-demo.onrender.com (free tier: the first request after a quiet spell takes up to a minute while it wakes up). Running your own copy? Use http://localhost:8080 instead.
1. Get a developer token (sign up once, then log in):
curl -X POST https://baas-demo.onrender.com/auth/signup -H 'Content-Type: application/json' \
-d '{"name":"You","email":"you@example.com","password":"your-password"}'
curl -X POST https://baas-demo.onrender.com/auth/login -H 'Content-Type: application/json' \
-d '{"email":"you@example.com","password":"your-password"}'2. Connect Claude Code with the token from the response:
claude mcp add --transport http baas https://baas-demo.onrender.com/mcp --header "Authorization: Bearer <token>"3. Ask Claude in an empty folder: "Create a backend for my book club app with sample data and a test user."
Tokens last 24 hours; log in again and re-add the server when one expires. The demo server is for trying things out: don't store anything private there.
| Tool | What it does |
|---|---|
list_projects |
Your projects |
create_project |
New project + API key. Safe to retry: an existing project with the same name is returned, not duplicated |
get_api_key |
A project's API key and how to call the data API with it |
list_collections |
Collections, document count and app-user count for a project |
insert_document |
Store a JSON document (collections are created on first insert) |
query_documents |
Read a collection, newest first, with an optional exact-match filter |
create_app_user |
Register an end user of your app |
Every tool runs as the developer who owns the token, and only works on that developer's projects. scripts/mcp-smoke.sh checks the whole flow end to end.
- Let an AI agent build your backend (MCP)
- Overview
- Core Features
- System Architecture
- Technology Stack
- Authentication Architecture
- Multi-Tenant Design
- Dynamic Data Engine
- Security Model
- API Reference
- Project Structure
- Database Design
- Installation & Setup
- Configuration
- Running the Application
- Example Workflow
- Future Roadmap
- Contributing
- License
BaaS Platform enables developers to integrate backend functionality into their applications without building backend infrastructure from scratch.
The platform exposes APIs for:
- Authentication
- Project management
- Dynamic document storage
- App user management
- API key-based access
The architecture is inspired by platforms such as Firebase, Supabase, and Auth0.
The platform provides JWT-based authentication for:
- Platform developers
- Application end users
Features include:
- User registration
- Secure login
- Password hashing using BCrypt
- JWT token generation
- Stateless authentication
Each developer account can create and manage multiple isolated projects.
Every project includes:
- Unique Project ID
- Dedicated API key
- Isolated application users
- Isolated collections and documents
Example:
Developer
├── ChatApp
├── EcommercePlatform
└── NotesApplication
The platform supports schema-less JSON document storage using PostgreSQL JSONB.
Developers can store any JSON structure dynamically without defining database entities.
Example:
{
"title": "Hello World",
"views": 120,
"published": true
}Supported use cases:
- Posts
- Products
- Orders
- Messages
- Activity feeds
- Custom application data
Application-level APIs are secured using project API keys.
Example:
x-api-key: sk_xxxxxxxxxxxxxxxxxThe platform uses a global exception handling mechanism for:
- Validation errors
- Authentication failures
- Business logic exceptions
- API consistency
Standardized API responses improve frontend integration and SDK development.
The platform follows a layered architecture.
Controller Layer
↓
Service Layer
↓
Repository Layer
↓
PostgreSQL Database
- Stateless authentication
- Separation of concerns
- DTO-driven API contracts
- Multi-tenant isolation
- API-first backend design
- Centralized security
- Java 21
- Spring Boot
- Spring Security
- Spring Data JPA
- Hibernate
- PostgreSQL
- PostgreSQL JSONB
- JWT (JSON Web Tokens)
- BCrypt Password Encoder
- API Key Authentication
- Maven
- Lombok
- Jackson
The platform contains two independent authentication systems.
Used by developers who manage projects on the platform.
POST /auth/signup
POST /auth/loginReturns JWT access token.
Used by client applications to authenticate their own users.
POST /sdk/auth/signup
POST /sdk/auth/loginProtected using:
x-api-keyThis enables developers to use the platform as an external authentication provider.
The platform uses project-level tenant isolation.
Each project has:
- Independent application users
- Independent collections
- Independent document storage
- Dedicated API credentials
Example:
ChatApp Users ≠ Ecommerce Users
This ensures proper tenant separation and secure project boundaries.
The platform stores dynamic application data using PostgreSQL JSONB.
POST /api/{projectId}/{collection}
GET /api/{projectId}/{collection}Example:
POST /api/project-id/postsThe system dynamically stores JSON documents without requiring schema migrations.
Used for:
- Platform authentication
- App user authentication
Features:
- Stateless authentication
- Token expiration
- Secure signature verification
Passwords are encrypted using BCrypt before storage.
The platform never stores plain-text passwords.
Dynamic collection APIs are protected using project-specific API keys.
The platform includes:
- Request validation
- Centralized exception handling
- Standardized API responses
POST /auth/signupRequest:
{
"name": "Vishal",
"email": "vishal@gmail.com",
"password": "123456"
}POST /auth/loginResponse:
{
"success": true,
"message": "Login successful",
"data": {
"token": "jwt-token"
}
}POST /projects
Authorization: Bearer JWT_TOKENResponse:
{
"success": true,
"message": "Project created successfully",
"data": {
"id": "project-id",
"name": "ChatApp",
"apiKey": "sk_xxxxx"
}
}POST /api/{projectId}/{collection}Headers:
x-api-key: PROJECT_API_KEYRequest:
{
"title": "Hello World",
"likes": 120
}GET /api/{projectId}/{collection}POST /sdk/auth/signupPOST /sdk/auth/loginsrc/main/java/com/vishal/baas_platform/
│
├── config/
├── controller/
├── dto/
├── entity/
├── exception/
├── repository/
├── security/
├── service/
├── util/
│
└── BaasPlatformApplication.java
Stores platform developer accounts.
Stores:
- Project metadata
- API keys
- Ownership information
Stores application users for client projects.
Stores dynamic JSON documents using PostgreSQL JSONB.
git clone https://github.com/your-username/baas-platform.gitcd baas-platformCreate database:
CREATE DATABASE baas_db;Configure application properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/baas_db
spring.datasource.username=postgres
spring.datasource.password=YOUR_PASSWORD
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
jwt.secret=yourSuperSecretKeyForJwtTokenGeneration123456Run the Spring Boot application:
mvn spring-boot:runApplication will start on:
http://localhost:8080
POST /auth/signupPOST /auth/loginReceive JWT token.
POST /projectsReceive:
- Project ID
- API Key
POST /api/{projectId}/postsPOST /sdk/auth/signupPlanned improvements:
- Swagger/OpenAPI Documentation
- Query Filtering
- Pagination
- Refresh Tokens
- Realtime WebSockets
- File Storage Service
- Rate Limiting
- SDK Generation
- Role-Based Access Control
- Dynamic Schema Validation
- React Admin Dashboard
- Analytics & Monitoring
Contributions, improvements, and suggestions are welcome.
To contribute:
- Fork repository
- Create feature branch
- Commit changes
- Open pull request
This project is currently intended for educational, learning, and portfolio purposes.