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.
Cross Write supports two deployment modes with a single, unified API key approach:
For hosted deployments (free & paid plans):
CROSSWRITE_DEPLOYMENT_MODE=HOSTED
OPENAI_API_KEY=sk-proj-your-openai-api-key-here
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
-
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
- 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
- Clone the repository:
git clone <repository-url>
cd cross-write
- Install dependencies:
npm install
- 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
- Set up the database:
npm run db:generate
npm run db:push
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser
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
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)
- Sign In: Users can sign in with Google OAuth or magic link email
- Magic Link: Users enter their email and receive a secure sign-in link
- Session Management: Sessions are stored in the database with automatic refresh
- Route Protection: Middleware protects all routes except auth pages
- Sign Out: Users can sign out and are redirected to sign-in page
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
- Quick stats cards (Drafts, Scheduled, Published)
- Recent activity feed
- Continue drafting section
- 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
- Data table with search and filtering
- Bulk actions (delete, schedule)
- Status badges and platform indicators
- Empty states for new users
- Interactive calendar view
- Drag-to-reschedule functionality
- Best time recommendations
- Scheduling form with platform selection
- Platform connection cards
- API key management
- Publishing defaults configuration
- Connection status indicators
- Profile configuration
- Writing defaults
- Publishing preferences
- Notification settings
- Keyboard shortcuts reference
- 3-step wizard for new users
- Platform selection
- Writing preferences setup
- Progress indicators
N
- New draftβK
- Command paletteβD
- Go to draftsβE
- Go to editorβB
- Toggle sidebarβI
- Go to integrationsβH
- Go to dashboard1
- Go to dashboard2
- Go to editor3
- Go to draftsG
- Go to drafts
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
- Real-time writing suggestions
- Tone adjustment recommendations
- Content improvement tips
- Grammar and style suggestions
- Support for Dev.to and Hashnode
- Automatic formatting for each platform
- Scheduled publishing with timezone support
- Responsive design for all devices
- Keyboard shortcuts for power users
- Command palette for quick navigation
- Smooth animations and transitions
-
Start the development server:
npm run dev
-
Navigate to the dashboard at
http://localhost:3000
-
Explore the features:
- Create a new draft in the editor
- Connect platforms in integrations
- Schedule content in the scheduler
- View your content and settings
-
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)
- Press
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
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. π