Compare commits
2 Commits
80e195b3dc
...
cfcc91a670
| Author | SHA1 | Date | |
|---|---|---|---|
| cfcc91a670 | |||
| 9253164fd3 |
8
.env.example
Normal file
8
.env.example
Normal file
@ -0,0 +1,8 @@
|
||||
# SQLite database file path
|
||||
SQLITE_PATH=./data/app.db
|
||||
|
||||
# Session secret for signing session cookies
|
||||
SESSION_SECRET=change-me-in-production
|
||||
|
||||
# Uploads directory path
|
||||
UPLOADS_PATH=./data/uploads
|
||||
20
.github/workflows/ci.yml
vendored
Normal file
20
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run typecheck
|
||||
- run: npm test
|
||||
- run: npm run build
|
||||
@ -12,3 +12,7 @@ node_modules/
|
||||
|
||||
# ビルド成果物
|
||||
dist/
|
||||
.next/
|
||||
|
||||
# Next.js auto-generated
|
||||
next-env.d.ts
|
||||
|
||||
3
app/globals.css
Normal file
3
app/globals.css
Normal file
@ -0,0 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
20
app/layout.tsx
Normal file
20
app/layout.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import type { Metadata } from 'next';
|
||||
import './globals.css';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'シンプルグループウェア',
|
||||
description:
|
||||
'プロジェクト単位で情報共有・タスク管理を行えるチームコラボレーションツール',
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<html lang="ja">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
10
app/page.tsx
Normal file
10
app/page.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col items-center justify-center p-8">
|
||||
<h1 className="text-3xl font-bold">シンプルグループウェア</h1>
|
||||
<p className="mt-4 text-gray-600">
|
||||
プロジェクト単位で情報共有・タスク管理を行えるチームコラボレーションツール
|
||||
</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@ -18,6 +18,16 @@ export default tseslint.config(
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ['node_modules/**', 'dist/**', '.steering/**'],
|
||||
ignores: [
|
||||
'node_modules/**',
|
||||
'dist/**',
|
||||
'.next/**',
|
||||
'.steering/**',
|
||||
'data/**',
|
||||
'backups/**',
|
||||
'playwright-report/**',
|
||||
'test-results/**',
|
||||
'next-env.d.ts',
|
||||
],
|
||||
}
|
||||
);
|
||||
|
||||
6
next-env.d.ts
vendored
Normal file
6
next-env.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
/// <reference path="./.next/types/routes.d.ts" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
6
next.config.mjs
Normal file
6
next.config.mjs
Normal file
@ -0,0 +1,6 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
serverExternalPackages: ['better-sqlite3', 'bcrypt'],
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
12031
package-lock.json
generated
Normal file
12031
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
42
package.json
42
package.json
@ -1,36 +1,58 @@
|
||||
{
|
||||
"name": "opencode-spec-driven-boilerplate",
|
||||
"name": "opengroupware",
|
||||
"version": "0.1.0",
|
||||
"description": "Spec-driven development boilerplate for opencode",
|
||||
"description": "Simple project-based groupware built with Next.js 15, TypeScript, and SQLite",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"prepare": "husky",
|
||||
"build": "tsc",
|
||||
"dev": "tsc --watch",
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "eslint .",
|
||||
"format": "npx prettier --write .",
|
||||
"format": "prettier --write .",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:e2e": "playwright test",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:ui": "vitest --ui"
|
||||
"migrate": "tsx lib/db/run-migrations.ts"
|
||||
},
|
||||
"keywords": [
|
||||
"spec-driven-development",
|
||||
"opencode",
|
||||
"template"
|
||||
"groupware",
|
||||
"nextjs",
|
||||
"sqlite"
|
||||
],
|
||||
"author": "",
|
||||
"author": "Ken Yasue",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bcrypt": "^5.1.1",
|
||||
"better-sqlite3": "^11.3.0",
|
||||
"next": "^15.1.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-markdown": "^9.0.1",
|
||||
"rehype-sanitize": "^6.0.0",
|
||||
"remark-gfm": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.49.0",
|
||||
"@types/bcrypt": "^5.0.2",
|
||||
"@types/better-sqlite3": "^7.6.11",
|
||||
"@types/node": "^20.11.0",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"@vitest/coverage-v8": "^2.0.0",
|
||||
"@vitest/ui": "^2.0.0",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"eslint": "^9.0.0",
|
||||
"eslint-config-next": "^15.1.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"husky": "^9.0.0",
|
||||
"lint-staged": "^15.2.0",
|
||||
"postcss": "^8.4.49",
|
||||
"prettier": "^3.2.0",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"tsx": "^4.19.2",
|
||||
"typescript": "~5.3.0",
|
||||
"typescript-eslint": "^8.0.0",
|
||||
"vitest": "^2.0.0"
|
||||
|
||||
26
playwright.config.ts
Normal file
26
playwright.config.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './tests/e2e',
|
||||
fullyParallel: true,
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
reporter: 'html',
|
||||
use: {
|
||||
baseURL: 'http://localhost:3000',
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: { ...devices['Desktop Chrome'] },
|
||||
},
|
||||
],
|
||||
webServer: {
|
||||
command: 'npm run dev',
|
||||
url: 'http://localhost:3000',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 120 * 1000,
|
||||
},
|
||||
});
|
||||
9
postcss.config.mjs
Normal file
9
postcss.config.mjs
Normal file
@ -0,0 +1,9 @@
|
||||
/** @type {import('postcss-load-config').Config} */
|
||||
const config = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@ -1,93 +0,0 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { add, subtract, multiply, divide } from './example';
|
||||
|
||||
describe('Math operations', () => {
|
||||
describe('add', () => {
|
||||
it('正の数を足すと正しい結果が返る', () => {
|
||||
// Given: 準備
|
||||
const a = 2;
|
||||
const b = 3;
|
||||
|
||||
// When: 実行
|
||||
const result = add(a, b);
|
||||
|
||||
// Then: 検証
|
||||
expect(result).toBe(5);
|
||||
});
|
||||
|
||||
it('負の数を足すと正しい結果が返る', () => {
|
||||
// Given: 準備
|
||||
const a = -2;
|
||||
const b = 3;
|
||||
|
||||
// When: 実行
|
||||
const result = add(a, b);
|
||||
|
||||
// Then: 検証
|
||||
expect(result).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('subtract', () => {
|
||||
it('正の数を引くと正しい結果が返る', () => {
|
||||
// Given: 準備
|
||||
const a = 5;
|
||||
const b = 3;
|
||||
|
||||
// When: 実行
|
||||
const result = subtract(a, b);
|
||||
|
||||
// Then: 検証
|
||||
expect(result).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('multiply', () => {
|
||||
it('正の数をかけると正しい結果が返る', () => {
|
||||
// Given: 準備
|
||||
const a = 2;
|
||||
const b = 3;
|
||||
|
||||
// When: 実行
|
||||
const result = multiply(a, b);
|
||||
|
||||
// Then: 検証
|
||||
expect(result).toBe(6);
|
||||
});
|
||||
|
||||
it('0をかけると0が返る', () => {
|
||||
// Given: 準備
|
||||
const a = 5;
|
||||
const b = 0;
|
||||
|
||||
// When: 実行
|
||||
const result = multiply(a, b);
|
||||
|
||||
// Then: 検証
|
||||
expect(result).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('divide', () => {
|
||||
it('正の数で割ると正しい結果が返る', () => {
|
||||
// Given: 準備
|
||||
const a = 6;
|
||||
const b = 3;
|
||||
|
||||
// When: 実行
|
||||
const result = divide(a, b);
|
||||
|
||||
// Then: 検証
|
||||
expect(result).toBe(2);
|
||||
});
|
||||
|
||||
it('0で割るとエラーをスローする', () => {
|
||||
// Given: 準備
|
||||
const a = 5;
|
||||
const b = 0;
|
||||
|
||||
// When/Then: 実行と検証
|
||||
expect(() => divide(a, b)).toThrow('Division by zero is not allowed');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -1,18 +0,0 @@
|
||||
export function add(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
export function subtract(a: number, b: number): number {
|
||||
return a - b;
|
||||
}
|
||||
|
||||
export function multiply(a: number, b: number): number {
|
||||
return a * b;
|
||||
}
|
||||
|
||||
export function divide(a: number, b: number): number {
|
||||
if (b === 0) {
|
||||
throw new Error('Division by zero is not allowed');
|
||||
}
|
||||
return a / b;
|
||||
}
|
||||
14
tailwind.config.ts
Normal file
14
tailwind.config.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import type { Config } from 'tailwindcss';
|
||||
|
||||
const config: Config = {
|
||||
content: [
|
||||
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
|
||||
export default config;
|
||||
@ -1,22 +1,33 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["dom", "dom.iterable", "ES2022"],
|
||||
"module": "ESNext",
|
||||
"lib": ["ES2022"],
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"noEmit": true,
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"types": ["vitest/globals"]
|
||||
"plugins": [{ "name": "next" }],
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts"
|
||||
],
|
||||
"exclude": ["node_modules", "dist", ".next", "data", "backups"]
|
||||
}
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import path from 'node:path';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: [
|
||||
'src/**/*.{test,spec}.{ts,tsx}',
|
||||
'tests/**/*.{test,spec}.{ts,tsx}',
|
||||
'lib/**/*.{test,spec}.{ts,tsx}',
|
||||
'repositories/**/*.{test,spec}.{ts,tsx}',
|
||||
'services/**/*.{test,spec}.{ts,tsx}',
|
||||
],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
@ -14,9 +17,11 @@ export default defineConfig({
|
||||
exclude: [
|
||||
'node_modules/**',
|
||||
'dist/**',
|
||||
'.next/**',
|
||||
'.steering/**',
|
||||
'**/*.config.{ts,js}',
|
||||
'**/*.config.{ts,js,mjs}',
|
||||
'**/types/**',
|
||||
'tests/**',
|
||||
],
|
||||
thresholds: {
|
||||
branches: 80,
|
||||
@ -26,4 +31,9 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, '.'),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user