Warning
π§ Work in Progress β This project is under active development and not yet production-ready. Features may be incomplete, APIs may change, and bugs are expected. Use at your own risk!
- Create Collections β Define your data structure with a visual schema builder
- Multiple Field Types β String, Number, Boolean, Email, URL, Date, DateTime, Text, Select, JSON, and Relations
- Drag & Drop Fields β Reorder fields with intuitive drag-and-drop
- Field Validation β Set required fields, default values, and descriptions
- Single Relations (Many-to-One) β Link items to a single related item
- Multiple Relations (Many-to-Many) β Link items to multiple related items
- Configurable Population β Control which fields to populate in API responses
- Smart Display β Choose display fields for better UX
Every collection automatically gets full CRUD endpoints:
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/{collection} |
List all items |
GET |
/api/{collection}/{id} |
Get single item |
POST |
/api/{collection} |
Create new item |
PUT |
/api/{collection}/{id} |
Update item |
DELETE |
/api/{collection}/{id} |
Delete item |
- Enable/Disable Routes β Toggle individual API endpoints
- Custom Paths β Rename API endpoints
- API Key Protection β Secure routes with API keys
- Population Control β Configure default relation population
- User Subdomains β Each user gets their own workspace (e.g.,
username.localhost:3000) - Isolated Data β Collections and items are scoped to workspaces
- Custom Usernames β Choose and change your workspace subdomain
- Directus/Strapi Inspired β Clean, professional admin interface
- Sidebar Navigation β Quick access to all collections
- Dark/Light Mode β Toggle between themes
- Responsive Design β Works on desktop and mobile
| Category | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Language | TypeScript 5 |
| Styling | Tailwind CSS 4 |
| UI Components | shadcn/ui + Radix UI |
| State Management | Zustand |
| Data Fetching | React Query (TanStack Query) |
| Authentication | Better Auth |
| Database | SQLite (better-sqlite3) |
| Storage | File-based JSON storage |
| Drag & Drop | dnd-kit |
- Node.js 18+ or Bun runtime
- Git
-
Clone the repository
git clone https://github.com/yourusername/api-builder.git cd api-builder -
Install dependencies
bun install # or npm install -
Set up environment variables
cp .env.example .env
Edit
.envand configure:BETTER_AUTH_SECRET=your-super-secret-key-here BETTER_AUTH_URL=http://localhost:3000
-
Run database migrations
bunx @better-auth/cli migrate
-
Start the development server
bun dev # or npm run dev -
Open the app
Visit http://localhost:3000
api-builder/
βββ app/ # Next.js App Router
β βββ (auth)/ # Auth pages (login, signup)
β βββ api/ # API routes
β β βββ [collection]/ # Dynamic collection endpoints
β β βββ auth/ # Better Auth handlers
β β βββ sync/ # Client-server sync
β βββ collections/ # Collection pages
β β βββ [id]/ # Collection detail, edit, items
β βββ settings/ # User settings
β βββ layout.tsx # Root layout
β βββ page.tsx # Dashboard
βββ components/ # React components
β βββ ui/ # shadcn/ui primitives
β βββ app-sidebar.tsx # Main navigation
β βββ app-topbar.tsx # Breadcrumbs & actions
β βββ dashboard.tsx # Home page content
β βββ data-table.tsx # Items table
β βββ field-editor.tsx # Schema field editor
β βββ ...
βββ lib/ # Utilities & stores
β βββ auth.ts # Better Auth server config
β βββ auth-client.ts # Better Auth client
β βββ store.ts # Zustand store
β βββ storage.ts # File-based storage
β βββ types.ts # TypeScript types
β βββ ...
βββ data/ # JSON data storage (gitignored)
βββ public/ # Static assets
| Variable | Description | Required |
|---|---|---|
BETTER_AUTH_SECRET |
Secret key for JWT signing | Yes |
BETTER_AUTH_URL |
Base URL of your app | Yes |
For local development with subdomains, your browser needs to resolve *.localhost domains. Most modern browsers handle this automatically.
Testing subdomains:
http://localhost:3000 # Main app
http://username.localhost:3000 # User workspace
GET /api/{collection}Query Parameters:
populateβ Comma-separated relation fields to populate
Example:
curl http://localhost:3000/api/posts?populate=author,tagsGET /api/{collection}/{id}Query Parameters:
populateβ Comma-separated relation fields to populate
POST /api/{collection}
Content-Type: application/json
{
"fieldName": "value",
"relationField": "related-item-id"
}PUT /api/{collection}/{id}
Content-Type: application/json
{
"fieldName": "updated value"
}DELETE /api/{collection}/{id}For routes with API key protection:
curl -H "X-API-Key: your-api-key" http://localhost:3000/api/posts- Webhooks support
- GraphQL API generation
- File/Media field type
- Role-based access control
- API rate limiting
- Export/Import collections
- Audit logs
- Real-time updates (WebSockets)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 API Builder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- Next.js β The React Framework
- shadcn/ui β Beautiful UI components
- Better Auth β Authentication library
- Zustand β State management
- Directus & Strapi β UI/UX inspiration
