# 001: Project Skeleton & Infrastructure

## Overview

Set up the foundational infrastructure for Suno Spaces with basic authentication and project structure. This phase establishes the skeleton without implementing full feature functionality.

## Goals

- Initialize Next.js project with TypeScript and Tailwind CSS
- Set up Convex backend with basic configuration
- Implement Convex Auth with Google OAuth restricted to @suno.com emails
- Create basic project structure and routing
- Configure Vercel deployment pipeline
- Get a simple authenticated "Hello World" working

## Infrastructure Setup

### Frontend

- Initialize Next.js 14+ with App Router
- Configure TypeScript with strict mode
- Set up Tailwind CSS with basic configuration
- Install and configure Convex client
- Create basic layout structure

### Backend (Convex)

- Initialize Convex project
- Set up Convex Auth with Google provider
- Configure email domain restriction (@suno.com only)
- Define minimal initial schema:
  - Users (from authTables - includes email, name, image, emailVerified)
  - Spaces (owner, name, basic metadata)
  - Rooms (spaceId, name, type)
- Create basic auth.ts configuration

### Deployment

- Connect repository to Vercel
- Configure environment variables for Convex
- Set up staging and production environments (or just production to start)
- Configure custom domain: spaces.suno.run

## Project Structure

```
/app                 # Next.js app router pages
  /page.tsx          # Landing/auth page
  /space/[id]        # Space view (placeholder)
  /layout.tsx        # Root layout
/components          # React components
  /ui                # Shared UI components (button, etc.)
  /auth              # Auth components
/convex              # Convex backend functions
  /auth.ts           # Authentication config
  /schema.ts         # Convex schema definitions (minimal)
  /users.ts          # Basic user operations
  /spaces.ts         # Placeholder space operations
/lib                 # Utility functions
/styles              # Global styles
/public              # Static assets
```

## Acceptance Criteria

- [ ] Next.js project initialized with TypeScript and Tailwind CSS
- [ ] Convex backend connected and functional
- [ ] User can sign in with Google (@suno.com email restriction working)
- [ ] Basic schema defined for Users, Spaces, Rooms
- [ ] Landing page with sign in button
- [ ] After auth, user sees a simple authenticated page showing their user info
- [ ] Basic navigation structure in place (header/layout)
- [ ] Project deploys successfully to Vercel
- [ ] Environment variables properly configured

## Technical Considerations

### Keep It Minimal

This phase is about getting the skeleton working. Don't implement full features yet - that's for 002. Focus on:
- Auth flow working end-to-end
- Convex connection established
- Basic routing structure
- Deployment pipeline functional

### Mobile Web From Day One

Even in skeleton form, ensure responsive design works on mobile.

### TypeScript Strict Mode

Start with strict TypeScript configuration to catch issues early.

## Out of Scope (Moving to 002)

- Home space auto-creation
- Full schema with all tables (SpaceMembers, Invites, Messages, Atoms, Presence, etc.)
- Space/room creation and management
- Invite system
- Presence tracking
- Message system
- Atoms system
- Full UI implementation
- Member management
- Showcase area
