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: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ pnpm prisma migrate dev
```
### seedデータの適用

マイグレーションが終わったらseedデータを適用する
マイグレーションが終わったらseedデータを適用する

```bash
pnpm seed
```

詳細は `prisma/README.md` を参照。

### 開発サーバーの起動

devを実行することでサイトが表示される。
Expand All @@ -50,7 +52,7 @@ devを実行することでサイトが表示される。
pnpm dev
```

実行後、`localhost:3000`で開発サーバーが起動する
実行後、`localhost:3000`で開発サーバーが起動する。`0.0.0.0:3000`だとGoogleのOAuth認証ができないので注意。

## 使用しているライブラリ

Expand Down
30 changes: 30 additions & 0 deletions docs/AUTH_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 認証のセットアップ(暫定対応)

1. `.env` ファイルを更新 (メンテナーに聞いてください)
2. 開発サーバを起動する
3. Postman等を使用してAPIを叩き、ユーザーを仮登録する(下記参照)
4. Prisma Studioを起動、User テーブルを開き verifiedAt が null のユーザーデータが作成されていることを確認
5. `http://localhost:3000/login` にアクセス
6. 大学Googleアカウントを選択してログイン
7. ログインに成功した場合、 localhost:3000/joined に移行する
失敗した場合は 3. からやり直す
(この時点では /channels 等のページを開こうとしても /joined にリダイレクトされるようになっている)
8. Joinedページの手順を全て完了し、「Digichatをはじめる」ボタンを押す
9. /channels 下など、他ページを開けることを確認
10. Prisma Studioを開き、先ほどの User の verifiedAt に本登録を行った日時が書き込まれていることを確認

## リクエスト形式

- URL: `http://localhost:3000/api/ext/users/create`
- Method: `POST`
- Headers:
- `Content-Type: application/json`
- `Authorization: {EXT_API_SECRET}`
- Body:
```json
{
"name": "テストユーザー",
"email": "(大学メールアドレス)",
"slug": "(一意な文字列)"
}
```
8 changes: 7 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const eslintConfig = [
eslintConfigPrettier,
{
rules: {
"no-console": [
"error",
{
allow: ["warn", "error"],
},
],
"import/order": [
"error",
{
Expand Down Expand Up @@ -44,4 +50,4 @@ const eslintConfig = [
},
];

export default eslintConfig;
export default eslintConfig;
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@mantine/tiptap": "^7.15.1",
"@prisma/client": "^6.2.1",
"@tabler/icons-react": "^3.24.0",
"@tiptap/extension-image": "^2.11.5",
"@tiptap/extension-link": "^2.10.3",
"@tiptap/pm": "^2.10.3",
"@tiptap/react": "^2.10.3",
Expand All @@ -37,6 +38,8 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"rehype-katex": "^7.0.1",
"rehype-parse": "^9.0.1",
Copy link
Copy Markdown
Member Author

@newt239 newt239 Mar 13, 2025

Choose a reason for hiding this comment

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

タグで囲まれた部分が表示されなくなってしまったため、remark-parseからrehype-parseに変えました

MarkdownではなくHTMLを直接渡している可能性
unified().use(remarkParse) を使っているので、これは Markdown を解析するパイプラインになっています。
もし <h1>Hello</h1> のような HTML 文字列をそのまま渡している場合、remarkParse ではなく rehypeParse を使うべきです。
→ もし HTML を含む文字列を処理するなら、 remarkParse ではなく rehypeParse を試してください。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

この点コメントしたので確認お願いします!
#45 (comment)

"rehype-raw": "^7.0.0",
"rehype-react": "^8.0.0",
"rehype-sanitize": "^6.0.0",
"remark-breaks": "^4.0.0",
Expand All @@ -50,6 +53,7 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@next/eslint-plugin-next": "^15.2.4",
"@types/node": "^20.17.11",
"@types/react": "^19",
"@types/react-dom": "^19",
Expand All @@ -58,6 +62,7 @@
"eslint-config-next": "15.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react-hooks": "^5.2.0",
"prettier": "^3.4.2",
"prisma": "^6.2.1",
"stylelint": "^16.11.0",
Expand Down
Loading