Docs/Getting Started

Getting Started

Quick start guide to get your first application running in under 30 minutes.

Getting Started with AlgorithmShift

Quick Start Guide

Get your first application up and running in under 30 minutes.


Step 1: Create Your Organization

  1. Sign up at app.algorithmshift.com
  2. Create an organization - This is your top-level container
  3. Invite team members (optional) - Add collaborators with specific roles
Organization
├── Workspaces (isolated environments)
│   ├── Applications (your apps)
│   │   ├── Database (entities/tables)
│   │   ├── Server Functions (custom logic)
│   │   └── Deployments (releases)

Step 2: Create Your First Workspace

A workspace is an isolated environment with its own:

  • Database schema
  • API credentials
  • Environment variables
  • Secrets

Creating a Workspace

  1. Navigate to Workspaces in the admin portal
  2. Click + New Workspace
  3. Enter a name (e.g., "My First App")
  4. Select a region (for database location)
  5. Click Create

The system will automatically:

  • Create an isolated PostgreSQL schema
  • Generate API credentials
  • Set up default tables (users, roles, permissions)
  • Configure caching layer

Step 3: Design Your Database

Creating Entities (Tables)

  1. Go to DatabaseEntities
  2. Click + New Entity
  3. Define your fields:
typescript
// Example: Products Entity
{
  name: "products",
  fields: [
    { name: "id", type: "uuid", primary: true },
    { name: "name", type: "string", required: true },
    { name: "description", type: "text" },
    { name: "price", type: "decimal", required: true },
    { name: "category_id", type: "uuid", foreignKey: "categories.id" },
    { name: "is_active", type: "boolean", default: true },
    { name: "created_at", type: "timestamp", default: "now()" },
    { name: "updated_at", type: "timestamp" }
  ]
}

Supported Field Types

TypeDescriptionExample
uuidUnique identifier550e8400-e29b-41d4-a716-446655440000
stringShort text (255 chars)"Product Name"
textLong textMulti-paragraph content
integerWhole numbers42
decimalPrecise decimals99.99
booleanTrue/falsetrue
timestampDate and time2024-01-15T10:30:00Z
jsonStructured data{ "key": "value" }
arrayList of values["tag1", "tag2"]

Step 4: Build Your UI

  1. Open the Builder from the admin portal
  2. Start with a template or blank page
  3. Drag and drop blocks from the library:

- Authentication forms - Dashboard layouts - Data tables - Charts and analytics

  1. Customize properties in the right panel
  2. Connect to your data sources
  3. Export clean TSX code

Option B: AI Page Generator

  1. Open the Builder
  2. Click "Generate with AI"
  3. Describe what you want:
"Create a product management dashboard with:
- A header with logo and user menu
- Sidebar navigation with Products, Categories, Orders
- Main content area with a data table showing products
- Add/Edit product modal with form
- Stats cards showing total products, revenue, orders"
  1. AI generates the complete page structure
  2. Customize and refine as needed

Step 5: Add Business Logic

Custom Server Functions

Write TypeScript/JavaScript functions that run on the server:

typescript
// functions/calculate-order-total.ts
export async function calculateOrderTotal(orderId: string) {
  const order = await db.orders.findById(orderId);
  const items = await db.orderItems.find({ order_id: orderId });

  let subtotal = 0;
  for (const item of items) {
    subtotal += item.quantity * item.unit_price;
  }

  const tax = subtotal * 0.08; // 8% tax
  const total = subtotal + tax;

  await db.orders.update(orderId, {
    subtotal,
    tax,
    total
  });

  return { subtotal, tax, total };
}

Triggers (Automatic Actions)

Set up automatic actions on database events:

typescript
// Before creating a new user
{
  entity: "users",
  event: "before_create",
  action: async (data) => {
    // Validate email domain
    if (!data.email.endsWith("@company.com")) {
      throw new Error("Only company emails allowed");
    }
    // Hash password
    data.password = await hashPassword(data.password);
    return data;
  }
}

// After creating an order
{
  entity: "orders",
  event: "after_create",
  action: async (data) => {
    // Send confirmation email
    await sendEmail({
      to: data.customer_email,
      template: "order-confirmation",
      data: { orderId: data.id }
    });
    // Update inventory
    await updateInventory(data.items);
  }
}

Step 6: Configure Environments

Default Environments

EnvironmentPurposeAuto-Deploy
DevelopmentActive developmentOn every push
StagingPre-production testingManual
ProductionLive usersManual + Approval

Environment-Specific Configuration

Each environment can have:

  • Different database connections
  • Unique environment variables
  • Separate secrets (API keys, credentials)
  • Custom domains

Step 7: Deploy Your Application

Deployment Flow

Development → Staging → Production
     │           │           │
     ▼           ▼           ▼
  Auto-deploy  Manual     Approval
               promote    required

Creating a Release

  1. Go to DeploymentsReleases
  2. Click Create Release
  3. Add version tag (e.g., v1.0.0)
  4. Add release notes
  5. Deploy to Development (automatic)
  6. Test in development environment
  7. Promote to Staging when ready
  8. Test in staging
  9. Promote to Production with approval

Step 8: Connect Your Frontend

Using the ClientAPI

typescript
// Install the SDK
npm install @algorithmshift/client

// Initialize
import { AlgorithmShiftClient } from '@algorithmshift/client';

const client = new AlgorithmShiftClient({
  workspaceId: 'your-workspace-id',
  apiKey: 'your-api-key'
});

// Fetch data
const products = await client.entities.products.find({
  where: { is_active: true },
  orderBy: { created_at: 'desc' },
  limit: 10
});

// Create record
const newProduct = await client.entities.products.create({
  name: 'New Product',
  price: 29.99,
  category_id: 'category-uuid'
});

// Call custom function
const total = await client.functions.calculateOrderTotal('order-uuid');

What's Next?

  • [Client Journey](/docs/client-journey) - Deep dive into the complete workflow
  • [Visual Builder Guide](/docs/builder) - Master the design tools
  • [ClientAPI Reference](/docs/client-api) - Complete API documentation
  • [Server Functions](/docs/server-functions) - Advanced custom logic
  • [Deployment Guide](/docs/deployment) - CI/CD and release management