Skip to content
Back to search

DownBot

Ai application like ChatGPT, Claude, Gemini using GenAi. Practicing RAG, Langchain, Langgraph, MCP servers

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 20 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/PratapBhingare/DownBot with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/PratapBhingare/DownBot'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/pratapbhingare--downbot/badge.svg)](/listings/pratapbhingare--downbot)

HTML

<a href="/listings/pratapbhingare--downbot"><img src="/api/listings/pratapbhingare--downbot/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 136 lines
  1. # Downbot
  2. A calm, authentication-only starting point for a future multi-model AI chat app.
  3. Includes registration, login, rotating sessions, a protected account page, and logout.
  4. No chat, OAuth, email verification, or password-reset functionality is implemented.
  5. ## Run locally
  6. Requirements: Node.js **22.22+** and MongoDB. The backend itself uses plain JavaScript
  7. ES modules; the Node minimum accommodates the frontend tooling.
  8. ```sh
  9. npm install
  10. cp backend/.env.example backend/.env
  11. node -e "console.log(require('crypto').randomBytes(48).toString('hex'))"
  12. # Run the command twice. Put different values in ACCESS_TOKEN_SECRET and
  13. # REFRESH_TOKEN_SECRET in backend/.env. Start MongoDB and set MONGODB_URI.
  14. npm run dev
  15. ```
  16. Open **http://127.0.0.1:5173**. The API listens on port **5001** (avoiding macOS AirPlay's port 5000). Keep the same
  17. hostname while testing; switching between localhost and 127.0.0.1 changes cookies.
  18. Do not commit `.env` or use the same signing secret for both token types.
  19. ## Architecture
  20. ```text
  21. backend/src/
  22. routes/ -> controller/ -> DAO/ -> models/
  23. config/ environment validation and database connection
  24. middleware/ authentication, validation, centralized failures
  25. validators/ express-validator rules
  26. utils/ JWT, response helpers, AppError
  27. types/ shared JavaScript JSDoc domain/response contracts
  28. services/ reserved for future third-party integrations
  29. frontend/src/
  30. app/ application routing and Redux store
  31. features/auth/
  32. API/ Axios requests and single-flight refresh/retry
  33. State/ Redux Toolkit auth slice
  34. Hooks/ form state, validation, API orchestration, session lifecycle
  35. UI/ pages and presentational components
  36. ```
  37. Future features should each own these same four frontend layers. UI components
  38. never call Axios or dispatch Redux actions directly. Hooks connect API and State.
  39. The API layer receives session callbacks rather than importing the store.
  40. The backend follows the `backend-boilerplate` skill, deliberately adapted to
  41. **JavaScript**: `.js` files, JSDoc contracts, and Node's native watch mode replace
  42. TypeScript, declaration files, compilation, and `tsx`. No application service layer.
  43. ## Proxy, cookies, and sessions
  44. All browser requests use relative `/api/v1/auth` URLs. Vite forwards `/api`:
  45. ```js
  46. server: {
  47. proxy: {
  48. '/api': { target: 'http://127.0.0.1:5001', changeOrigin: true }
  49. }
  50. }
  51. ```
  52. There is **no CORS dependency or middleware**. If the backend port changes, update
  53. the target in [frontend/vite.config.js](./frontend/vite.config.js).
  54. - Access JWTs expire after 15 minutes and live only in Redux memory, not local or
  55. session storage. Reload restores the session through the refresh cookie.
  56. - Refresh JWTs expire after seven days. The HTTP-only cookie uses `SameSite=Strict`,
  57. path `/api/v1/auth`, and `Secure` in production.
  58. - One active refresh session per account. A new login replaces the previous one.
  59. - Rotation checks the stored token and uses an atomic compare-and-swap. Unique
  60. JWT IDs prevent identical same-second tokens. Old cookies cannot be replayed.
  61. - Logout removes the stored refresh token and browser cookie. Already-issued
  62. access tokens remain valid until their 15-minute expiry (stateless JWT behavior).
  63. - Concurrent refresh requests in one tab share a promise. Separate tabs/devices
  64. do not coordinate rotations; a losing tab must sign in again.
  65. - Passwords use bcrypt with 10 rounds. Registration requires 8+ characters,
  66. a letter, a number, and at most 72 UTF-8 bytes to avoid bcrypt truncation.
  67. - Failed login/registration attempts are rate limited to 30 per IP per 15 minutes.
  68. The limiter is in-memory; use a shared store for multiple API instances.
  69. - Outages show actionable errors instead of silently appearing signed out.
  70. ## Validation
  71. ```sh
  72. npm run lint
  73. npm test
  74. npm run build
  75. ```
  76. Backend tests launch an isolated MongoDB through `mongodb-memory-server`; the
  77. first run may download a MongoDB binary. An installed binary can be reused:
  78. ```sh
  79. MONGOMS_SYSTEM_BINARY="$(command -v mongod)" npm test
  80. ```
  81. Tests cover the auth lifecycle, generic credential errors, validation, safe
  82. response shapes, cookie options, token replay/concurrency, session revocation,
  83. Axios retry behavior, route guards, and form failure states.
  84. There is no TypeScript compilation step; ESLint, integration tests, and Vite's
  85. production build validate the JavaScript implementation.
  86. ## Production
  87. `npm run build` creates `frontend/dist`. Serve it with an HTTPS reverse proxy that:
  88. 1. Proxies `/api/*` to the Express API, without stripping the `/api` prefix.
  89. 2. Serves the Vite output and falls back to `index.html` for frontend routes.
  90. 3. Keeps the frontend and API on **the same origin**.
  91. Set `NODE_ENV=production` in the backend environment, provide MongoDB and two
  92. strong secrets, and run `npm start`. The API does not serve frontend static files,
  93. and Vite's development proxy is not a production server. The start script reads
  94. `backend/.env`; infrastructure-provided variables take precedence.
  95. Before deploying behind a proxy, configure Express `trust proxy` for the actual
  96. trusted proxy topology so IP rate limiting is correct; do not blindly trust all proxies.
  97. ## Design
  98. The [Google Stitch design](https://stitch.withgoogle.com/projects/11127232767386413252)
  99. provided the off-white canvas, sage editorial panel, forest-green controls,
  100. stacked-card artwork, and generous split layout. Registration and account views
  101. share that visual language. Tailwind CSS styles the implementation; fonts are
  102. self-hosted. AI model names on the account page describe the future direction,
  103. not available integrations.
  104. Light and dark themes follow the operating system's `prefers-color-scheme`
  105. setting automatically. All colors are semantic tokens in
  106. `frontend/src/styles.css`; the dark palette overrides those tokens in one media
  107. query, so components never hard-code colors.
  108. See [backend API documentation](./backend/README.md) for all request/response examples.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.