Overview
Theapplad_server package provides the runtime server that hosts Applad backend services, including:
- REST API endpoints for auth, database, storage, and functions
- WebSocket server for real-time features
- Request routing and middleware
- Service orchestration
Installation
Main Exports
ServerConfig
The main server configuration class:Usage
To run an Applad server:API Endpoints
The server exposes the following API routes:Authentication
POST /auth/signup- Create new accountPOST /auth/signin- Sign in with credentialsPOST /auth/signout- Sign outGET /auth/user- Get current userPOST /auth/refresh- Refresh auth token
Database
GET /tables/:table- Query table rowsPOST /tables/:table- Insert rowsPATCH /tables/:table- Update rowsDELETE /tables/:table- Delete rows
Storage
GET /storage/:bucket/:path- Download filePOST /storage/:bucket/:path- Upload fileDELETE /storage/:bucket/:path- Delete fileGET /storage/:bucket- List files
Functions
POST /functions/:name- Invoke serverless function
Real-time
WS /realtime- WebSocket connection for real-time updates
Middleware
The server includes built-in middleware for:- CORS handling
- Authentication verification
- Request logging
- Error handling
- Rate limiting
- Request validation
Configuration
Server behavior is controlled through:ServerConfig- Runtime server settings (port, host, CORS)InstanceConfig- Instance-level features and settingsProjectConfig- Project-specific configuration- Service configs - Auth, database, storage, function configs
Development
For local development:Production Deployment
The server can be deployed to various platforms:Source Location
packages/applad_server/lib/applad_server.dart