Node.js MongoDB JWT Express React .cursorrules prompt file
Author: allxdamnxday
What you can build
Pool Management Platform: A web application that allows users to browse available pools, submit requests, and manage entries. It includes an admin panel for managing pool requests, payments, and entries. The platform would ensure users can view pool standings and track their picks per entry.Pick-and-Pay System: An online service that enables users to submit requests for pools and securely complete payments. The system would track each request's payment status and transition to entry creation upon admin approval.Request Approval Dashboard: An admin-focused dashboard that provides tools to review, approve, or reject user requests for pool entries. It integrates status tracking for both payments and request progression from pending to approved.Entry and Scoring System: A backend solution that handles entry creation post-approval, manages user picks for each entry, and automates scoring after games conclude to update standings and eliminate lower-ranked entries.User Standings Display: A service that presents detailed pool standings, showing the rankings of all user entries, and allows users to view both their picks and scores once games are scored.Request and Entry Limitation Module: A backend feature that enforces limits on requests and entries per user in each pool, ensuring compliance with the system's rules about the number of requests and entries allowed.Pick Deadline Management Tool: A system that allows users to make or update picks up until a set deadline, such as game start times or a specific weekly cut-off, ensuring fair play and timely submissions.Pseudocode Strategy Planner: A planning aid tool that helps developers outline the API endpoints and business logic in pseudocode before implementation, enhancing strategic planning and ensuring development aligns with user requirements.Payment Status Integration: A feature within the Request model that tracks and updates the payment status, ensuring that entries are created only after both payment completion and admin approval.Secure Authentication Service: A JWT-based authentication system that ensures secure access control for users and admins, protecting sensitive data such as user requests and pool data.
Benefits
Synopsis
Developers could use this prompt to build a pool-based game application with user submissions, payment processing, and admin approval workflows, leveraging Node.js, MongoDB, and React.js for efficient user and entry management.
Overview of .cursorrules prompt
The .cursorrules file provides a comprehensive blueprint for a software project involving a backend integrated with Node.js and Express.js, and a frontend potentially using React.js. It utilizes MongoDB with Mongoose for database management and employs JSON Web Tokens for authentication. Git is suggested for version control, with Docker being optional for deployment. The file emphasizes precision in user requirements, especially adhering to game rules and user flow, and recommends starting feature implementation with detailed pseudocode. It outlines the user journey through the application, from browsing pools to submitting requests, handling payments, and managing entries. It describes a structured process for administering requests, creating entries, and managing picks, while maintaining code quality through secure and efficient practices. Lastly, it offers guidance on implementing state transitions and tracking elements such as requests, entries, and payment status.
.cursorrules Content
Tech Stack:Backend: Node.js with Express.jsDatabase: MongoDB with Mongoose ODMFrontend: React.js (for admin panel, if required)Authentication: JSON Web Tokens (JWT)Version Control: GitDeployment: 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 PoolsSubmit up to 3 Requests per PoolComplete payment for RequestsAdmin approves/rejects RequestsApproved Requests become EntriesEntry Management:Each user can have up to 3 Entries per PoolEntries are numbered 1, 2, 3Picks are made and tracked separately for each EntryPick Management:Users make Picks for each Entry separatelyPicks can be updated until deadline (game start or 1PM Sunday of the current week of the pick)Scoring and Ranking:Picks scored after games completeWin: Entry moves to next weekLoss: Entry eliminated from PoolEach Entry ranked separately in Pool standingsResults and Standings:Users view Picks/scores for each Entry separatelyPool standings show all Entries (multiple per User possible)Pool members can view all Picks after scoringKey Implementation Points:Limit Requests to 3 per User per PoolTrack Requests and Entries separately (numbered 1, 2, 3)Implement payment status tracking in Request modelCreate Entry only after admin approval and payment completionAdmin interface for managing and approving RequestsImplement state transitions (Request: pending -> approved -> Entry created)