尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Grocery and Shopping List App for Couples
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Gracie is a minimal grocery/shopping list app designed to share a single House (UI term) backed by a Room (backend model). The repo includes the backend API in Go + MongoDB and a React/Vite frontend. Authentication supports API keys and email/password.
For now, Rooms are empty containers; the core flows implemented are user signup, room sharing via invite links (tokens), joining rooms, and room deletion by member votes.
Prereqs
.nvmrc) and pnpm 9 (for local frontend)Start MongoDB (single-node replica set), API, and frontend (Nginx) together:
docker compose up --build
URLs:
/api to API, no CORS)The compose file includes a one-shot init service to initiate the replica set rs0. The API waits until it completes, so transactions work locally.
Environment (compose)
The backend runs with:
DATA_STORE=mongoMONGODB_URI=mongodb://mongo:27017/?replicaSet=rs0&retryWrites=true&w=majorityMONGODB_DB=gracieENC_KEY_FILE=/app/secrets/enc.key (bind-mounted from ./.secrets/enc.key)Auth
Authorization: Bearer <api_key> on all endpoints except /users, /auth/*./auth/register and /auth/login supported; passwords are bcrypt‑hashed and encrypted-at-rest.Endpoints
/users (public): Create a user with name; also creates a solo room. Returns { user, api_key }./auth/register (public): { username(email), password, name? } → 201./auth/login (public): { username, password } → { user, api_key }./me: Get current user./me: Update name./rooms/me: Get current room view (sanitized; no internal IDs; includes display name, description, member names)./rooms: Create a solo room if user has none (409 if exists)./rooms/share: Return the House's current invite code { token }, minting one only if it has none (reading never replaces a code someone was given)./rooms/share: Replace the invite code and return the new { token }; the old one stops working. A code is single use: joining clears it./rooms/join: Body { token } to join a room using a 5‑char code (no room ID required)./rooms/settings: { display_name?, description? } update./rooms/deletion/vote: Record deletion vote; when all current members have voted, the room is deleted and all users’ room_id values are cleared./rooms/deletion/cancel: Remove caller’s vote.Example flow (abbreviated)
curl -s -X POST http://localhost:8080/users \
-H 'Content-Type: application/json' \
-d '{"name":"Alice"}'
Response includes api_key and user.room_id.
curl -s -X POST http://localhost:8080/rooms/share \
-H 'Authorization: Bearer <ALICE_API_KEY>'
Response: { "token": "ABCDE" }.
# Bob registers/logs in and receives <BOB_API_KEY>
curl -s -X POST http://localhost:8080/rooms/join \
-H 'Authorization: Bearer <BOB_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{"token":"<ABCDE>"}'
# Alice votes
curl -s -X POST http://localhost:8080/rooms/deletion/vote \
-H 'Authorization: Bearer <ALICE_API_KEY>'
# Bob votes (this deletes the room)
curl -s -X POST http://localhost:8080/rooms/deletion/vote \
-H 'Authorization: Bearer <BOB_API_KEY>'
users.api_key_lookup so documents without an API key don’t collide on null.bson tags and store timestamps as time.Time to avoid decode issues.backend/cmd/gracie-server: HTTP server entrypointbackend/internal/...: Core packages (auth, config, http handlers/middleware/router, services, store/mongo)backend/pkg/ids: ID and token generation helpersfrontend/: React + Vite app (UI refers to “House”) served via Nginx in Dockerbackend/internal/....Run all tests
cd backend
go test ./...
Unit-only (no DDB)
cd backend
go test ./internal/config ./internal/auth ./internal/http/...
TBD for now (private/internal usage during development).