Skip to content

alexcloudstar/app.crosswrite.app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Cross Write - Multi-platform Writing & Publishing App

Cross Write is a modern, AI-assisted writing and publishing application that helps content creators write once and publish everywhere. Built with Next.js 15, TypeScript, and DaisyUI, it provides a seamless experience for managing content across multiple platforms.

πŸš€ Deployment Modes & API Key

Cross Write supports two deployment modes with a single, unified API key approach:

HOSTED Mode

For hosted deployments (free & paid plans):

CROSSWRITE_DEPLOYMENT_MODE=HOSTED
OPENAI_API_KEY=sk-proj-your-openai-api-key-here

SELF_HOST Mode

For self-hosted deployments:

CROSSWRITE_DEPLOYMENT_MODE=SELF_HOST
OPENAI_API_KEY=sk-proj-your-openai-api-key-here

Key Features:

  • Single API key: One OPENAI_API_KEY for all deployment modes
  • No client-side secrets: All API keys stay server-side
  • No in-app BYOK forms: Keys are managed via environment variables only
  • Client key rejection: Any client-supplied keys are rejected with 400 error

Why ENV-ONLY?

  • Enhanced security through server-side key management
  • Simplified deployment and configuration
  • No risk of key exposure in browser
  • Consistent behavior across all deployment scenarios

πŸš€ Features

  • AI-Assisted Editor: Get real-time writing suggestions and improvements

  • Multi-Platform Publishing: Support for Dev.to and Hashnode

  • Smart Scheduling: Schedule posts for optimal publishing times

  • Command Palette: Quick access to all features with keyboard shortcuts

  • Responsive Design: Works beautifully on desktop, tablet, and mobile

πŸ›  Tech Stack

  • Framework: Next.js 15 (App Router, TypeScript, edge-safe)
  • Authentication: Auth.js (NextAuth.js v5) with Drizzle adapter
  • Database: Neon Postgres with Drizzle ORM
  • Styling: Tailwind CSS v4 + DaisyUI (peachsorbet theme)
  • Icons: lucide-react
  • State Management: Zustand
  • Validation: Zod
  • Notifications: react-hot-toast
  • AI Integration: OpenAI
  • Email: Resend
  • Animations: CSS transitions and micro-interactions

πŸ“¦ Installation

  1. Clone the repository:
git clone <repository-url>
cd cross-write
  1. Install dependencies:
npm install
  1. Set up environment variables: Create a .env.local file with the following variables:
DATABASE_URL=your_neon_postgres_url
AUTH_SECRET=your_auth_secret
AUTH_TRUST_HOST=true
AUTH_GOOGLE_ID=your_google_oauth_id
AUTH_GOOGLE_SECRET=your_google_oauth_secret
RESEND_API_KEY=your_resend_api_key
[email protected]
AUTH_DEBUG=true

# Deployment Mode & API Key
CROSSWRITE_DEPLOYMENT_MODE=HOSTED
OPENAI_API_KEY=sk-proj-your-openai-api-key-here
  1. Set up the database:
npm run db:generate
npm run db:push
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser

🎨 Design System

