Add a clearly labelled demo-data script for local development

未关闭
#116 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
nodejs, typescript

调研方向

Start with apps/api/package.json to see how existing scripts are wired, and apps/api/src/config/env.ts for where the NODE_ENV=production refusal belongs. Read the schemas under apps/api/src/models to learn the required fields for users, posts, comments and follows, then write an idempotent seeder (upsert or find-or-create) using the demo_ prefixed names. Document the command in docs/DEVELOPMENT.md; done when it runs on an empty database, repeats without duplicates, refuses in production, and passes npm run typecheck, npm test and npm run lint.

由索引模型根据 Issue 内容生成。

描述

api enhancement help wanted

Developers need a populated app to test feeds and profiles, but must not confuse it with real data.

What to do

Add npm run seed:demo that creates a handful of obviously fake users, posts, comments and follows in the local database. Every demo user must have a name that makes it clear (for example demo_alice), small realistic numbers, no fake paid subscriptions, and the script must refuse to run when NODE_ENV=production. Running it twice must not create duplicates. Document it in docs/DEVELOPMENT.md.

Where to look

apps/api/src/models, apps/api/package.json, apps/api/src/config/env.ts.

Done when

The script runs on an empty database, is safe to repeat, refuses in production, and has a short test or a documented manual check.

How to work on it

Fork the repo, branch from main, and follow CONTRIBUTING.md. Run npm run typecheck, npm test and npm run lint before opening a PR. Comment here if you'd like to take it, and ask if anything is unclear.


Generated by Claude Code

主要语言
TypeScript
星标
6
派生
6
平均合并
1 小时 59 分钟
30 天内合并 PR
59

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Haseeb-MernStack/commune 的其他 Issue

查看 Haseeb-MernStack/commune 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。