Architecture
Technology Stack
Application Flow
graph TB
subgraph pages [Pages]
Home[Home Page]
Browse[Browse Page]
Submit[Submit Page]
Auth[Auth Pages]
end
subgraph auth [Authentication]
GitHub[GitHub OAuth]
GitLab[GitLab OAuth]
Google[Google OAuth]
Email[Email/Password]
end
subgraph data [Data Layer]
Drizzle[Drizzle ORM]
Turso[(Turso DB)]
end
Home --> Drizzle
Browse --> Drizzle
Submit --> auth
auth --> Drizzle
Drizzle --> Turso
Directory Structure
src/
├── components/ # SolidJS components
│ ├── ThemeCard.tsx
│ ├── ThemeGallery.tsx
│ └── SubmitThemeForm.tsx
├── db/
│ ├── index.ts # Drizzle client
│ └── schema.ts # Table definitions
├── layouts/
│ └── Layout.astro # Base layout with nav
├── lib/
│ ├── auth.ts # Lucia setup
│ ├── password.ts # Argon2 helpers
│ └── github.ts # GitHub API helpers
├── pages/
│ ├── index.astro # Home (featured themes)
│ ├── browse.astro # Full gallery
│ ├── submit.astro # Theme submission
│ ├── login.astro
│ ├── register.astro
│ └── api/
│ ├── auth/ # Auth endpoints
│ └── themes/ # Theme API
├── styles/
│ └── global.css # Tailwind imports
└── types/
└── theme.ts # TypeScript types
Request Flow
Page Request
sequenceDiagram
participant Browser
participant Vercel
participant Astro
participant Turso
Browser->>Vercel: GET /browse
Vercel->>Astro: Handle request
Astro->>Turso: Query themes
Turso-->>Astro: Theme data
Astro-->>Vercel: Rendered HTML
Vercel-->>Browser: Response
Theme Submission
sequenceDiagram
participant User
participant App
participant GitHub
participant Turso
User->>App: Submit repo URL
App->>GitHub: Fetch repo metadata
GitHub-->>App: Name, stars, etc.
App->>GitHub: Check preview.png exists
GitHub-->>App: 200 OK
App->>Turso: Insert theme (pending)
Turso-->>App: Success
App-->>User: Submission confirmed
Key Files
| File | Purpose |
|---|---|
|
Astro + Vercel adapter config |
|
Database migration config |
|
Table definitions (users, sessions, themes) |
|
Lucia auth with OAuth providers |
|
OAuth login/callback endpoints |
|
Theme submission API |