machichdigital

IDE-Tools · Foto: Homedust, CC BY 2.0

RegelCursor RulesLizenz: CC0 1.0frei kopierbar

Node.js Mongodb Jwt Express React Cursorrules Promp

Zuletzt aktualisiert:

⬇ Als Datei laden

⧉ –× kopiert⬇ –× heruntergeladenBewertung:

Typ

Regel

Lizenz

CC0 1.0

Anwendungsfeld

Cursor Rules

Voraussetzungen

Keine besonderen — direkt loslegen.

Cursor-Regel für den kompletten MERN-Stack (MongoDB, Express, React, Node) inklusive JWT-Auth.

Original-Beschreibung der Autoren: Cursor rules for Node.js development with MongoDB, JWT, Express, and React integration.

Die Regel

---
description: "Cursor rules for Node.js development with MongoDB, JWT, Express, and React integration."
globs: **/*
alwaysApply: false
---
Tech Stack:

Backend: Node.js with Express.js  
Database: MongoDB with Mongoose ODM  
Frontend: React.js (for admin panel, if required)  
Authentication: JSON Web Tokens (JWT)  
Version Control: Git  
Deployment: Docker (optional)  

Precision in User Requirements:

Strictly adhere to specified user flow and game rules.  

Strategy: 

Summarize the pick submission process and outline the API endpoint and business logic in pseudocode before coding.  

Strategic Planning with Pseudocode:

Begin each feature with detailed pseudocode.  
Example: Provide pseudocode for the weekly scoring process, detailing steps from game result input to entry status updates.  

Code Quality:

Ensure secure, efficient code following RESTful API best practices.  
Implement proper error handling and input validation.  

User Flow:

Users browse available Pools  
Submit up to 3 Requests per Pool  
Complete payment for Requests  
Admin approves/rejects Requests  
Approved Requests become Entries  

Entry Management:

Each user can have up to 3 Entries per Pool  
Entries are numbered 1, 2, 3  
Picks are made and tracked separately for each Entry  

Pick Management:

Users make Picks for each Entry separately  
Picks can be updated until deadline (game start or 1PM Sunday of the current week of the pick)  

Scoring and Ranking:

Picks scored after games complete  
Win: Entry moves to next week  
Loss: Entry eliminated from Pool  
Each Entry ranked separately in Pool standings  

Results and Standings:

Users view Picks/scores for each Entry separately  
Pool standings show all Entries (multiple per User possible)  
Pool members can view all Picks after scoring  

Key Implementation Points:

Limit Requests to 3 per User per Pool  
Track Requests and Entries separately (numbered 1, 2, 3)  
Implement payment status tracking in Request model  
Create Entry only after admin approval and payment completion  
Admin interface for managing and approving Requests  
Implement state transitions (Request: pending -> approved -> Entry created)

So nutzt du sie

Die Regel kopieren (Button oben) oder als Datei herunterladen und im Projekt unter .cursor/rules/ ablegen — Cursor lädt sie beim nächsten Start automatisch. Ältere Cursor-Versionen lesen alternativ eine einzelne .cursorrules-Datei im Projektstamm; dort einfach den Regel-Text ohne den Kopfblock zwischen den ----Zeilen einfügen.

Der Regel-Text ist englisch — Cursor versteht ihn unabhängig von der Sprache, in der Sie mit dem Editor chatten.

Im Detail

Deckt den kompletten MERN-Stack ab: MongoDB als Datenbank, Express als Backend-Framework, React als Frontend und Node.js als Laufzeitumgebung, ergänzt um JWT-basierte Authentifizierung. Damit ist sie deutlich umfangreicher als die reinen Node-Express- oder MongoDB-Tutorial-Regeln, da sie zusätzlich Frontend-Backend-Kommunikation, Token-Handling und geschützte Routen auf beiden Seiten abdeckt. Passend für Projekte, die eine klassische Full-Stack-Anwendung mit eigenem Login-System bauen wollen, statt auf einen Auth-Anbieter wie Supabase zu setzen. Der Umfang macht sie weniger geeignet für kleine Backend-only-Projekte, dort reicht die schlankere Express-Regel.

Praxis-Tipp

Nutzen Sie sie für Prompts wie „Implementiere Login mit JWT, das im React-Frontend gespeichert und bei jeder API-Anfrage im Authorization-Header mitgeschickt wird“ — die Regel deckt beide Seiten der Auth-Kette ab.

Lizenz & Quelle

Inhalt ansehen (nodejs-mongodb-jwt-express-react-cursorrules-promp.mdc)
Lade …

Erfahrungen & Kommentare.

Funktioniert der Regel bei Ihnen? Tipps, Stolperfallen, Varianten — teilen Sie es mit der Community.

Lade Kommentare …

Ihre IP-Adresse wird zum Schutz vor Missbrauch gespeichert und nach 14 Tagen automatisch entfernt (Datenschutz).

Passt dazu.