Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
**/.DS_Store

# Build artifacts
app/.output
app/dist

# Lockfiles for db (not needed in image; services resolve db deps via file: link)
db/bun.lock
frontend/dist

# Misc
*.md
8 changes: 4 additions & 4 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ FROM base AS dev
# Notice we pull from /frontend/node_modules now
COPY --from=deps /frontend/node_modules ./node_modules
# Copy local files into the current WORKDIR (/frontend)
COPY . .
EXPOSE 3000
COPY . .
EXPOSE 3000
CMD ["bun", "run", "dev", "--host", "0.0.0.0"]

# --- BUILDER STAGE ---
Expand All @@ -25,8 +25,8 @@ RUN bun run build

# --- PRODUCTION STAGE ---
FROM base AS production
COPY --from=builder /frontend/.output ./.output
COPY --from=builder /frontend/dist ./dist
COPY --from=builder /frontend/node_modules ./node_modules
COPY package.json ./
COPY package.json vite.config.ts tsconfig.json ./
EXPOSE 3000
CMD ["bun", "run", "preview", "--host", "0.0.0.0"]
15 changes: 13 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# TanStack Start + shadcn/ui
# Warchest Frontend

This is a template for a new TanStack Start project with React, TypeScript, and shadcn/ui.
Vite + React SPA using TanStack Router, TypeScript, and shadcn/ui.

## Commands

```bash
bun install # install dependencies
bun run dev # dev server on http://localhost:3000
bun run build # production build to dist/
bun run preview # serve the production build
bun run test # run vitest
bun run check # format + lint fix
```
480 changes: 27 additions & 453 deletions frontend/bun.lock

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
<title>Warchest</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
52 changes: 0 additions & 52 deletions frontend/network.ts

This file was deleted.

20 changes: 3 additions & 17 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,16 @@
"name": "warchest",
"private": true,
"type": "module",
"exports": {
"./db": "./db/index.ts",
"./db/schema": "./db/schema.ts"
},
"scripts": {
"dev": "vite dev --port 3000 --host",
"build": "vite build",
"preview": "vite preview",
"preview": "vite preview --port 3000",
"test": "vitest",
"lint": "eslint",
"format": "prettier",
"check": "prettier --write . && eslint --fix",
"db:generate": "drizzle-kit generate --config ./db/drizzle.config.ts",
"db:migrate": "drizzle-kit migrate --config ./db/drizzle.config.ts",
"db:studio": "drizzle-kit studio --config ./db/drizzle.config.ts",
"db:push": "drizzle-kit push --config ./db/drizzle.config.ts"
"check": "prettier --write . && eslint --fix"
},
"dependencies": {
"drizzle-orm": "^0.38.0",
"postgres": "^3.4.0",
"@base-ui/react": "^1.1.0",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"@hugeicons/core-free-icons": "^3.1.1",
Expand All @@ -30,12 +20,9 @@
"@tanstack/react-devtools": "^0.7.0",
"@tanstack/react-router": "^1.132.0",
"@tanstack/react-router-devtools": "^1.132.0",
"@tanstack/react-router-ssr-query": "^1.131.7",
"@tanstack/react-start": "^1.132.0",
"@tanstack/router-plugin": "^1.132.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"nitro": "latest",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"shadcn": "^3.7.0",
Expand All @@ -59,7 +46,6 @@
"vite": "^7.1.7",
"vite-node": "^5.3.0",
"vitest": "^3.0.5",
"web-vitals": "^5.1.0",
"drizzle-kit": "^0.30.0"
"web-vitals": "^5.1.0"
}
}
8 changes: 0 additions & 8 deletions frontend/src/lib/app-db.ts

This file was deleted.

13 changes: 13 additions & 0 deletions frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import ReactDOM from 'react-dom/client'
import { RouterProvider } from '@tanstack/react-router'

import { getRouter } from './router'
import './styles.css'

const router = getRouter()

const rootElement = document.getElementById('root')!
if (!rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement)
root.render(<RouterProvider router={router} />)
}
9 changes: 0 additions & 9 deletions frontend/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,3 @@ const rootRouteChildren: RootRouteChildren = {
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()

import type { getRouter } from './router.tsx'
import type { createStart } from '@tanstack/react-start'
declare module '@tanstack/react-start' {
interface Register {
ssr: true
router: Awaited<ReturnType<typeof getRouter>>
}
}
6 changes: 6 additions & 0 deletions frontend/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ export const getRouter = () => {

return router
}

declare module '@tanstack/react-router' {
interface Register {
router: ReturnType<typeof getRouter>
}
}
63 changes: 17 additions & 46 deletions frontend/src/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,26 @@
import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router'
import { Outlet, createRootRoute } from '@tanstack/react-router'
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
import { TanStackDevtools } from '@tanstack/react-devtools'

import appCss from '../styles.css?url'

export const Route = createRootRoute({
head: () => ({
meta: [
{
charSet: 'utf-8',
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{
title: 'TanStack Start Starter',
},
],
links: [
{
rel: 'stylesheet',
href: appCss,
},
],
}),

shellComponent: RootDocument,
component: RootComponent,
})

function RootDocument({ children }: { children: React.ReactNode }) {
function RootComponent() {
return (
<html lang="en">
<head>
<HeadContent />
</head>
<body>
{children}
<TanStackDevtools
config={{
position: 'bottom-right',
}}
plugins={[
{
name: 'Tanstack Router',
render: <TanStackRouterDevtoolsPanel />,
},
]}
/>
<Scripts />
</body>
</html>
<>
<Outlet />
<TanStackDevtools
config={{
position: 'bottom-right',
}}
plugins={[
{
name: 'Tanstack Router',
render: <TanStackRouterDevtoolsPanel />,
},
]}
/>
</>
)
}
6 changes: 2 additions & 4 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { defineConfig } from 'vite'
import { devtools } from '@tanstack/devtools-vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
import viteReact from '@vitejs/plugin-react'
import viteTsConfigPaths from 'vite-tsconfig-paths'
import tailwindcss from '@tailwindcss/vite'
import { nitro } from 'nitro/vite'

const config = defineConfig({
plugins: [
devtools(),
nitro(),
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart(),
tanstackRouter({ target: 'react', autoCodeSplitting: true }),
viteReact(),
],
})
Expand Down
Loading