Skip to content
Open
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
24 changes: 24 additions & 0 deletions .biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": { "useExhaustiveDependencies": "error" },
"suspicious": { "noExplicitAny": "error" }
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always"
}
}
}
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// ESLint の設定ファイル
module.exports = {
extends: ['next/core-web-vitals'],
};
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
lint-and-typecheck:
name: Lint and Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Run Biome Lint & Format Check
run: npm run lint:biome
- name: Run TypeScript Type Check
run: npm run build
build:
name: Build Project
runs-on: ubuntu-latest
needs: lint-and-typecheck
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Build Next.js application
run: npm run build
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy to Cloudflare Pages

on:
push:
branches: [main]

jobs:
publish:
name: Publish to Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Build with OpenNext
run: npm run opennext:build
- name: Publish to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: "prototyping-base-app-router"
3 changes: 3 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# Husky による Git フックの共通処理
export PATH="$PATH:$(npm bin)"
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx biome check --apply .
npx biome format --write .
35 changes: 35 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# LLM開発ルール

## LLMで生成したいこと
- UI生成
- 機能実装
- デプロイ

## 絶対に守るべきこと
- シンプルなアーキテクチャ
- 日本語でのドキュメント・コードコメント
- 最新バージョン技術の使用
- 秘匿情報を含まない公開リポジトリ
- 汎用的な記述

## 検討事項
- 技術スタック
- DB
- UIデザイン
- デプロイ先

## リポジトリに必要なもの
- LLM用rulesファイル (このファイル)
- packages.json
- README.md
- Linter設定
- Formatter設定
- Typescript設定
- TailwindCSS設定
- envファイル
- CloudflareでのNext.jsアプリ作成方法

## 不要なもの
- サンプルアプリケーション
- 具体的な実装
- ハッカソン情報
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

## 技術スタック

- **フロントエンド**: Next.js, React
- **スタイリング**: CSS Modules または styled-components
- **バックエンド**: API routes (Next.jsのサーバレスAPI機能を使用)
- **フロントエンド**: Next.js(App Router) と React
- **スタイリング**: TailwindCSS
- **言語/ツール**: TypeScript, Biome, Husky
- **デプロイ**: OpenNext を利用した Cloudflare Pages へのデプロイを想定

## プロジェクト構成

Expand Down Expand Up @@ -44,3 +45,10 @@
```bash
npm install
npm run dev
```

アプリを静的にエクスポートする場合は以下を実行してください:

```bash
npm run opennext:build
```
13 changes: 0 additions & 13 deletions components/Alert.js

This file was deleted.

34 changes: 0 additions & 34 deletions components/SettingsForm.js

This file was deleted.

20 changes: 0 additions & 20 deletions components/Timer.js

This file was deleted.

5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: このファイルは自動生成されます。

7 changes: 7 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Next.js の設定ファイル
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};

module.exports = nextConfig;
49 changes: 35 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
{
"name": "interview-timer-app",
"version": "1.0.0",
"description": "A timer application for managing interview sessions",
"main": "index.js",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "latest",
"react": "latest",
"react-dom": "latest"
}
"name": "prototyping-base-app-router",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:biome": "biome check --apply .",
"format:biome": "biome format --write .",
"prepare": "husky install",
"cf-typegen": "wrangler types --env cloudflare-pages > src/types/cloudflare.d.ts",
"opennext:build": "opennext build"
},
"dependencies": {
"next": "latest",
"react": "latest",
"react-dom": "latest"
},
"devDependencies": {
"@biomejs/biome": "latest",
"@cloudflare/workers-types": "latest",
"@types/node": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"autoprefixer": "latest",
"eslint": "latest",
"eslint-config-next": "latest",
"husky": "latest",
"opennext": "latest",
"postcss": "latest",
"tailwindcss": "latest",
"typescript": "latest",
"wrangler": "latest"
}
}
8 changes: 0 additions & 8 deletions pages/_app.js

This file was deleted.

23 changes: 0 additions & 23 deletions pages/index.js

This file was deleted.

7 changes: 7 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// PostCSS の設定ファイル
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
4 changes: 4 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* TailwindCSS の基本スタイルを読み込み */
@tailwind base;
@tailwind components;
@tailwind utilities;
11 changes: 11 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '../app/globals.css';
import type { ReactNode } from 'react';

// ルートレイアウト
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="ja">
<body>{children}</body>
</html>
);
}
11 changes: 11 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Timer from '../components/Timer';

// トップページ
export default function Page() {
return (
<main className="p-4">
<h1 className="text-xl font-bold">Interview Timer App</h1>
<Timer initialTime={60} />
</main>
);
}
9 changes: 9 additions & 0 deletions src/components/Alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// アラート表示用コンポーネント
export default function Alert({ message, isVisible }: { message: string; isVisible: boolean }) {
if (!isVisible) return null;
return (
<div style={{ backgroundColor: 'red', color: 'white' }}>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The component uses inline styles for backgroundColor and color. Since TailwindCSS is integrated into the project, it's advisable to use Tailwind utility classes for styling. This promotes consistency with the rest of the application's styling approach and leverages the benefits of a utility-first CSS framework.

For example, you could replace the inline style with Tailwind classes like className="bg-red-500 text-white p-4" (adjust padding or other styles as needed).

    <div className="bg-red-500 text-white p-4"> {/* Example Tailwind classes */}

<p>{message}</p>
</div>
);
}
Loading