Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1d4b7ea
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
b239026
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
335d8dd
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
30dbb8a
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
82e5eca
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
4e6687d
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
d590ce8
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
e99ed18
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
86580ff
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
47ae311
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
bcf26ae
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
542a450
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
c8956da
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
68cd792
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
414f4d1
Update model-config/context-windows.mdx
mintlify[bot] Nov 25, 2025
1008323
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
13e1e7f
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
ae14598
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
0b751dc
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
c654a0a
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
e042537
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
ccd915d
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
ab18138
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
3d78049
Update integrations/supabase.mdx
mintlify[bot] Nov 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 47 additions & 29 deletions integrations/supabase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,48 @@ title: 'Supabase Integration'
description: 'Complete Supabase integration with database operations, authentication, real-time subscriptions, and TypeScript support'
---

# Supabase Integration
# Supabase integration

CodinIT provides comprehensive Supabase integration, enabling you to build full-stack applications with PostgreSQL databases, authentication, real-time subscriptions, and edge functions. This integration goes beyond basic database connectivity to include advanced features like Row Level Security, automated migrations, and TypeScript type generation.
CodinIT provides comprehensive Supabase integration, enabling you to build full-stack applications with databases, user login systems, live data updates, and server functions.

<Note>
**What is Supabase?** Supabase is a service that provides a database (a place to store your app's data), user authentication (login/signup systems), and other backend features—all without you needing to set up your own servers.
</Note>

This integration goes beyond basic database connectivity to include advanced features like Row Level Security (RLS), automated migrations, and TypeScript type generation.

## Overview

The Supabase integration in CodinIT offers enterprise-grade database capabilities with developer-friendly tooling:
The Supabase integration in CodinIT offers powerful database capabilities with easy-to-use tools:

<CardGroup cols={3}>
<Card title="PostgreSQL Database" icon="database">
Hosted PostgreSQL with advanced features and extensions
A hosted database to store all your app's information (users, posts, orders, etc.)
</Card>
<Card title="Authentication" icon="shield">
Complete user management with social providers and custom flows
Ready-made login systems including "Sign in with Google" and email/password
</Card>
<Card title="Real-time" icon="zap">
Live subscriptions and real-time data synchronization
Your app updates instantly when data changes—no page refresh needed
</Card>
</CardGroup>

### Key Features
### Key features

- **Automated Migrations**: Generate and execute SQL migrations with rollback support
- **Row Level Security**: Automatic RLS policy creation and management
- **TypeScript Integration**: Auto-generated types from your database schema
- **Real-time Subscriptions**: Live data updates without manual polling
- **Authentication Flows**: Complete user registration, login, and session management
- **Edge Functions**: Serverless functions for API endpoints and integrations
- **File Storage**: Built-in file upload and management capabilities
- **Automated migrations**: Database changes are tracked and can be undone if something goes wrong
- **Row Level Security (RLS)**: Rules that control who can see or edit specific data (for example, users can only see their own orders)
- **TypeScript integration**: Your code editor knows exactly what data types to expect, reducing errors
- **Real-time subscriptions**: Your app automatically updates when data changes—like seeing new messages appear without refreshing
- **Authentication flows**: Complete user registration, login, and session management
- **Edge functions**: Small programs that run on Supabase's servers to handle tasks like sending emails or processing payments
- **File storage**: Built-in file upload and management for images, documents, and other files

<Callout type="info">
**Default Choice**: Supabase is the recommended database solution for CodinIT projects requiring advanced database
**Default choice**: Supabase is the recommended database solution for CodinIT projects requiring advanced database
features, authentication, or real-time capabilities.
</Callout>

## Setup and Configuration
## Setup and configuration

### Connecting to Supabase

Expand All @@ -52,7 +58,11 @@ The Supabase integration in CodinIT offers enterprise-grade database capabilitie
<Step title="Provide Credentials">Share your Supabase URL and anon key when prompted</Step>
</Steps>

### Environment Variables
### Environment variables

<Note>
**What are environment variables?** These are secret settings stored outside your code. They keep sensitive information like passwords and API keys safe, and let you use different settings for testing vs. your live app.
</Note>

CodinIT automatically creates the necessary environment variables:

Expand All @@ -62,11 +72,10 @@ VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
```

<Callout type="warning">
**Security Note**: Never commit your Supabase service role key to version control. The anon key is safe for
client-side use.
**Security note**: Never share or publish your Supabase service role key. The "anon key" is safe to use in your app's front-end code.
</Callout>

### Connection Verification
### Connection verification

Once connected, CodinIT will:

Expand All @@ -80,9 +89,13 @@ If connection fails, you'll receive guidance to:
- Check project permissions
- Ensure network connectivity

## Database Operations
## Database operations

### Creating Tables and Schemas
### Creating tables and schemas

<Note>
**What is a table?** A table is like a spreadsheet in your database. Each table stores one type of information (like "users" or "orders"), with rows for each item and columns for each piece of data (like "name" or "email").
</Note>

CodinIT automatically generates SQL migrations for database changes:

Expand All @@ -99,33 +112,38 @@ CREATE TABLE users (

### Row Level Security (RLS)

<Note>
**What is Row Level Security?** RLS is like a security guard for your data. It automatically filters what each user can see or change. For example, you can set rules so users only see their own orders, not everyone else's.
</Note>

All tables automatically get RLS enabled with appropriate policies:

```sql
-- Enable RLS
-- Enable RLS (turn on the security guard)
ALTER TABLE users ENABLE ROW LEVEL SECURITY;

-- Create policies for authenticated users
-- Create a rule: users can only read their own data
CREATE POLICY "Users can read own data"
ON users
FOR SELECT
TO authenticated
USING (auth.uid() = id);
```

### Data Operations
### Data operations

**Querying Data:**
**Querying data (getting information from your database):**

```typescript
// CodinIT generates type-safe queries
// Get all active users from the database
const { data: users } = await supabase.from('users').select('*').eq('status', 'active');
```

**Real-time Subscriptions:**
**Real-time subscriptions (automatically update when data changes):**

```typescript
// Live data updates
// Listen for any changes to the users table
// When someone signs up or updates their profile, your app knows immediately
const channel = supabase
.channel('users')
.on(
Expand Down
70 changes: 38 additions & 32 deletions model-config/context-windows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ title: "Context Window Guide"
description: "Understanding and managing AI model context windows"
---

## What is a Context Window?
## What is a context window?

A context window is the maximum amount of text an AI model can process at once. Think of it as the model's "working memory" - it determines how much of your conversation and code the model can consider when generating responses.

<Note>
**Key Point**: Larger context windows allow the model to understand more of your codebase at once, but may increase costs and response times.
**What are tokens?** Tokens are small chunks of text that AI models read. A token is roughly ¾ of a word. For example, the word "hamburger" becomes two tokens: "ham" and "burger". When we talk about context window sizes like "128K tokens," that means the AI can read about 96,000 words at once.
</Note>

### Quick Reference
<Tip>
**Key point**: Larger context windows allow the model to understand more of your codebase at once, but may increase costs and response times.
</Tip>

### Quick reference

| Size | Tokens | Approximate Words | Use Case |
| --------------- | ------ | ----------------- | ------------------------- |
Expand All @@ -21,7 +25,7 @@ A context window is the maximum amount of text an AI model can process at once.
| **Extra Large** | 400K+ | ~300,000+ | Entire applications |
| **Massive** | 1M+ | ~750,000+ | Multi-project analysis |

### Model Context Windows
### Model context windows

| Model | Context Window | Effective Window\* | Notes |
| --------------------- | -------------- | ------------------ | ------------------------------ |
Expand All @@ -31,18 +35,18 @@ A context window is the maximum amount of text an AI model can process at once.
| **DeepSeek V3** | 128K tokens | ~100K tokens | Optimal for most tasks |
| **Qwen3 Coder** | 256K tokens | ~200K tokens | Good balance |

\*Effective window is where model maintains high quality
\*Effective window is where the model maintains high quality. Beyond this point, the AI may start "forgetting" earlier parts of your conversation.

### What Counts Toward Context
### What counts toward context

1. **Your current conversation** - All messages in the chat
2. **File contents** - Any files you've shared or CodinIT has read
3. **Tool outputs** - Results from executed commands
4. **System prompts** - CodinIT's instructions (minimal impact)

### Optimization Strategies
### Optimization strategies

#### 1. Start Fresh for New Features
#### 1. Start fresh for new features

```mdx
/new - Creates a new task with clean context
Expand All @@ -54,25 +58,25 @@ Benefits:
- No irrelevant history
- Better model focus

#### 2. Use @ Mentions Strategically
#### 2. Use @ mentions strategically

Instead of including entire files:

- `@filename.ts` - Include only when needed
- Use search instead of reading large files
- Reference specific functions rather than whole files

#### 3. Enable Auto-compact
#### 3. Enable auto-compact

CodinIT can automatically summarize long conversations:
CodinIT can automatically summarize long conversations to free up space in the context window:

- Settings → Features → Auto-compact
- Preserves important context
- Reduces token usage

## Context Window Warnings
## Context window warnings

### Signs You're Hitting Limits
### Signs you're hitting limits

| Warning Sign | What It Means | Solution |
| ----------------------------- | ----------------------------- | ------------------------------------- |
Expand All @@ -81,58 +85,60 @@ CodinIT can automatically summarize long conversations:
| **Repetitive suggestions** | Context fragmentation | Summarize and start fresh |
| **Missing recent changes** | Context overflow | Use checkpoints to track changes |

### Best Practices by Project Size
### Best practices by project size

#### Small Projects (\< 50 files)
#### Small projects (\< 50 files)

- Any model works well
- Include relevant files freely
- No special optimization needed

#### Medium Projects (50-500 files)
#### Medium projects (50-500 files)

- Use 128K+ context models
- Include only working set of files
- Clear context between features

#### Large Projects (500+ files)
#### Large projects (500+ files)

- Use 200K+ context models
- Focus on specific modules
- Use search instead of reading many files
- Break work into smaller tasks

## Advanced Context Management
## Advanced context management

### Plan/Act Mode Optimization
### Plan/Act mode optimization

Leverage Plan/Act mode for better context usage:

- **Plan Mode**: Use smaller context for discussion
- **Act Mode**: Include necessary files for implementation
- **Plan Mode**: Use smaller context for discussion and planning
- **Act Mode**: Include necessary files when you're ready to write code

Configuration:
Configuration example:

```
Plan Mode: DeepSeek V3 (128K) - Lower cost planning
Act Mode: Claude Sonnet (1M) - Maximum context for coding
```

### Context Pruning Strategies
### Context pruning strategies

These are ways CodinIT can reduce the amount of text in your context window:

1. **Temporal Pruning**: Remove old conversation parts
2. **Semantic Pruning**: Keep only relevant code sections
3. **Hierarchical Pruning**: Maintain high-level structure, prune details
1. **Temporal pruning**: Remove older parts of your conversation that are no longer relevant
2. **Semantic pruning**: Keep only the code sections related to your current task
3. **Hierarchical pruning**: Keep the big picture but remove fine details

### Token Counting Tips
### Token counting tips

#### Rough Estimates
#### Rough estimates

- **1 token ≈ 0.75 words**
- **1 token ≈ 0.75 words** (so 1,000 tokens is about 750 words)
- **1 token ≈ 4 characters**
- **100 lines of code ≈ 500-1000 tokens**

#### File Size Guidelines
#### File size guidelines

| File Type | Tokens per KB |
| -------------- | ------------- |
Expand All @@ -141,7 +147,7 @@ Act Mode: Claude Sonnet (1M) - Maximum context for coding
| **Markdown** | ~200-300 |
| **Plain text** | ~200-250 |

## Context Window FAQ
## Context window FAQ

### Q: Why do responses get worse with very long conversations?

Expand All @@ -163,7 +169,7 @@ Act Mode: Claude Sonnet (1M) - Maximum context for coding
- Show an error and suggest starting a new task
- Truncate older messages (with warning)

## Recommendations by Use Case
## Recommendations by use case

| Use Case | Recommended Context | Model Suggestion |
| ----------------------- | ------------------- | ----------------- |
Expand Down