INSTROC Backend
INSTROC includes a complete backend infrastructure so you can build full-stack applications without managing servers.
What's Included
Every INSTROC project comes with:
| Service | Description |
|---|---|
| Database | PostgreSQL database for structured data |
| Authentication | User signup, login, and session management |
| Storage | File uploads and media hosting |
| API Routes | Serverless functions for custom logic |
Architecture
┌─────────────────────────────────────────────────┐
│ Your INSTROC App │
├─────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Pages │ │ API │ │ Server │ │
│ │ │ │ Routes │ │ Actions │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
│ └────────────┼────────────┘ │
│ │ │
│ ┌────────────┼────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │Database │ │ Auth │ │ Storage │ │
│ │(Supabase)│ │ │ │ │ │
│ └─────────┘ └─────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────┘
Powered by Supabase
INSTROC's backend is built on Supabase, an open-source Firebase alternative:
- PostgreSQL - Full-featured relational database
- Row Level Security - Fine-grained access control
- Real-time - Live data subscriptions
- Edge Functions - Serverless compute
- Auth - Multiple sign-in providers
Accessing the Backend
From AI Chat
Ask the AI to work with backend features:
Add a contact form that saves submissions to the database
Create an API endpoint that returns all published blog posts
Add Google OAuth login to my app
From Code
Import and use backend services:
import { db, auth, storage } from '@/lib/backend';
// Database query
const posts = await db.from('posts').select('*');
// Get current user
const user = await auth.getUser();
// Upload file
const { url } = await storage.upload('images', file);
From Dashboard
Manage your backend in the project dashboard:
- View and edit database tables
- Manage users and authentication
- Monitor storage usage
- Test API endpoints
Backend Features by Plan
| Feature | Free | Pro | Team |
|---|---|---|---|
| Database rows | 10,000 | 1,000,000 | Unlimited |
| Storage | 500 MB | 10 GB | 100 GB |
| Auth users | 1,000 | 50,000 | Unlimited |
| API requests | 50k/mo | 2M/mo | Unlimited |
Security
Built-in Security
- SSL encryption - All data encrypted in transit
- Row Level Security - Database-level access control
- JWT authentication - Secure session tokens
- Rate limiting - Protection against abuse
Best Practices
- Never expose secrets in frontend code
- Use environment variables for API keys
- Implement proper access control
- Validate all user input
Getting Started
- Database - Create tables and relationships
- Authentication - Add user login
- Storage - Handle file uploads
- API Routes - Write custom backend logic
Common Use Cases
User-Generated Content
Store blog posts, comments, or reviews with user ownership.
E-commerce
Product catalogs, shopping carts, and order management.
SaaS Applications
User accounts, subscriptions, and team management.
Internal Tools
Dashboards, admin panels, and data management.