CRAI

hackathonproject-description2st-place

What is Crai?

Crai is a modern, full-stack SaaS platform designed to revolutionize AI-powered content creation and management for businesses. It provides a robust infrastructure for generating, managing, and optimizing various types of content (posts, blogs, ad copies, cold emails) using advanced AI, with a focus on scalability, security, and developer experience.

Purpose of the Crai

The primary purpose of Crai is to help businesses create exceptional content faster and more efficiently by leveraging artificial intelligence. Crai aims to democratize access to AI-driven content solutions, enabling companies to save time and resources while maintaining high-quality output. The platform is built to support rapid growth, global reach, and continuous innovation in content generation.

Core Functions

1. AI-Powered Content Generation

  • Generate social media posts, blogs, ad copies, and cold emails tailored to business needs.
  • Create content optimized for different platforms and audiences.
  • Provide intelligent suggestions and improvements for existing content.
  • Support multiple languages and content formats.

2. Content Management

  • Organize, edit, and manage all generated content in a unified dashboard.
  • Categorize and tag content for easy retrieval and organization.
  • Schedule content publication across different platforms.
  • Version control and revision history for all content items.

3. Company & User Management

  • Multi-tenant support for companies and users, including roles and permissions.
  • Role-based access control for different team members.
  • Team collaboration features for content review and approval.
  • User activity tracking and auditing capabilities.

4. Credit System

  • Track and manage usage credits for content generation.
  • Flexible subscription and pay-as-you-go pricing models.
  • Usage analytics and cost optimization recommendations.
  • Automated billing and payment processing.

5. Webhooks & Integrations

  • Sync user data and events with external services (e.g., Clerk for authentication).
  • Connect with popular marketing tools and content platforms.
  • API endpoints for custom integrations with business systems.
  • Extensible architecture for third-party plugin development.

Technical Requirements

Technology Stack:

Backend (API)

  • Runtime: Bun
  • Framework: Hono (RESTful API)
  • ORM: Drizzle ORM (with PostgreSQL/Supabase)
  • Authentication: Clerk (OAuth, JWT, webhooks)
  • Validation: Zod (with zValidator)
  • Logging: @repo/logger
  • Monorepo Management: Turborepo

Frontend (Web)

  • Framework: Next.js (App Router)
  • Styling: Tailwind CSS, shadcn/ui, Radix
  • Data Fetching: React Query (TanStack Query)
  • API Client: Typesafe RPC client (hono/client)
  • Authentication: Clerk

Shared Packages

  • Database Schema & Types: packages/db (Drizzle schema, zod types)
  • Utilities: Shared helpers, logger, id generation

Project Structure (Monorepo)

apps/
  ├── api/   # Bun API backend (Hono)
  └── web/   # Next.js frontend
packages/
  └── db/    # Shared DB schema, types, utils

Key Features

  • Modular, feature-based API and frontend structure
  • Type-safe end-to-end (DB → API → Client)
  • Scalable, production-ready setup
  • Easy local development and deployment
  • Built-in support for authentication, validation, and error handling