-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
209 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,26 +42,17 @@ EveEve(Everyone Translate Everything)は、インターネットに公開さ | |
cd web | ||
bun i | ||
``` | ||
3. googleログインの設定をする必要があります。 | ||
https://console.cloud.google.com/apis | ||
設定方法は以下のページを参考にしてください | ||
https://developers.google.com/identity/sign-in/web/sign-in?hl=ja | ||
https://zenn.dev/yoiyoicho/articles/c44a80e4bb4515#google%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%AE%E5%85%AC%E5%BC%8F%E3%83%89%E3%82%AD%E3%83%A5%E3%83%A1%E3%83%B3%E3%83%88%E3%82%92%E8%AA%AD%E3%82%80 | ||
|
||
承認済みのリダイレクトURIには | ||
http://localhost:5173/api/auth/callback/google | ||
を設定してください | ||
|
||
クライアントIDとクライアントシークレットを取得してください | ||
|
||
3. 環境変数ファイルを作成し、必要な値を設定します: | ||
``` | ||
cp .env.example .env | ||
``` | ||
`.env` ファイルを開き、以下の変数を適切な値に設定してください: | ||
以下のコマンドを実行してください | ||
``` | ||
openssl rand -base64 32 | ||
``` | ||
このコマンドで生成された文字列を`.env`ファイルの`SESSION_SECRET`に設定してください: | ||
- SESSION_SECRET | ||
- GOOGLE_CLIENT_ID | ||
- GOOGLE_CLIENT_SECRET | ||
|
||
4. dockerを起動します: | ||
``` | ||
|
@@ -71,12 +62,19 @@ EveEve(Everyone Translate Everything)は、インターネットに公開さ | |
``` | ||
bunx prisma migrate dev | ||
``` | ||
6. 起動します: | ||
6. seedを実行します: | ||
``` | ||
bun run seed | ||
``` | ||
7. 起動します: | ||
``` | ||
bun run dev | ||
``` | ||
6. ブラウザで `http://localhost:5173` にアクセスして、eveeve を使用開始します。 | ||
6. ブラウザで `http://localhost:5173` にアクセスして、eveeve を使用開始します: | ||
7. ローカル開発環境では、認証プロセスが簡略化されています: | ||
- `http://localhost:5173/auth/login` にアクセスして、[email protected]とdevpasswordでログインしてください。 | ||
|
||
注意: この簡易認証は開発環境でのみ機能し、本番環境では無効になります。本番環境では通常のGoogle認証フローが使用されます。 | ||
|
||
## 貢献方法 | ||
翻訳、プログラミング、デザイン、ドキュメンテーションなど、あらゆる形の貢献を歓迎します。現在特に以下の分野での貢献を求めています: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import type { User } from "@prisma/client"; | ||
|
||
export type SafeUser = Omit<User, "password" | "geminiApiKey">; | ||
export type SafeUser = Omit<User, "password" | "geminiApiKey" | "openAIApiKey" | "claudeApiKey">; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "users" ADD COLUMN "password" TEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `password` on the `users` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "users" DROP COLUMN "password"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "users" ADD COLUMN "password" TEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { PrismaClient } from '@prisma/client' | ||
import bcrypt from 'bcryptjs' | ||
|
||
const prisma = new PrismaClient() | ||
|
||
async function seed() { | ||
if (process.env.NODE_ENV !== 'development' && !process.env.ALLOW_SEEDING) { | ||
console.log('Seeding is only allowed in development environment') | ||
return | ||
} | ||
|
||
const email = '[email protected]' | ||
|
||
// 既存のユーザーをチェック | ||
const existingUser = await prisma.user.findUnique({ | ||
where: { email }, | ||
}) | ||
|
||
if (existingUser) { | ||
console.log(`A user with email ${email} already exists`) | ||
return | ||
} | ||
|
||
const hashedPassword = await bcrypt.hash('devpassword', 10) | ||
|
||
const user = await prisma.user.create({ | ||
data: { | ||
email, | ||
name: 'Dev User', | ||
password: hashedPassword, | ||
image: '', | ||
provider: 'password', | ||
plan: 'free', | ||
totalPoints: 0, | ||
isAI: false, | ||
}, | ||
}) | ||
|
||
console.log(`Created dev user with email: ${user.email}`) | ||
} | ||
|
||
seed() | ||
.catch((e) => { | ||
console.error(e) | ||
process.exit(1) | ||
}) | ||
.finally(async () => { | ||
await prisma.$disconnect() | ||
}) |