Skip to content

Repository files navigation

Siden - AI Agent Orchestration Platform with Next.js & Supabase

Siden AI Platform

Empowering Teams with Intelligent AI Agent Orchestration

A modern, full-stack platform that seamlessly integrates AI agents with Next.js and Supabase for enhanced productivity and automation.


A modern, full-stack application template with Next.js 13, Supabase, and TypeScript. Visit siden.ai for more information.

This project integrates Next.js with Supabase for authentication, user profiles, settings, and project management.

Table of Contents

Features

Authentication

  • User signup and signin
  • Password reset flow
  • Email verification
  • Persistent sessions across tabs
  • Protected routes

User Profiles

  • Custom usernames
  • Profile pictures (with upload)
  • Personal websites and metadata

User Settings

  • Theme preferences
  • Email notification preferences

Projects

  • Create, read, update, delete operations
  • Project filtering and searching
  • Project permissions based on ownership

Available Agents

Agent Description Key Features
πŸ” Research Agent Web search and information gathering β€’ Serper API Integration
β€’ OpenAI Enhancement
β€’ Citation Support
β€’ Result Analysis
πŸ’» Code Agent Development and coding assistance β€’ Code Generation
β€’ Documentation
β€’ Debug Support
β€’ Multi-language Support
✍️ Writing Agent Content creation and editing β€’ Technical Writing
β€’ Email Assistance
β€’ Style Guidance
β€’ Content Generation
πŸ“Š Analysis Agent Data processing and insights β€’ Data Analysis
β€’ Report Generation
β€’ Decision Support
β€’ Visualization Tips

Agent Capabilities

πŸ” Research Agent
  • Search Integration

    • Web search via Serper API
    • Result filtering and ranking
    • Source verification
  • Analysis Features

    • Content summarization
    • Key point extraction
    • Citation generation
  • AI Enhancement

    • OpenAI integration
    • Context understanding
    • Relevance scoring
πŸ’» Code Agent
  • Development Support

    • Code generation
    • Bug fixing
    • Refactoring suggestions
  • Documentation

    • Code documentation
    • API documentation
    • Usage examples
  • Language Support

    • JavaScript/TypeScript
    • Python
    • SQL
    • And more...
✍️ Writing Agent
  • Content Creation

    • Technical documentation
    • Blog posts
    • Email composition
  • Editing Support

    • Grammar checking
    • Style suggestions
    • Format optimization
  • Specialized Writing

    • API documentation
    • User guides
    • Technical specifications
πŸ“Š Analysis Agent
  • Data Processing

    • Data cleaning
    • Pattern recognition
    • Trend analysis
  • Reporting

    • Insight generation
    • Report creation
    • Visualization suggestions
  • Decision Support

    • Data-driven recommendations
    • Risk assessment
    • Option analysis

Recent Fixes

  1. Authentication Persistence: Sessions now persist across tabs and refreshes
  2. Project Fetching Errors: Fixed error handling in project service
  3. Improved Auth Callback Handling: Better error handling and user onboarding
  4. Route Protection: Middleware now properly protects dashboard routes
  5. Enhanced User Experience: Added loading states and better error messages

Getting Started

1. Database Setup

Run the SQL commands in src/db/schema.sql in your Supabase SQL Editor to create:

  • Profiles table
  • Projects table
  • User settings table
  • Required RLS policies
  • Auto-creation triggers for new users

2. Storage Configuration

Follow the instructions in src/storage-setup.md to:

  • Create an 'avatars' bucket
  • Set up RLS policies for the bucket
  • Configure access controls

3. Environment Variables

Ensure your Supabase URL and Anon Key are properly configured in src/utils/supabase/config.ts.

For local development, you can also use a .env.local file:

E2B_API_KEY=
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
DATABASE_URL=
SERPER_API_KEY=
SLACK_BOT_TOKEN=

# Supabase Auth configuration
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
# Remove Clerk Auth keys to avoid conflicts with Supabase Auth
# NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
# CLERK_SECRET_KEY=
# NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
# CLERK_SECRET_KEY=

Features

Authentication

  • User signup and signin
  • Password reset flow
  • Email verification
  • Persistent sessions across tabs
  • Protected routes

User Profiles

  • Custom usernames
  • Profile pictures (with upload)
  • Personal websites and metadata

User Settings

  • Theme preferences
  • Email notification preferences

Projects

  • Create, read, update, delete operations
  • Project filtering and searching
  • Project permissions based on ownership

Usage

The authentication flow is now seamless:

  1. Sign Up: Creates a new user and automatically creates profile/settings
  2. Sign In: Persists session across tabs and page refreshes
  3. Account Management: Update profile, avatar, and settings
  4. Project Management: Create and manage projects with proper permissions

Key Files

  • src/utils/supabase/client.ts - Client-side Supabase client
  • src/utils/supabase/server.ts - Server-side Supabase client
  • src/utils/supabase/middleware.ts - Session refresh middleware
  • src/middleware.ts - Route protection and auth redirects
  • src/services/userService.ts - User profile and settings operations
  • src/services/projectService.ts - Project CRUD operations
  • src/app/auth/callback/route.ts - Auth callback handler for OAuth/email verification
  • src/app/dashboard/account/page.tsx - Account settings page
  • src/app/dashboard/settings/page.tsx - User settings page
  • src/app/signin/page.tsx and src/app/signup/page.tsx - Auth pages

Troubleshooting

Authentication Issues

  1. Check browser console for errors
  2. Verify your Supabase project URL and anon key are correct
  3. Ensure SQL migrations have been applied correctly
  4. Clear cookies and local storage if testing auth flows
  5. Check Supabase authentication logs in the dashboard

Project-related Errors

  1. Verify RLS policies are correctly set up
  2. Check that the user has appropriate permissions
  3. Confirm the database tables exist with correct schema
  4. Review Supabase database logs for query errors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

old archive of siden

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages