尚未检测到更新。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).