fix template, remove okr, use casan.*

This commit is contained in:
thanhnv
2026-07-18 16:45:31 +07:00
parent 0dfd1742d3
commit 13fae3e6c3
249 changed files with 4881 additions and 5702 deletions
@@ -0,0 +1,13 @@
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
COPY apps/__PROJECT_SLUG__/backend/package.json apps/__PROJECT_SLUG__/backend/package.json
COPY apps/__PROJECT_SLUG__/frontend/package.json apps/__PROJECT_SLUG__/frontend/package.json
RUN npm ci
COPY apps/__PROJECT_SLUG__/frontend apps/__PROJECT_SLUG__/frontend
RUN npm run build -w @__PROJECT_SLUG__/frontend
FROM nginx:1.27-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/apps/__PROJECT_SLUG__/frontend/dist /usr/share/nginx/html
EXPOSE 80
@@ -0,0 +1,5 @@
<!doctype html>
<html lang="en">
<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>__PROJECT_NAME__</title></head>
<body><div id="root"></div><script type="module" src="/src/main.tsx"></script></body>
</html>
@@ -0,0 +1,8 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / { try_files $uri $uri/ /index.html; }
location /api/ { proxy_pass http://backend:3000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
}
@@ -0,0 +1,36 @@
{
"name": "@__PROJECT_SLUG__/frontend",
"version": "1.0.0",
"private": true,
"license": "UNLICENSED",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest run"
},
"dependencies": {
"@tanstack/react-query": "^5.81.5",
"axios": "^1.10.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.59.0",
"react-router-dom": "^6.30.1",
"zod": "^3.25.67"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@types/node": "^24.0.8",
"@types/react": "^18.3.23",
"@types/react-dom": "^18.3.7",
"@vitejs/plugin-react": "^4.6.0",
"autoprefixer": "^10.4.21",
"jsdom": "^26.1.0",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
"typescript": "^5.8.3",
"vite": "^5.4.19",
"vitest": "^3.2.4"
}
}
@@ -0,0 +1 @@
export default { plugins: { tailwindcss: {}, autoprefixer: {} } };
@@ -0,0 +1,11 @@
export function App() {
return (
<main className="min-h-screen bg-gray-50 p-6 text-gray-800">
<section className="mx-auto max-w-4xl rounded-xl border border-gray-200 bg-white p-6 shadow-sm">
<p className="text-sm font-medium text-blue-600">CASAN-governed project</p>
<h1 className="mt-2 text-2xl font-semibold">__PROJECT_NAME__</h1>
<p className="mt-3 text-gray-500">The production shell is ready. Implement product screens from the approved requirement and architecture.</p>
</section>
</main>
);
}
@@ -0,0 +1,10 @@
import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { App } from '../App';
describe('App', () => {
it('renders the project identity', () => {
render(<App />);
expect(screen.getByRole('heading', { name: '__PROJECT_NAME__' })).toBeInTheDocument();
});
});
@@ -0,0 +1 @@
import '@testing-library/jest-dom/vitest';
@@ -0,0 +1,5 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
body { margin: 0; min-width: 320px; min-height: 100vh; }
@@ -0,0 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { App } from './App';
import './index.css';
ReactDOM.createRoot(document.getElementById('root')!).render(<React.StrictMode><App /></React.StrictMode>);
@@ -0,0 +1,7 @@
import type { Config } from 'tailwindcss';
export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
theme: { extend: {} },
plugins: [],
} satisfies Config;
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ES2020"],
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src", "vite.config.ts"]
}
@@ -0,0 +1,8 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
server: { port: 5173 },
test: { environment: 'jsdom', setupFiles: ['./src/__tests__/setup.ts'] },
});