The application uses the DaisyUI "peachsorbet" theme with a dark-first approach:

  • Primary Color: Coral Pink (#f4978e)
  • Secondary Color: Apricot (#fbc4ab)
  • Accent Color: Melon (#f8ad9d)
  • Dark Surfaces: Sophisticated dark backgrounds with subtle contrast

πŸ” Authentication

The app uses Auth.js (NextAuth.js v5) with the following features:

  • OAuth Providers: Google (conditionally loaded)
  • Magic Link Authentication: Passwordless email sign-in
  • Database Sessions: Persistent sessions stored in PostgreSQL
  • Protected Routes: Automatic redirect to sign-in for unauthenticated users
  • User Management: Extended user model with plan tiers (free/pro)

Authentication Flow

  1. Sign In: Users can sign in with Google OAuth or magic link email
  2. Magic Link: Users enter their email and receive a secure sign-in link
  3. Session Management: Sessions are stored in the database with automatic refresh
  4. Route Protection: Middleware protects all routes except auth pages
  5. Sign Out: Users can sign out and are redirected to sign-in page

Protected Layout

The app includes a protected layout (app/(protected)/layout.tsx) that:

  • Checks for valid session on every request
  • Redirects to /auth/sign-in if not authenticated
  • Displays user information and sign-out button
  • Provides a clean, authenticated interface

πŸ“± Pages & Features

Dashboard (/dashboard)

  • Quick stats cards (Drafts, Scheduled, Published)
  • Recent activity feed
  • Continue drafting section

Editor (/editor)

  • Split-pane layout with AI suggestions
  • Rich text toolbar with formatting options
  • Real-time word count and reading time
  • Preview modal with device frame toggles

Drafts (/drafts)

  • Data table with search and filtering
  • Bulk actions (delete, schedule)
  • Status badges and platform indicators
  • Empty states for new users

Scheduler (/scheduler)

  • Interactive calendar view
  • Drag-to-reschedule functionality
  • Best time recommendations
  • Scheduling form with platform selection

Integrations (/integrations)

  • Platform connection cards
  • API key management
  • Publishing defaults configuration
  • Connection status indicators

Settings (/settings)

  • Profile configuration
  • Writing defaults
  • Publishing preferences
  • Notification settings
  • Keyboard shortcuts reference

Onboarding (/onboarding)

  • 3-step wizard for new users
  • Platform selection
  • Writing preferences setup
  • Progress indicators

⌨️ Keyboard Shortcuts

  • N - New draft
  • ⌘K - Command palette
  • ⌘D - Go to drafts
  • ⌘E - Go to editor
  • ⌘B - Toggle sidebar
  • ⌘I - Go to integrations
  • ⌘H - Go to dashboard
  • 1 - Go to dashboard
  • 2 - Go to editor
  • 3 - Go to drafts
  • G - Go to drafts

πŸ—‚ Project Structure

app/
β”œβ”€β”€ (protected)/          # Protected routes (require authentication)
β”‚   β”œβ”€β”€ dashboard/        # Main dashboard
β”‚   β”œβ”€β”€ editor/           # AI-assisted editor
β”‚   β”œβ”€β”€ drafts/           # Drafts management
β”‚   β”œβ”€β”€ scheduler/        # Content scheduling
β”‚   β”œβ”€β”€ integrations/     # Platform connections
β”‚   β”œβ”€β”€ settings/         # User preferences
β”‚   β”œβ”€β”€ updates/          # News and updates
β”‚   β”œβ”€β”€ onboarding/       # New user setup
β”‚   └── layout.tsx        # Protected layout wrapper
β”œβ”€β”€ auth/                 # Authentication pages
β”‚   β”œβ”€β”€ sign-in/          # Sign-in page
β”‚   └── error/            # Auth error page
β”œβ”€β”€ api/                  # API routes
β”‚   β”œβ”€β”€ auth/             # Auth API endpoints
β”‚   └── cron/             # Background job endpoints
β”œβ”€β”€ actions/              # Server actions
β”œβ”€β”€ globals.css           # Global styles
β”œβ”€β”€ layout.tsx            # Root layout
└── page.tsx              # Root page (redirects to dashboard)

components/
β”œβ”€β”€ layout/               # App shell components
β”‚   β”œβ”€β”€ AppSidebar.tsx    # Collapsible sidebar
β”‚   β”œβ”€β”€ Topbar.tsx        # Top navigation bar
β”‚   β”œβ”€β”€ CommandPalette.tsx # Command palette modal
β”‚   β”œβ”€β”€ RootLayoutWrapper.tsx # Layout wrapper
β”‚   └── ShortcutsProvider.tsx # Keyboard shortcuts provider
β”œβ”€β”€ editor/               # Editor components
β”‚   β”œβ”€β”€ EditorToolbar.tsx # Formatting toolbar
β”‚   β”œβ”€β”€ MarkdownEditor.tsx # Text editor
β”‚   β”œβ”€β”€ AiSuggestionsPanel.tsx # AI suggestions
β”‚   β”œβ”€β”€ PreviewModal.tsx  # Content preview
β”‚   └── ThumbnailGeneratorModal.tsx # Thumbnail generation
β”œβ”€β”€ ui/                   # Reusable UI components
β”‚   β”œβ”€β”€ StatCard.tsx      # Statistics cards
β”‚   β”œβ”€β”€ EmptyState.tsx    # Empty state component
β”‚   β”œβ”€β”€ PlanBadge.tsx     # Plan tier badge
β”‚   β”œβ”€β”€ QuotaHint.tsx     # Usage quota hints
β”‚   β”œβ”€β”€ NewsUpdates.tsx   # News updates widget
β”‚   β”œβ”€β”€ SignOutButton.tsx # Sign out button
β”‚   β”œβ”€β”€ DeploymentModeBadge.tsx # Deployment mode indicator
β”‚   β”œβ”€β”€ CustomCheckbox.tsx # Custom checkbox component

β”œβ”€β”€ providers/            # Context providers
β”‚   β”œβ”€β”€ SessionProvider.tsx # Session provider
β”‚   └── ToastProvider.tsx # Toast notifications

lib/
β”œβ”€β”€ actions/              # Action utilities
β”œβ”€β”€ ai/                   # AI integration

β”œβ”€β”€ auth/                 # Authentication utilities
β”œβ”€β”€ config/               # Configuration
β”œβ”€β”€ integrations/         # Platform integrations
β”œβ”€β”€ plan-service.ts       # Plan management
β”œβ”€β”€ plans.ts              # Plan definitions
β”œβ”€β”€ scheduler/            # Scheduling utilities
β”œβ”€β”€ store.ts              # Zustand store
β”œβ”€β”€ types/                # TypeScript types
β”œβ”€β”€ utils/                # Utility functions
β”œβ”€β”€ validators/           # Validation schemas
└── utils.ts              # General utilities

hooks/
β”œβ”€β”€ use-plan.ts           # Plan management hook
└── use-shortcuts.ts      # Keyboard shortcuts

db/
β”œβ”€β”€ client.ts             # Database client
β”œβ”€β”€ migrations/           # Database migrations
β”œβ”€β”€ schema/               # Database schema
└── drizzle.config.ts     # Drizzle configuration

🎯 Key Features

AI-Assisted Writing

  • Real-time writing suggestions
  • Tone adjustment recommendations
  • Content improvement tips
  • Grammar and style suggestions

Multi-Platform Publishing

  • Support for Dev.to and Hashnode
  • Automatic formatting for each platform
  • Scheduled publishing with timezone support

User Experience

  • Responsive design for all devices
  • Keyboard shortcuts for power users
  • Command palette for quick navigation
  • Smooth animations and transitions

πŸš€ Getting Started

  1. Start the development server:

    npm run dev
  2. Navigate to the dashboard at http://localhost:3000

  3. Explore the features:

    • Create a new draft in the editor
    • Connect platforms in integrations
    • Schedule content in the scheduler
    • View your content and settings
  4. Try keyboard shortcuts:

    • Press ⌘K to open the command palette
    • Use N to create a new draft
    • Navigate with ⌘D (drafts), ⌘E (editor), ⌘I (integrations)

πŸ”§ Development

The application is built with modern React patterns:

  • Server Components: Used where possible for better performance
  • Client Components: Only for interactive features
  • TypeScript: Full type safety throughout
  • DaisyUI: Consistent component library
  • Tailwind CSS: Utility-first styling

⚠️ Development Disclosure

This project was created using the vibe coding method - an experimental approach to rapid prototyping and development. While the code has been reviewed and tested, the codebase is production-ready but may still contain potential issues, inefficiencies, or areas that could benefit from further optimization.

Please note:

  • The codebase is production-ready and fully functional
  • Some areas may have potential issues that could be improved
  • Performance optimizations and edge case handling may be incomplete in some areas
  • Code quality varies across different parts of the application

Found a bug or issue? Please report it at https://github.com/alexcloudstar/app.crosswrite.app/issues and it will be addressed promptly.


Cross Write - Write once, publish everywhere. πŸš€