feat: implement docker infrastructure (US-001)

- Add docker-compose.yml with postgres, redis, api, and web services
- Add multi-stage Dockerfile for API (Python 3.11)
- Add multi-stage Dockerfile for web (Node.js 20 + nginx)
- Add Makefile with common development commands
- Add .env.example with all required environment variables
- Add placeholder pyproject.toml and package.json for builds
- Configure health checks for all services
- Setup persistent volumes for postgres, redis, and repos
- Run services as non-root users
This commit is contained in:
2026-05-16 17:44:39 +00:00
parent 212d072417
commit e7819bfc82
246 changed files with 3625 additions and 17311 deletions
@@ -1,17 +0,0 @@
import { Outlet } from 'react-router-dom'
import Header from './Header'
import Sidebar from './Sidebar'
export default function DashboardLayout() {
return (
<div className="flex h-screen">
<Sidebar />
<div className="flex-1 flex flex-col overflow-hidden">
<Header />
<main className="flex-1 overflow-auto">
<Outlet />
</main>
</div>
</div>
)
}
-59
View File
@@ -1,59 +0,0 @@
import { useState } from 'react'
import { Link } from 'react-router-dom'
import { useAuthStore } from '../stores/auth'
import {
UserCircleIcon,
ArrowRightOnRectangleIcon,
Cog6ToothIcon,
} from '@heroicons/react/24/outline'
export default function Header() {
const { user, logout } = useAuthStore()
const [showDropdown, setShowDropdown] = useState(false)
const handleLogout = () => {
logout()
localStorage.removeItem('access_token')
window.location.href = '/login'
}
return (
<header className="h-16 border-b border-border bg-surface flex items-center justify-between px-6">
<div className="flex items-center">
<span className="text-lg font-semibold">Headquarter</span>
</div>
<div className="relative">
<button
onClick={() => setShowDropdown(!showDropdown)}
className="flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-surface transition-colors"
>
<UserCircleIcon className="w-6 h-6" />
<span className="text-sm">{user?.display_name || user?.email || 'User'}</span>
</button>
{showDropdown && (
<div className="absolute right-0 mt-2 w-48 rounded-lg border border-border bg-surface shadow-lg z-50">
<div className="p-2">
<Link
to="/settings"
className="flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-surface text-sm"
onClick={() => setShowDropdown(false)}
>
<Cog6ToothIcon className="w-4 h-4" />
Settings
</Link>
<button
onClick={handleLogout}
className="flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-surface text-sm w-full text-left text-red-400"
>
<ArrowRightOnRectangleIcon className="w-4 h-4" />
Logout
</button>
</div>
</div>
)}
</div>
</header>
)
}
-20
View File
@@ -1,20 +0,0 @@
import { Navigate } from 'react-router-dom'
import { useAuthStore } from '../stores/auth'
export default function RouteGuard({ children }: { children: React.ReactNode }) {
const { state } = useAuthStore()
if (state === 'loading') {
return (
<div className="flex min-h-screen items-center justify-center">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-accent"></div>
</div>
)
}
if (state === 'unauthenticated' || state === 'error') {
return <Navigate to="/login" replace />
}
return <>{children}</>
}
-48
View File
@@ -1,48 +0,0 @@
import { Link, useLocation } from 'react-router-dom'
import {
HomeIcon,
FolderIcon,
WrenchIcon,
Cog6ToothIcon,
BookOpenIcon,
} from '@heroicons/react/24/outline'
const navigation = [
{ name: 'Dashboard', href: '/', icon: HomeIcon },
{ name: 'Projects', href: '/projects', icon: FolderIcon },
{ name: 'Repositories', href: '/repositories', icon: BookOpenIcon },
{ name: 'Tools', href: '/tools', icon: WrenchIcon },
{ name: 'Settings', href: '/settings', icon: Cog6ToothIcon },
]
export default function Sidebar() {
const location = useLocation()
return (
<nav className="w-64 border-r border-border bg-surface h-screen sticky top-0">
<div className="p-4">
<h1 className="text-xl font-bold mb-6">Headquarter</h1>
<ul className="space-y-1">
{navigation.map((item) => {
const isActive = location.pathname === item.href
return (
<li key={item.name}>
<Link
to={item.href}
className={`flex items-center gap-3 px-3 py-2 rounded-lg transition-colors ${
isActive
? 'bg-accent/10 text-accent'
: 'text-gray-400 hover:text-fg hover:bg-surface'
}`}
>
<item.icon className="w-5 h-5" />
{item.name}
</Link>
</li>
)
})}
</ul>
</div>
</nav>
)
}