Bearly Secure is the intentionally vulnerable starter app for "Learn Web Security in TypeScript." It's a tiny plushie shop built with TypeScript, Express, and SQLite.
[!IMPORTANT] This README describes the freshly cloned starter project from lesson 1.2. Course assignments will change the app's behavior, but this file remains a reference for the initial baseline.
- Node.js 24 or newer
- npm
Install the dependencies:
npm installSeed the local database:
npm run db:resetStart the app at http://localhost:3000:
npm startFor automatic restarts while editing, use npm run dev instead.
The repository includes a small browser-based attacker lab for cross-origin exercises. Run it in another terminal:
npm run attacker-labThen open http://localhost:4000.
Type-check the app:
npm run typecheckCheck formatting and lint source files:
npm run lintFormat files:
npm run formatYou can restore the deterministic starter data at any time with npm run db:reset.
- Public storefront with product listing, search, detail pages, and reviews
- Account creation, login, logout, password reset, and session cookies
- Account profiles, order history, review management, and tax-document uploads
- Authenticated shopping cart and checkout with simulated PawPal and Acorn integrations
- Support and admin areas for order, tax-document, and product workflows
- JSON product and order APIs
- Browser attacker lab and embedded shipping widget
- Deterministic local order-assistant simulation
- SQLite seed data, local file storage, and JSON-lines application logs
- Single-stage Node 24 Dockerfile that runs TypeScript directly
Bearly Secure is deliberately unsafe. It contains exploitable authentication, authorization, injection, browser-security, data-exposure, infrastructure, and operational weaknesses for course exercises.
Do not deploy it or use its security patterns in a real application. Its credentials, integrations, payments, and third-party services are local simulations that use fake data only.
src/main.ts: starts the HTTP serversrc/app.ts: configures Express middleware and routessrc/dependencies.ts: loads runtime configuration and shared dependenciessrc/auth/: contains authentication, session, TOTP, passkey, and access-control helperssrc/integrations/: contains simulated external-service integrationssrc/orders/and thesrc/cart.ts,src/products.ts, andsrc/reviews.tsmodules: contain domain data helperssrc/uploads/: contains upload metadata, middleware, and archive extractionsrc/routes/: contains the app's Express route modulessrc/views/: renders server-side HTMLsrc/assistant.ts: builds and runs the local order-assistant simulationscripts/: contains local validation and support scriptsattacker-lab/: contains the browser attacker labpublic/: contains static assetsdata/uploads/: contains local uploads and the seeded sample tax exemption PDFdata/bulk-tax-documents/: receives documents extracted from support ZIP importsDockerfile: defines the initial single-stage container build