Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review Summary by QodoFoolproof Local Convex Setup with Node.js Orchestration and Convex Auth Integration
WalkthroughsDescription**Core Setup Infrastructure Overhaul:** • Replaced 350-line bash setup script with a robust 1558-line Node.js orchestration module (scripts/local-convex-setup.js) that handles env file parsing/merging, JWT key pair generation, Convex deployment configuration, workspace creation/selection, and local env propagation • Implemented comprehensive test suite (579 lines, 8 test cases) covering clean setup, reruns, JWT regeneration, malformed JWKS handling, and env file preservation • Created setup contract manifest (local-convex-setup-manifest.js) defining required core backend env, optional feature profiles, and app-specific .env.local targets **Environment Variable and Auth Updates:** • Replaced deprecated AUTH_SECRET with JWT_PRIVATE_KEY and JWKS for Convex Auth JWT signing/verification across all documentation and example files • Updated all Convex CLI commands to use pnpm exec prefix and modern convex auth add flow instead of manual env setting • Added new environment variables for web app (E2E_BACKEND_URL, NEXT_PUBLIC_TEST_WORKSPACE_ID) and mobile app (EXPO_PUBLIC_CONVEX_URL, EXPO_PUBLIC_WORKSPACE_ID) **Documentation and Developer Experience:** • Expanded setup documentation with clear one-command bootstrap flow, rerun flags (--reconfigure, --create-workspace, --non-interactive), and manual setup escape hatches • Added comprehensive design document, specification, and proposal explaining structural improvements and validation strategy • Created .env.example files for all apps (web, mobile, widget, RN SDK) with setup script references • Added "Disposable Container Smoke Path" section with Docker-based testing instructions • Clarified that setup scripts preserve unrelated user-managed keys and comments during reruns **Shell Script Simplification:** • Reduced setup.sh from 350 to 24 lines and update-env.sh from 133 to 13 lines, now thin wrappers validating prerequisites and delegating to Node.js implementations • Added update-local-env.js entry point for env update command Diagramflowchart LR
A["Shell Wrapper<br/>setup.sh"] -->|delegates| B["Node.js Orchestration<br/>local-convex-setup.js"]
B -->|uses| C["Setup Manifest<br/>local-convex-setup-manifest.js"]
B -->|generates| D["JWT Keys<br/>JWT_PRIVATE_KEY<br/>JWKS"]
B -->|configures| E["Convex Deployment<br/>Backend Config"]
B -->|creates/selects| F["Workspace<br/>Resolution"]
B -->|updates| G["App .env.local Files<br/>Non-destructive"]
H["Test Suite<br/>local-convex-setup.test.js"] -->|validates| B
I["Documentation<br/>README, Design, Spec"] -->|guides| A
File Changes1. scripts/local-convex-setup.js
|
Code Review by Qodo
1.
|
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
This pull request significantly improves the developer onboarding experience and documentation for setting up and configuring Opencom, both for local development and self-hosting. The changes clarify and streamline the quick start process, update environment variable handling for Convex Auth, and enhance the
.env.examplefiles across all apps. The documentation now emphasizes a one-command bootstrap script, provides clearer manual setup steps, and details new environment variable requirements for Convex Auth integration.Onboarding and Setup Improvements:
The
README.mdand setup docs now emphasize the use of the./scripts/setup.shbootstrap script, which automates dependency installation, Convex deployment configuration, Convex Auth setup, workspace creation, and.env.localfile generation. The process is more robust, non-destructive to unrelated env keys, and supports rerun flags for reconfiguration or workspace creation. [1] [2] [3] [4] [5] [6]Manual setup instructions are improved, clarifying when and how to use them, and providing step-by-step commands for Convex Auth configuration and environment propagation. [1] [2] [3]
Convex Auth and Environment Variable Updates:
Environment variable names and requirements are updated throughout the documentation and example files to use
JWT_PRIVATE_KEYandJWKSfor Convex Auth JWT signing and verification, replacing the legacyAUTH_SECRET. The docs now clearly distinguish between required and optional variables for different features (e.g., email, test data). [1] [2] [3]The
.env.examplefiles for all apps (web,widget,mobile,landing) are updated to reflect the new variable names, clarify which are auto-filled by setup scripts, and provide better guidance for manual configuration. [1] [2] [3] [4]Developer Experience Enhancements:
The docs introduce a disposable container "smoke path" for testing setup flows in a clean environment, and provide troubleshooting tips for common setup issues. [1] [2]
The setup scripts now preserve unrelated keys and comments in
.env.localfiles, reducing friction for developers with custom configurations.Summary of Most Important Changes:
1. Onboarding & Setup Automation
./scripts/setup.shbootstrap script for one-command setup, including dependency install, Convex deployment, Convex Auth, workspace creation, and.env.localmanagement. Added rerun flags and clarified prerequisites. [1] [2] [3] [4]2. Convex Auth Integration & Env Vars
JWT_PRIVATE_KEYandJWKSfor Convex Auth JWT signing/verification, replacingAUTH_SECRET. Clarified which variables are required for which features and deployments. [1] [2] [3].env.examplefiles to match the new variable names and provide setup guidance. [1] [2] [3] [4]3. Developer Experience & Troubleshooting
.env.localmanagement to preserve unrelated keys/comments on rerun, and added troubleshooting and smoke-testing instructions for disposable environments. [1] [2] [3]These changes make Opencom significantly easier to set up, configure, and maintain for both new and advanced users.