Skip to content

bashkos/crystal

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Crystal - Influencer UGC Platform

A comprehensive influencer marketplace platform that connects brands with content creators for user-generated content campaigns.

πŸš€ Features

Core Platform

  • Multi-Role System: Brands, Influencers, and Admin roles with specialized dashboards
  • Advanced Authentication: OAuth (Google, LinkedIn, Instagram) + email/password
  • Role-Based Access Control: Secure permissions and workflow management

For Brands

  • Campaign Management: Create and manage UGC campaigns
  • Influencer Discovery: Search and filter influencers by niche, metrics, and demographics
  • Contract Management: Automated contract generation and digital signatures
  • Payment Processing: Escrow-based payment system with Stripe integration
  • Analytics Dashboard: Campaign performance tracking and ROI analysis

For Influencers

  • Profile Builder: Comprehensive portfolio and metrics display
  • Campaign Discovery: Browse and apply to relevant campaigns
  • Content Submission: Upload and manage content deliverables
  • Application Tracking: Monitor application status and communication
  • Earnings Dashboard: Track payments and financial analytics

πŸ› οΈ Technology Stack

  • Frontend: Next.js 14 with TypeScript and Tailwind CSS
  • Backend: Next.js API Routes with Prisma ORM
  • Database: PostgreSQL with comprehensive schema
  • Authentication: NextAuth.js with multiple OAuth providers
  • Payments: Stripe Connect for escrow and marketplace payments
  • UI Components: Radix UI with custom Tailwind styling

πŸ“ Project Structure

crystal/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js app router
β”‚   β”‚   β”œβ”€β”€ (auth)/            # Authentication pages
β”‚   β”‚   β”œβ”€β”€ dashboard/         # User dashboards
β”‚   β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   └── globals.css        # Global styles
β”‚   β”œβ”€β”€ components/            # Reusable components
β”‚   β”‚   β”œβ”€β”€ ui/               # Base UI components
β”‚   β”‚   β”œβ”€β”€ forms/            # Form components
β”‚   β”‚   β”œβ”€β”€ layouts/          # Layout components
β”‚   β”‚   └── providers/        # Context providers
β”‚   β”œβ”€β”€ lib/                  # Utilities and configurations
β”‚   β”‚   β”œβ”€β”€ auth.ts           # NextAuth config
β”‚   β”‚   β”œβ”€β”€ db.ts             # Prisma client
β”‚   β”‚   └── utils.ts          # Helper functions
β”‚   β”œβ”€β”€ types/                # TypeScript type definitions
β”‚   └── prisma/               # Database schema and migrations
β”œβ”€β”€ public/                   # Static assets
└── docs/                     # Project documentation

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • npm or yarn

Installation

  1. Clone and setup

    git clone <repository-url>
    cd crystal
    npm install
  2. Environment setup

    cp .env.example .env.local
    # Configure your environment variables
  3. Database setup

    npm run db:generate
    npm run db:push
  4. Start development

    npm run dev

Visit http://localhost:3000 to see the application.

Environment Variables

Key environment variables to configure in .env.local:

# Database
DATABASE_URL="postgresql://username:password@localhost:5432/crystal_db"

# NextAuth.js
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"

# OAuth Providers
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
LINKEDIN_CLIENT_ID="your-linkedin-client-id"
LINKEDIN_CLIENT_SECRET="your-linkedin-client-secret"

# Stripe
STRIPE_PUBLISHABLE_KEY="pk_test_your-key"
STRIPE_SECRET_KEY="sk_test_your-key"

πŸ“Š Database Schema

The platform uses a comprehensive PostgreSQL schema with:

  • Users & Profiles: Multi-role user system with specialized profiles
  • Campaigns: Campaign management with requirements and deliverables
  • Applications: Application workflow with status tracking
  • Contracts: Smart contract management with payment schedules
  • Payments: Escrow-based payment processing
  • Reviews: Multi-dimensional rating system
  • Messages: In-app communication system

πŸ”§ Development Commands

# Development
npm run dev              # Start development server
npm run build           # Build for production
npm run start           # Start production server

# Database
npm run db:generate     # Generate Prisma client
npm run db:push         # Push schema to database
npm run db:migrate      # Run migrations
npm run db:studio       # Open Prisma Studio

# Code Quality
npm run lint            # Run ESLint
npm run type-check      # TypeScript type checking

🎯 Current Status

Phase 1 Foundation - βœ… Complete

  • βœ… Next.js 14 + TypeScript setup
  • βœ… Tailwind CSS UI framework
  • βœ… Prisma + PostgreSQL configuration
  • βœ… NextAuth.js authentication system
  • βœ… Role-based user management
  • βœ… Basic UI components library
  • βœ… Authentication pages (login/signup)
  • βœ… Dashboard layouts for brands and influencers

Phase 2 Core Features - βœ… Complete

  • βœ… Brand profile management with company details
  • βœ… Influencer profile management with portfolio
  • βœ… Campaign creation and management system
  • βœ… Campaign browsing and discovery for influencers
  • βœ… Application workflow and management
  • βœ… Contract generation and status tracking
  • βœ… Stripe payment processing integration
  • βœ… Content submission and review workflow
  • βœ… Real-time messaging system
  • βœ… Search and filtering capabilities

Platform Statistics

  • πŸ“Š 15+ complete user interfaces
  • πŸ”— 20+ API endpoints
  • πŸ—„οΈ Comprehensive database schema (15+ tables)
  • πŸ” Secure authentication with OAuth
  • πŸ’³ Payment processing with Stripe
  • πŸ“± Responsive design for all devices

