mcpField
E
extension-backend

extension-backend

github.com/quangplDevelopment64167 installsUpdated 7w ago
Repository

About extension-backend

A skill for planning and building a backend API that supports a Chrome extension, with NestJS and MongoDB as the recommended stack. It guides developers through requirements, project setup, endpoints, and security for services such as authentication, licensing, sync, and API proxying.

Key features

  1. 01Backend requirement planning
  2. 02NestJS and MongoDB setup guidance
  3. 03Authentication and license endpoint patterns
  4. 04Payment webhook and sync API patterns
  5. 05Security checklist and references

Use cases

  1. 01Add account authentication to an extension
  2. 02Verify licenses or subscriptions
  3. 03Sync extension data across devices
  4. 04Proxy external APIs without exposing keys

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/quangpl/browser-extension-skills --skill extension-backend

After installing, type/extension-backendin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
extension-api-patterns.md
mongoose-patterns.md
nestjs-setup.md
security-patterns.md

Details

From the project README

Extension Backend

🚀 Upgrade to Premium Get the Premium version at https://app.extensionbooster.net/dashboard/services/extension-ai-kit

Build a secure, maintainable backend API for a Chrome extension. Recommended stack: NestJS + MongoDB (Mongoose).

When to Activate

Activate this skill when extension work requires:

  • License verification / payment webhooks
  • User authentication / account management
  • Data sync across devices
  • External API proxy (hide API keys from extension)
  • Any server-side logic

Workflow (Execute This)

Step 1: Ask user to confirm requirements
  1. Do you need a backend? (explain why: API keys, auth, payments, sync)
  2. Stack preference: NestJS + MongoDB (recommended) or custom?
  3. Hosting target: Vercel / Railway / Fly.io / AWS / self-hosted?
  4. Features needed (pick from):
    • User auth (Google OAuth via chrome.identity)
    • License/subscription verification
    • Payment webhooks (Stripe, Paddle, etc.)
    • Data sync / storage API
    • External API proxy
    • Rate limiting
Step 2: Fetch framework docs

Use docs-seeker skill to fetch latest docs:

Step 3: Scaffold the backend
npx @nestjs/cli new extension-backend --strict --package-manager pnpm
cd extension-backend
pnpm add @nestjs/mongoose mongoose @nestjs/config class-validator class-transformer
pnpm add helmet @nestjs/throttler
pnpm add -D @types/express
Step 4: Project structure
src/
├── main.ts                          # Bootstrap, CORS, helmet, validation
├── app.module.ts                    # Root module
├── config/
│   └── configuration.ts             # Env-based config
├── auth/
│   ├── auth.module.ts               # Auth module
│   ├── auth.controller.ts           # POST /auth/verify-token
│   ├── auth.service.ts              # Token validation logic
│   └── guards/auth.guard.ts         # Global auth guard
├── license/
│   ├── license.module.ts
│   ├── license.controller.ts        # GET /license/verify
│   ├── license.service.ts           # License CRUD
│   └── schemas/license.schema.ts    # Mongoose schema
├── webhook/
│   ├── webhook.module.ts
│   ├── webhook.controller.ts        # POST /webhook/stripe
│   └── webhook.service.ts           # Process payment events
└── common/
    ├── filters/http-exception.filter.ts
    ├── interceptors/logging.interceptor.ts
    └── dto/                          # Shared DTOs
Step 5: Essential endpoints
MethodEndpointPurposeAuth
POST/auth/verify-tokenVerify Google OAuth tokenNo
GET/license/verifyCheck user subscription statusYes
POST/webhook/stripeReceive payment eventsSignature
GET/healthHealth checkNo
Step 6: Security checklist

See references/security-patterns.md for implementation details.

  • Helmet middleware enabled
  • CORS restricted to chrome-extension://<ID> origin
  • Rate limiting (ThrottlerModule)
  • Input validation (class-validator on all DTOs)
  • Webhook signature verification
  • No secrets in response bodies
  • MongoDB injection prevention (Mongoose sanitizes by default)
  • HTTPS only in production

References

  • references/nestjs-setup.md — Bootstrap, modules, CORS, env config
  • references/security-patterns.md — Auth guard, rate limiting, webhook verification, CORS
  • references/mongoose-patterns.md — Schemas, services, queries, indexes
  • references/extension-api-patterns.md — Endpoints the extension calls, token flow

Related Skills

  • extension-payment — Payment gateway integration (calls this backend)
  • extension-dev — Extension-side feature development
  • extension-analyze — Security audit for both extension and backend

Comments

Markdown supported