Zoer Database

Zoer Database provides a secure, managed PostgreSQL database solution that seamlessly integrates with your projects. Whether you're building a simple landing page or a complex CRM system, Zoer offers flexible database options to meet your needs.

Database Options

When creating a new project in Zoer, you have two database configuration options:

No Database

Perfect for static websites, landing pages, portfolios, and other projects that don't require backend data storage. These are pure frontend applications that run entirely in the browser.

Best for:

  • Landing pages
  • Portfolio websites
  • Documentation sites
  • Static marketing pages
  • Presentation websites

Zoer Database

A fully managed PostgreSQL database hosted securely in the cloud. This option is ideal for dynamic applications that need to store and retrieve data.

Best for:

  • CRM systems
  • E-commerce platforms
  • User management systems
  • Content management systems
  • Data-driven applications

Key Features:

  • Managed PostgreSQL: Store data in our secure, managed PostgreSQL database
  • Automatic Setup: AI-generated database schema based on your project requirements
  • Test Data: Pre-populated with sample data for immediate testing
  • Easy Management: Simple interface for data operations
  • Future Connectivity: Coming soon - connect your own external database

Getting Started with Zoer Database

Let's walk through creating a CRM system as an example:

Step 1: Choose Zoer Database

When creating your project, select "Zoer Database" from the database options. This tells Zoer that your application will need persistent data storage.

Step 2: AI-Generated Database Schema

Once you describe your project requirements, Zoer's AI will automatically:

  1. Analyze your project needs - Understanding what data structures are required
  2. Generate database schema - Creating appropriate tables, relationships, and constraints
  3. Create app.sql file - A complete SQL script defining your database structure
  4. Populate test data - Adding sample data so you can immediately test your application

The generated app.sql file contains:

  • Table definitions with appropriate data types
  • Relationships between tables (foreign keys, indexes)
  • Sample data for testing your application
  • Security constraints and validation rules

Step 3: Database Management Interface

After your project is generated, you can access the database management interface to view and manage your data:

Features available:

  • View all tables and their structure
  • Browse data with pagination and filtering
  • Add new records directly through the interface
  • Edit existing data with real-time validation
  • Delete records with confirmation prompts
  • Export data in various formats (CSV, JSON, SQL)

Step 4: AI-Powered Database Operations

For advanced database operations, you can use Zoer Copilot to interact with your database using natural language commands.

Examples of what you can do:

  • "Show me all customers from New York"
  • "Add a new product with name 'Premium Plan' and price $99"
  • "Update all orders from last month to 'completed' status"
  • "Create a report of top-selling products"

Database Schema Examples

CRM System Schema

-- Companies table
CREATE TABLE companies (
    id SERIAL PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    industry VARCHAR(100),
    website VARCHAR(255),
    created_at TIMESTAMP DEFAULT NOW()
);

-- Contacts table
CREATE TABLE contacts (
    id SERIAL PRIMARY KEY,
    company_id INTEGER REFERENCES companies(id),
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    email VARCHAR(255) UNIQUE,
    phone VARCHAR(20),
    position VARCHAR(100),
    created_at TIMESTAMP DEFAULT NOW()
);

-- Deals table
CREATE TABLE deals (
    id SERIAL PRIMARY KEY,
    company_id INTEGER REFERENCES companies(id),
    contact_id INTEGER REFERENCES contacts(id),
    title VARCHAR(255) NOT NULL,
    value DECIMAL(10,2),
    stage VARCHAR(50) DEFAULT 'prospect',
    close_date DATE,
    created_at TIMESTAMP DEFAULT NOW()
);

E-commerce Schema

-- Products table
CREATE TABLE products (
  id SERIAL PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  description TEXT,
  price DECIMAL(10,2) NOT NULL,
  stock_quantity INTEGER DEFAULT 0,
  category VARCHAR(100),
  image_url VARCHAR(500),
  created_at TIMESTAMP DEFAULT NOW()
);

-- Orders table
CREATE TABLE orders (
    id SERIAL PRIMARY KEY,
    customer_email VARCHAR(255) NOT NULL,
    status VARCHAR(50) DEFAULT 'pending',
    total_amount DECIMAL(10,2) NOT NULL,
    shipping_address TEXT,
    created_at TIMESTAMP DEFAULT NOW()
);

-- Order items table
CREATE TABLE order_items (
    id SERIAL PRIMARY KEY,
    order_id INTEGER REFERENCES orders(id),
    product_id INTEGER REFERENCES products(id),
    quantity INTEGER NOT NULL,
    unit_price DECIMAL(10,2) NOT NULL
);

Data Access in Your Application

Frontend Integration

Your application automatically gets access to database functions:

// Fetch all customers
const customers = await db.query('SELECT * FROM customers ORDER BY created_at DESC');

// Add new customer
const newCustomer = await db.query(
  'INSERT INTO customers (name, email, company) VALUES ($1, $2, $3) RETURNING *',
  [name, email, company]
);

// Update customer
await db.query(
  'UPDATE customers SET email = $1 WHERE id = $2',
  [newEmail, customerId]
);

// Delete customer
await db.query('DELETE FROM customers WHERE id = $1', [customerId]);

API Endpoints

Zoer automatically generates RESTful API endpoints for your database tables:

# Get all records
GET /api/customers

# Get specific record
GET /api/customers/123

# Create new record
POST /api/customers
{
  "name": "John Doe",
  "email": "john@example.com",
  "company": "Acme Inc"
}

# Update record
PUT /api/customers/123
{
  "email": "john.doe@acme.com"
}

# Delete record
DELETE /api/customers/123

Security & Best Practices

Data Security

  • Encrypted connections: All database connections use SSL/TLS encryption
  • Access control: Database access is restricted to your application
  • Backup & recovery: Automatic daily backups with point-in-time recovery
  • Monitoring: Real-time monitoring for performance and security

Performance Optimization

  • Automatic indexing: AI creates optimal indexes for your queries
  • Connection pooling: Efficient database connection management
  • Query optimization: Built-in query performance analysis
  • Caching: Intelligent caching for frequently accessed data

Data Validation

// Input validation is automatically applied
const customer = {
  name: "John Doe",           // Required, max 255 characters
  email: "john@example.com",  // Required, valid email format
  phone: "+1-555-0123",       // Optional, phone format validation
  age: 25                     // Optional, numeric validation
};

Migration & Backup

Automatic Backups

  • Daily backups with 30-day retention
  • Point-in-time recovery for the last 7 days
  • One-click restore from backup interface
  • Export options for manual backups

Data Migration

When you're ready to scale, you can easily migrate to your own database:

  1. Export your schema - Get the complete SQL structure
  2. Export your data - Download all data in multiple formats
  3. Connect external database - Link your own PostgreSQL instance (coming soon)
  4. Seamless migration - Zero-downtime database switching

Monitoring & Analytics

Database Statistics

  • Storage usage and growth trends
  • Query performance metrics
  • Connection statistics and usage patterns
  • Error monitoring and alerting

Usage Insights

  • Popular queries and optimization suggestions
  • Table growth and data distribution
  • Performance bottlenecks identification
  • Cost optimization recommendations

Coming Soon

External Database Connectivity

  • Connect your own PostgreSQL database
  • Support for MySQL and other database engines
  • Multi-database project support
  • Database synchronization tools

With Zoer Database, you can focus on building amazing applications while we handle the complexity of database management, security, and optimization.