Phase 3 Advanced Features - βœ… Complete

  • βœ… Multi-dimensional review and rating system with trust scores
  • βœ… Analytics and reporting dashboard for brands and influencers
  • βœ… Admin dashboard with platform management tools
  • βœ… Testing infrastructure setup with Jest and React Testing Library
  • βœ… Production-ready deployment configuration

Phase 4 Enterprise Features - βœ… COMPLETE

πŸ›‘οΈ 1. Automated Content Compliance & Brand Safety

  • AI-Powered Content Moderation: Real-time content analysis with keyword detection and visual analysis
  • Brand Safety Rules: Customizable compliance rules with severity-based actions and automatic rejection
  • Legal Requirement Validation: Comprehensive checking for disclosures, age restrictions, and regulations
  • Compliance Dashboard: Complete management interface for rules, violations, and manual review workflows
  • Automated Workflows: Smart escalation system with human review for flagged content

πŸ† 2. Influencer Ranking & Leaderboard System

  • Multi-Dimensional Scoring Algorithm: 10 metrics including performance, engagement, quality, consistency, growth, trust, and professionalism
  • 5-Tier Progression System: Bronze β†’ Silver β†’ Gold β†’ Platinum β†’ Diamond levels with visual progression
  • Achievement Badges: 5 categories of badges (Performance, Engagement, Quality, Consistency, Growth)
  • Global & Niche Rankings: Comprehensive leaderboards with trend tracking and historical performance
  • Gamification Elements: Competitive features driving platform engagement and retention

πŸ§ͺ 3. A/B Testing Platform for Campaign Optimization

  • Statistical Significance Testing: Proper p-value calculations with confidence intervals
  • Multi-Variant Experiments: Support for creative, copy, offer, and targeting tests
  • Real-Time Conversion Tracking: Automatic metric calculation with live results
  • AI-Powered Recommendations: Intelligent insights based on test performance and data patterns
  • Comprehensive Reporting: Winner declaration, uplift calculations, and performance optimization

πŸ“± 4. Social Media API Integrations

  • Multi-Platform Support: Instagram, TikTok, YouTube, Twitter, LinkedIn, Facebook integration
  • Auto-Posting Capabilities: Scheduled publishing with content validation and optimization
  • Cross-Platform Analytics: Unified analytics with demographic insights and performance metrics
  • Account Management: OAuth authentication with secure token refresh and permission management
  • Rate Limiting Compliance: Platform-specific rate limiting and content guidelines enforcement

πŸ“Š 5. Advanced Analytics Dashboard

  • Custom Dashboard Builder: Drag-and-drop interface with configurable widgets and filters
  • Real-Time Data Visualization: Multiple chart types (line, bar, pie, area, scatter, heatmap)
  • Predictive Analytics: AI-powered trend forecasting with anomaly detection and opportunity identification
  • Custom Report Generation: Automated report creation with scheduling and distribution options
  • Performance Optimization: AI recommendations for content strategy and campaign improvements

πŸ€– 6. AI Content Generation Tools

  • Multi-Format Content Creation: Captions, hashtags, scripts, emails, and social media posts
  • Platform-Specific Optimization: Tailored content for each social media platform with optimal formats
  • Quality Analysis: Engagement prediction, compliance checking, and content quality scoring
  • Content Templates: Reusable templates with variable substitution and performance tracking
  • Intelligent Optimization: AI-powered content improvement suggestions and A/B testing recommendations

🀝 7. Team Collaboration Features

  • Multi-User Account Management: Role-based permissions with granular access control
  • Campaign Collaboration: Seamless workflow between brands, influencers, and team members
  • Real-Time Notifications: Server-Sent Events for instant updates and communication
  • Workflow Management: Content approval processes with multi-stage review and feedback systems

Platform Statistics

  • πŸ“Š 40+ complete user interfaces
  • πŸ”— 50+ API endpoints with full CRUD operations
  • πŸ—„οΈ Comprehensive database schema (20+ tables)
  • πŸ” Secure authentication with OAuth + role-based access
  • πŸ’³ Full Stripe payment processing with escrow
  • πŸ“± Responsive design with mobile optimization
  • πŸ§ͺ Testing infrastructure with 95%+ coverage goal
  • πŸ“ˆ Advanced analytics and reporting
  • πŸ‘‘ Complete admin panel for platform oversight
  • πŸ€– AI-powered content generation and analysis
  • πŸ† Gamification and ranking systems
  • πŸ“± Social media integrations for 6+ platforms
  • πŸ§ͺ A/B testing platform for campaign optimization
  • πŸ›‘οΈ Enterprise-grade content compliance system

Technology Stack Summary

  • Frontend: Next.js 14, TypeScript, Tailwind CSS, Radix UI
  • Backend: Next.js API Routes, Prisma ORM, PostgreSQL
  • Authentication: NextAuth.js with OAuth providers
  • Payments: Stripe Connect with escrow system
  • Database: PostgreSQL with comprehensive relational schema
  • Testing: Jest, React Testing Library, custom mocks
  • Infrastructure: Production-ready with environment configs

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the ISC License - see the package.json file for details.

πŸ†˜ Support

For questions or support:

  • Create an issue in the repository
  • Check the documentation in /docs
  • Review the database schema in /prisma/schema.prisma

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.3%
  • Other 0.7%