Complete API specification for the DBrift database provisioning platform.
http://44.209.63.61:8080/api
Create a new platform user account.
POST /api/users/create
{
"username": "utej",
"email": "user@example.com",
"password": "plain_password",
"creationDate": "2026-01-14T10:00:00Z"
}{
"id": 1,
"username": "utej",
"email": "user@example.com",
"creationDate": "2026-01-14T10:00:00Z"
}- 400: Validation error (missing fields, invalid email, etc.)
- 409: Email already exists
- 500: Server error
- Username: 3+ characters, alphanumeric + underscores
- Email: Valid email format
- Password: 6+ characters (plain text in request)
Authenticate user with email and password (simple password comparison).
POST /api/users/login
{
"email": "user@example.com",
"password": "plain_password"
}{
"id": 1,
"username": "utej",
"email": "user@example.com",
"creationDate": "2026-01-14T10:00:00Z"
}| Status | Message |
|---|---|
| 401 | User not found |
| 401 | Invalid password |
| 500 | Server error |
Provision a new PostgreSQL database in Docker and return credentials.
POST /api/db/create
{
"userId": 1,
"dbName": "my_app_db",
"dbType": "POSTGRES",
"dbVersion": "16",
"description": "Database for my application"
}- Database Name (text, required): 3-63 chars, alphanumeric + hyphens/underscores
- Database Type (dropdown): POSTGRES (only option for now)
- Database Version (dropdown): 16
- Description (textarea, optional): Additional info about the database
- Docker Postgres container is created with random port (5400+)
- Unique DB username & password are generated
- Metadata is saved in backend database
- Port mapping is configured
{
"id": 4,
"userId": 1,
"dbName": "my_app_db",
"dbType": "POSTGRES",
"dbVersion": "16",
"description": "Database for my application",
"username": "my_app_db9f31ab",
"password": "auto-generated-password",
"port": "5400",
"createdAt": "2026-01-14T11:06:48.128Z"
}- 400: Invalid database name or missing required fields
- 401: User not authenticated
- 409: Database name already exists for this user
- 500: Failed to create Docker container or database
- 503: Docker service unavailable
Show credentials modal with:
Host: <server-ip>
Port: 5400
Database: my_app_db
Username: my_app_db9f31ab
Password: ••••••••
Action Buttons:
- 📋 Copy Connection URL
- 📋 Copy Username
- 📋 Copy Password
postgresql://username:password@SERVER_IP:PORT/dbName
Example:
postgresql://my_app_db9f31ab:pass@54.196.8.224:5400/my_app_db
Show all databases owned by a user.
GET /api/db/user/{userId}
GET /api/db/user/1
[
{
"id": 4,
"userId": 1,
"dbName": "my_app_db",
"dbType": "POSTGRES",
"dbVersion": "16",
"port": "5400",
"description": "Database for my application",
"createdAt": "2026-01-14T11:06:48.128Z"
},
{
"id": 5,
"userId": 1,
"dbName": "analytics_db",
"dbType": "POSTGRES",
"dbVersion": "16",
"port": "5401",
"description": "Analytics database",
"createdAt": "2026-01-14T12:30:00.000Z"
}
]- 401: User not authenticated
- 404: User not found
- 500: Server error
Delete database and remove Docker container.
DELETE /api/db/{dbId}
DELETE /api/db/4
{
"message": "Database deleted successfully"
}- 401: User not authenticated
- 403: Database doesn't belong to user
- 404: Database not found
- 500: Failed to delete Docker container
- Landing Page → User sees platform features and "Get Started" button
- Sign Up → Create new account (username, email, password)
- Login → Authenticate with email and password
- Dashboard → View list of created databases
- Create Database Form → Fill in database details
- Credentials Display → Show connection info (password hidden initially)
- Copy Actions → Copy connection string, username, password
- External Use → User connects via psql or applications
- Auth State: User ID stored in Context & localStorage
- Database List: Fetched on dashboard load
- Credentials: Shown once after creation, can be closed
- Error Handling: Inline error messages with retry options
- Validates username (3+ chars), email format, password (6+ chars)
- Calls
POST /api/users/create - Shows success message and redirects to dashboard on success
- Validates email format and password
- Calls
POST /api/users/login - Stores user data in context and localStorage
- Redirects to dashboard on success
- Loads user's databases on mount using
GET /api/db/user/{userId} - Shows empty state if no databases exist
- Handles database creation flow
- Displays credentials modal after successful creation
- Handles database deletion with confirmation
- Shows all connection details
- Copy buttons for each field
- Password visibility toggle
- Auto-generated connection string
- Passwords are transmitted in plain text in requests (in production, use HTTPS)
- Consider password hashing on backend
- Database credentials should be securely managed
- Implement rate limiting on auth endpoints
- Add CORS headers for production
{
"message": "Email already registered",
"field": "email"
}{
"message": "Database name already exists for this user",
"field": "dbName"
}{
"message": "Invalid email or password"
}- Database backend set up
- Docker daemon running and accessible
- API endpoints implemented
- Frontend connected to correct API base URL
- Environment variables configured
- CORS headers set up
- Error handling implemented
- Testing completed
- SSL/HTTPS enabled in production
- Rate limiting configured
- Logging and monitoring set up