Skip to content

feat: implement prototype preset with in-process defaults and dev warnings (closes #82) - #160

Open
MehulSehgal wants to merge 10 commits into
sidd190:mainfrom
MehulSehgal:feat/prototype-preset
Open

MehulSehgal wants to merge 10 commits into
sidd190:mainfrom
MehulSehgal:feat/prototype-preset

Conversation

@MehulSehgal

@MehulSehgal MehulSehgal commented Nov 18, 2026 •

Copy link
Copy Markdown

Summary

Closes #82

Implements the prototype deployment preset for createAuthBackend. As specified in the roadmap (VISION.md), this provides the fastest zero-config onboarding path for developers and AI tools with in-process defaults and loud, unmissable console warnings explicitly stating that it is not intended for production.

Key Changes

  1. Preset Infrastructure (backend/presets.js):

    • Implemented applyPreset(config) to normalize and validate preset tiers.
    • Designed the prototype preset with:
      • Ephemeral in-memory session handling (useMemorySession: true) to avoid requiring a running MongoDB/Redis session store for fast testing.
      • Sensible local defaults (dimsee-prototype database URI, generated development secrets).
      • Prominent, formatted console warning banner emitted during startup.
      • Critical security warning emitted if NODE_ENV === 'production'.
    • Rejection with clean errors for unknown preset names.
  2. Backend Engine Integration (backend/index.js & index.js):

    • Integrated applyPreset() into createAuthBackend().
    • Wired in-memory session store fallback when useMemorySession is active.
    • Exposed preset metadata and warnings via app.locals.authConfig.
    • Exported applyPreset and PROTOTYPE_WARNING_BANNER from root entry point.
  3. Unit Tests (__tests__/prototypePreset.test.js):

    • Tests validating prototype defaults, custom overrides, warning banner emissions, unknown preset rejections, and production environment guards.
  4. Documentation:

    • README.md: Added preset to backend configuration options table and created a "Rapid Prototyping with the prototype Preset" guide.
    • SECURITY.md: Clarified isolation of prototype preset and production responsibilities.
    • CONTRIBUTING.md: Added preset environment validation to Definition of Done.
    • VISION.md: Updated milestone status in the architectural roadmap.

Verification

  • npm test: 6 test suites passed, 49 tests passed (100% green).
  • npm run lint: Clean with 0 errors/warnings.
  • npm run build: Babel compilation succeeded cleanly.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

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 17 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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 148ddcd0-a906-4e74-b66d-57e73495127e
Commits

Reviewing files that changed from the base of the PR and between 805e9f4 and 11bbf7e.

Files selected for processing: 9

  • CONTRIBUTING.md
  • README.md
  • SECURITY.md
  • VISION.md
  • __tests__/prototypePreset.test.js
  • backend/index.js
  • backend/presets.js
  • index.js
  • package.json
  • 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

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.

Implement the 'prototype' preset

1 participant