Files
blackroad-os-web/app/(auth)/signup/page.tsx
Alexa Louise 2ab0d60400 Initial Phase 1 Alpha build for app.blackroad.io
This commit establishes the foundation for the BlackRoad OS web application,
the primary SaaS product for human-AI collaboration.

1. Authentication System
   - Login and signup pages with email/password
   - Zustand state management for auth
   - Workspace-based user model
   - Protected route handling

2. App Shell
   - Sidebar navigation (Conversations, Agents, Governance, Account)
   - App header with workspace and user info
   - Layout with authentication guards
   - Responsive design with Tailwind CSS

3. Conversation Interface
   - Chat UI with message bubbles
   - User and assistant message rendering
   - Real-time timestamp display
   - Loading states and animations
   - Placeholder for WebSocket integration

4. Core Dependencies
   - Next.js 16 with App Router
   - Zustand for state management
   - TanStack Query (ready for API calls)
   - Lucide React icons
   - Tailwind CSS 4 with custom utilities

5. Workspace Management
   - Multi-tenant workspace structure
   - Workspace store with Zustand
   - Plan-based workspace model (Free, Pro, Enterprise)

Structure:
app/
  ├── (auth)/          # Authentication routes
  │   ├── login/
  │   └── signup/
  ├── (app)/           # Protected app routes
  │   ├── conversations/[id]/
  │   ├── workspace/
  │   └── layout.tsx
  └── page.tsx         # Redirects to login

components/
  ├── Sidebar.tsx      # Main navigation
  └── AppHeader.tsx    # Workspace header

stores/
  ├── auth-store.ts    # Authentication state
  └── workspace-store.ts

lib/
  └── cn.ts            # Tailwind merge utility

Next Steps:
- Integrate WebSocket streaming for real-time AI responses
- Connect to BlackRoad OS backend API
- Add agent management interface
- Build governance center UI
- Deploy to app.blackroad.io

Phase 1 Alpha Target: Jan 25, 2026

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-22 18:49:56 -06:00

132 lines
4.5 KiB
TypeScript

'use client';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import Link from 'next/link';
import { useAuthStore } from '@/stores/auth-store';
export default function SignupPage() {
const router = useRouter();
const signup = useAuthStore((state) => state.signup);
const [name, setName] = useState('');
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [loading, setLoading] = useState(false);
const [error, setError] = useState('');
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setLoading(true);
setError('');
if (password.length < 8) {
setError('Password must be at least 8 characters');
setLoading(false);
return;
}
try {
await signup(email, password, name);
router.push('/workspace');
} catch (err) {
setError('Failed to create account');
} finally {
setLoading(false);
}
};
return (
<div className="min-h-screen flex items-center justify-center bg-gray-50 px-4">
<div className="max-w-md w-full space-y-8">
<div className="text-center">
<h1 className="text-4xl font-semibold text-gray-900">
BlackRoad<span className="text-blue-800"> OS</span>
</h1>
<h2 className="mt-6 text-3xl font-semibold text-gray-900">
Create your account
</h2>
<p className="mt-2 text-sm text-gray-600">
Start collaborating with AI
</p>
</div>
<form className="mt-8 space-y-6" onSubmit={handleSubmit}>
{error && (
<div className="rounded-md bg-red-50 border border-red-200 p-4">
<p className="text-sm text-red-800">{error}</p>
</div>
)}
<div className="space-y-4">
<div>
<label htmlFor="name" className="block text-sm font-medium text-gray-700">
Full name
</label>
<input
id="name"
name="name"
type="text"
autoComplete="name"
required
value={name}
onChange={(e) => setName(e.target.value)}
className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-800 focus:border-blue-800"
/>
</div>
<div>
<label htmlFor="email" className="block text-sm font-medium text-gray-700">
Email address
</label>
<input
id="email"
name="email"
type="email"
autoComplete="email"
required
value={email}
onChange={(e) => setEmail(e.target.value)}
className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-800 focus:border-blue-800"
/>
</div>
<div>
<label htmlFor="password" className="block text-sm font-medium text-gray-700">
Password
</label>
<input
id="password"
name="password"
type="password"
autoComplete="new-password"
required
value={password}
onChange={(e) => setPassword(e.target.value)}
className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-800 focus:border-blue-800"
/>
<p className="mt-1 text-xs text-gray-500">
Must be at least 8 characters
</p>
</div>
</div>
<button
type="submit"
disabled={loading}
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-800 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-800 disabled:opacity-50 disabled:cursor-not-allowed"
>
{loading ? 'Creating account...' : 'Create account'}
</button>
<div className="text-center text-sm">
<span className="text-gray-600">Already have an account? </span>
<Link href="/login" className="font-medium text-blue-800 hover:text-blue-700">
Sign in
</Link>
</div>
</form>
</div>
</div>
);
}