Skip to content

feat(projects): add project resources and getProject - #72

Open
BIA3IA wants to merge 3 commits into
mainfrom
feat/project-resources
Open

BIA3IA wants to merge 3 commits into
mainfrom
feat/project-resources

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Adds the data the website needs for the project detail page (PoliNetworkOrg/web#189): the ways to use or get each project.

Schema — new web_project_resources table (migration 0022_project_resources): project_id (FK to web_projects, cascade on delete), kind (web, windows, macos, linux, android, ios, source), url, order, plus the usual author and time columns and creator check.

Routes (web.projects)

  • getProject (publicData, same policy as getAllProjects): { id } → the project with its resources ordered by order, or null.
  • addProjectResource, editProjectResource, reorderProjectResources, deleteProjectResource (dashboard("web:content:write"), same as the project mutations). URLs must be http(s). Missing rows return { error: "NOT_FOUND" } like the other mutations; reorderProjectResources only reorders resources of the given project.

getAllProjects is unchanged.

Seed — sample resources for the seeded projects (app stores, desktop downloads, web, source).

Validation: tsc --noEmit, biome check . and the test suite pass (87 passed, 7 DB-backed skipped, run with Node). idp-router.test.ts now checks the policies of the new procedures.

Add web_project_resources to store the ways to use or get a project (web
app, Windows, macOS, Linux, Android, iOS downloads or source code), with
getProject returning a project with its ordered resources for the website
detail page, and dashboard mutations to add, edit, reorder and delete them.
Seed sample resources for the seeded projects.
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a14ead52-7b7a-476a-a194-6e55cb9f2c81
📥 Commits

Reviewing files that changed from the base of the PR and between 67edf6e and 916fbe5.

📒 Files selected for processing: 7
  • drizzle/0027_project_resources.sql
  • drizzle/meta/0027_snapshot.json
  • drizzle/meta/_journal.json
  • scripts/seed-db.ts
  • src/db/schema/web/projects.ts
  • src/routers/web/projects.ts
  • tests/idp-router.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@toto04
toto04 force-pushed the main branch 2 times, most recently from e989be7 to 43854c5 Compare October 21, 2026 19:43
Conflict resolutions:
- Freshman content: the branch carried a pre-merge copy of backend#84,
  which landed on main as 0026_freshman_content. Dropped the branch's
  0023_freshman_content migration/snapshot and took main's freshman
  router, seed, fixtures, README section and seed-db test.
- drizzle: dropped 0022_project_resources + snapshot, took main's
  journal/snapshots and regenerated the identical SQL as
  0027_project_resources.
- web.projects resource procedures ported to #88 auth:
  addProjectResource/editProjectResource are now tokenOnly and call
  authorOf(ctx.actor); the unused createdBy/modifiedBy inputs are
  dropped (non-strict schemas, so old clients still parse).
- tests/idp-router.test.ts: kept the resource policy checks, dropped
  the obsolete "not legacy" assertion, and listed the two resource
  writes among the tokenOnly procedures.
- bun.lock: main's lockfile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants