convert the prompt template i will give you to comply to my project. i need a template where i can put in my implementation user story plan. that is also added as example. i want you te leave that space open as placeholder.
// template
🧠Smart Dev Task:
1️⃣Fix program🔧, provide bug-free🐞, well-commented code📝.
4️⃣No placeholders❌, start with "entrypoint" file📚. Check code compatibility🧩, file naming🔤. Include module/package dependencies🔗.
5️⃣For Python🐍, NodeJS🌐, create appropriate dependency files📜. Comment on function definitions📖 and complex logic🧮.
6️⃣Use pytest, dataclasses for Python🔧.
🔍Review Task:
1️⃣Summarize unclear areas in instructions📄, ask clarification questions❓.
2️⃣As a Google engineer👷♂️, review a feature specification📝. Check for potential flaws💥, missing elements🔍, simplifications🧹. Make educated assumptions🎓.
📚Spec Creation Task:
1️⃣Create a detailed program specification📘. Include features, classes, functions, methods🔡, brief comments🖊️.
2️⃣Output file📂 content, follow markdown code block📑, ensure full functionality🔨.
// # Implementation Plan for **User Story 2.1: Create a New Game Session
Implementation Plan for User Story 2.1: Create a New Game Session
Based on the current progress and the existing Product Backlog, the following step-by-step plan outlines the implementation of User Story 2.1: Create a New Game Session. This plan ensures adherence to the Architecture Overview and Coding Standards provided in the documentation.
1. Review and Understand the User Story
a. Analyze Requirements
Description: As a user, I want to create a new game session so that I can gather players and start playing.
Definition of Done:
Frontend:
Develop CreateGame.tsx with game parameter options.
Implement form validation for required settings.
Add submission button to create the game.
Backend:
Create a Firebase Cloud Function to initialize a new game in Firestore.
Assistant
Generate a unique game code or link.
Assign the creator to a team and set as the initial Round Host.
Testing:
Write unit tests for form validation.
Develop integration tests for game creation and Firestore initialization.
Documentation:
Document steps to create a new game session.
Acceptance Criteria:
Users can specify game settings and create a session.
A unique game code/link is generated and shown to the creator.
The creator is assigned to a team and designated as the Round Host.
b. Identify Dependencies
Epic 1: User Onboarding is completed, enabling player name entry and participation in game sessions.
2. Frontend Implementation
a. Develop CreateGame.tsx Component
Design UI:
Game Parameters Options:
Number of Teams
Number of Players per Team
Number of Rounds
Any additional settings (e.g., Joker usage)
Form Elements:
Input fields, dropdowns, sliders as needed.
Submit button labeled "Create Game".
Implement Form Validation:
Ensure all required fields are filled.
Validate input formats (e.g., positive integers for team numbers).
Provide user feedback for invalid inputs.
b. Ensure Responsiveness and Styling
Utilize Tailwind CSS and shadcn components for a consistent and responsive design.
Adhere to Coding Standards:
Use 2-space indentation.
Keep lines under 100 characters.
Single quotes for strings.
c. State Management and Integration
Manage form state using React Hook Form or similar library.
Handle form submission to trigger backend operations.
d. Implement Navigation
Ensure that after game creation, users are redirected to the Game Lobby or appropriate interface.
Use React Router for seamless navigation.
3. Backend Implementation
a. Develop Firebase Cloud Function: createGame
Function Responsibilities:
Initialize a new game document in Firestore with specified parameters.
Generate a unique game code or link.
Assign the creating user to a team.
Designate the user as the initial Round Host.
Ensure Security and Data Integrity:
Validate incoming data to prevent malformed entries.
Use Firestore Transactions or Batch Writes to ensure atomicity.
b. Generate Unique Game Code/Link
Approach:
Utilize UUIDs or a custom algorithm to create unique identifiers.
Ensure no collisions by checking Firestore for existing codes.
c. Assign Creator to Team and Round Host
Team Assignment:
Create a default team or assign to a newly created team based on game parameters.
Round Host Assignment:
Set the creator as the initial Round Host within the game document.
d. Integrate with Firestore
Structure Firestore documents according to the Database Models in architecture.md.
Ensure real-time capabilities are leveraged for immediate game setup visibility.
4. Testing
a. Unit Tests for Frontend Form Validation
Tools: Vitest with React Testing Library
Test Cases:
All required fields must be filled.
Valid input formats.
Error messages display for invalid inputs.
b. Integration Tests for Game Creation Workflow
Tools: Cypress
Test Scenarios:
Successful game creation with valid inputs.
Verification of Firestore document initialization.
Unique game code/link generation and display to the creator.
Assignment of creator to a team and as Round Host.
c. Backend Function Testing
Tools: Jest with Firebase Emulator Suite
Test Cases:
Correct initialization of game documents.
Unique game code generation without collisions.
Proper assignment of user to team and Round Host.
Handling of invalid or incomplete data inputs.
5. Documentation
a. Update User Guides
Location:docs/backlog.md and any relevant sections in docs/architecture.md
Content:
Step-by-step instructions on creating a new game session.
Description of game parameters and their effects.
Screenshots or UI mockups of the CreateGame.tsx component.
b. Code Documentation
Inline Comments:
Provide clear comments for complex logic within CreateGame.tsx and backend functions.
Function Documentation:
Use JSDoc annotations for the createGame Cloud Function detailing inputs, outputs, and functionality.
6. Code Review and Quality Assurance
a. Peer Code Review
Process:
Submit code via Pull Request (PR) adhering to the Gitflow branching strategy.
Ensure PR descriptions link to User Story 2.1 in backlog.md.
Address feedback related to Coding Standards, performance, and security.
b. Adhere to Coding Standards
Consistency:
Follow naming conventions (camelCase for variables and functions).
Maintain clean and readable code structure.
Best Practices:
DRY (Don’t Repeat Yourself) principle to avoid redundancy.
KISS (Keep It Simple, Stupid) for simplicity in implementation.
c. Automated Code Quality Checks
Tools:
Integrate ESLint and Prettier to enforce code formatting and linting rules.
Ensure CI pipeline runs linting and formatting checks on PRs.
7. Deployment
a. Staging Environment Deployment
Steps:
Merge approved PR into the develop branch.
Utilize GitHub Actions to trigger deployment scripts.
Deploy frontend to Firebase Hosting’s staging environment.
Deploy backend Cloud Functions to Firebase Emulator or a designated staging project.
b. Post-Deployment Testing
Verification:
Conduct end-to-end tests in the staging environment.
Ensure that game creation flows function as intended.
Validate real-time updates and Firestore document integrity.
c. Production Deployment
Steps:
After successful staging verification, merge changes into the main branch.
Trigger CI/CD pipeline for production deployment.
Monitor deployment logs for any issues.
d. Monitoring and Feedback
Tools:
Use Firebase Console to monitor Firestore and Cloud Function performance.
Set up alerts for failed deployments or critical errors.
8. Risk Management and Mitigation
a. Unique Code Collision
Mitigation:
Implement checks within the Cloud Function to verify the uniqueness of generated game codes.
Retry code generation upon collision detection.
b. Firestore Write Failures
Mitigation:
Use Firestore Transactions to ensure atomic writes.
Implement error handling to notify users of any failures during game creation.
c. Security Concerns
Mitigation:
Ensure Cloud Functions validate and sanitize all inputs.
Adhere to Firestore Security Rules to restrict unauthorized write operations.
9. Timeline and Milestones
Milestone
Estimated Duration
Dependencies
Frontend Component Development
2 Days
Completion of frontend setup
Backend Cloud Function Development
3 Days
Firebase project configuration
Unit and Integration Testing
2 Days
Completion of frontend and backend code
Documentation Update
1 Day
Completion of development and testing
Code Review and Feedback
1 Day
Submission of PR
Staging Deployment and Testing
2 Days
Successful code review and CI pipeline
Production Deployment
1 Day
Successful staging verification
Total Estimated Time:
12 Days
Note: Timeline estimates are approximate and may vary based on team size and resource availability.
By following this comprehensive implementation plan, the development team will successfully deliver the Create a New Game Session feature, establishing a solid foundation for subsequent functionalities in the Dance Floor Ranking game. This structured approach ensures quality, security, and adherence to established standards, facilitating a smooth development workflow and an optimal user experience.
// architecture plan
Dance Floor Ranking - Architecture Plan
1. Architecture Overview
The architecture for Dance Floor Ranking is divided into three main layers:
Frontend: Built with React, TypeScript, Vite, and shadcn with Tailwind CSS, providing a responsive and interactive user interface.
Backend: Utilizes Node.js with Firebase Cloud Functions to handle business logic and server-side operations.
Database and Real-time Services: Powered by Firebase Firestore (for scalable, real-time data storage) and Firebase Authentication (for secure user management).
Additionally, integration with the Spotify API enables seamless music playback and management.
2. Technology Stack
Preferred Technologies
Frontend:
Framework: React
Language: TypeScript
Build Tool: Vite
Styling: Tailwind CSS with shadcn components
Hosting: Firebase Hosting
Backend:
Runtime: Node.js
Serverless Functions: Firebase Cloud Functions
Database:
Primary Database: Firebase Firestore
Authentication:
Service: Firebase Authentication
Real-time Communication:
Service: Firebase Firestore (leveraging its real-time capabilities)
Music Streaming Integration:
API: Spotify Web API
Alternative Suggestions
While your preferred stack is well-suited for the project, consider the following enhancements to improve performance and scalability:
State Management: Use Redux Toolkit or React Context API for efficient state management.
UI Components: Utilize shadcn with Tailwind CSS for consistent and customizable UI components.
Form Handling: Utilize React Hook Form for efficient form management.
Authentication is currently not implemented. Players join the game by entering their names.
Implementation Steps
Player Registration
Simple name entry without authentication.
Profile creation and team association based on name.
Session Management
Use Firestore documents to manage player sessions.
4.5 Music Streaming Integration (Spotify Web API)
Features
Song Validation: Ensure contributed songs are available on Spotify.
Playback Integration: Play 30-second snippets of selected songs.
Metadata Retrieval: Fetch song details like title, album cover, and artist information.
Implementation Steps
Spotify Developer Account
Register the application to obtain Client ID and Client Secret.
OAuth Flow
Implement Authorization Code Flow to obtain user access tokens.
API Endpoints
Fetch Song Details: Retrieve song metadata for display.
Playback SDK: Integrate Spotify Web Playback SDK for embedded playback.
Handling Playback
Use embedded players or open Spotify in a new tab for playback.
Note: Due to Spotify's restrictions, fully embedded playback might have limitations. Consider alternative solutions if needed.
Considerations: Due to licensing and API restrictions, ensure compliance with Spotify's terms of service, especially regarding playback and content usage.
4.6 Deployment and Hosting
Frontend Hosting: Firebase Hosting: Deploy React app with Firebase's CDN for fast global delivery.
Backend Deployment: Firebase Cloud Functions: Serverless deployment for handling backend logic with autoscaling and reduced costs.
Continuous Integration/Continuous Deployment (CI/CD): GitHub Actions or Firebase Hosting's integration for automated deployments on code commits.
5. Data Flow & Game Mechanics
5.1 Game Initialization
Player Entry: Players enter their names to join the game.
Create/Join Game: Players create a new game session or join an existing one using a game code or link.
Team Formation: Assign players to teams, either automatically or manually based on names.
Assign Roles: Assign the initial Round Host.
5.2 Round Progression
Challenge Announcement
Round Host selects or creates a challenge.
Broadcast challenge to all teams via Firestore.
Song Selection
Game-Provided Songs: Retrieve predetermined songs from Firestore.
Team-Contributed Songs: Teams search and select songs via Spotify integration.
Validate song availability and store contributions.
Music Playback
Aggregate all selected songs.
Shuffle playback order.
Play 30-second snippets using Spotify Playback SDK or embedded players.
Voting and Ranking
Each team submits rankings excluding their own song.
Rankings are stored in Firestore under the current round's document.
Scoring
Backend processes rankings to allocate points.
Apply bonus points for high-ranking contributions.
Handle Joker token usage by doubling relevant points.
Update team scores in Firestore.
Real-time Score Update
Firestore listeners update all clients with the latest scores.
Role Rotation
Assign the next Round Host role to the following team.
Proceed to the next round or conclude the game if all rounds are completed.
5.3 Real-time Synchronization
Firestore Listeners: All clients listen to changes in game state, rounds, and scoring to ensure synchronized views.
Optimistic UI Updates: Frontend can optimistically update the UI for better responsiveness, reverting if backend validation fails.
6. Detailed Component Implementation
6.1 Frontend Components Breakdown
Player Entry Pages
NameEntry.tsx: User enters their name to join the game.
Validation for name input (e.g., required, character limits).
Game Lobby
CreateGame.tsx: Form to create a new game session.
JoinGame.tsx: Interface to join existing game sessions via code or link.
Team Management
TeamSetup.tsx: Assign players to teams, set team names.
InvitePlayers.tsx: Share game links or codes with other players.
Game Dashboard
ActiveGames.tsx: List of active games the user is part of.
GameRoom.tsx: Main game interface displaying current round, teams, and scores.
Admin Panel (Round Host)
ChallengeSelection.tsx: Interface for selecting or creating challenges.
ManageSongs.tsx: View and approve/reject song submissions.
FinalizeScores.tsx: Review and confirm scores after each round.
assignNextHost
Rotates the Round Host role to the next team.
handleJokerUsage
Validates and applies Joker token effects for a team.
fetchSpotifyToken
Handles Spotify OAuth token refresh if necessary.
6.2 Backend Functions Breakdown
createGame
Initializes a new game session in Firestore.
Assigns initial Round Host.
joinGame
Adds a user to an existing game session.
Validates game code or link.
submitSong
Validates and stores contributed songs.
Ensures song availability via Spotify API.
processRound
Aggregates votes and calculates scores.
Applies Joker multipliers.
Updates team scores in Firestore.
assignNextHost
Rotates the Round Host role to the next team.
handleJokerUsage
Validates and applies Joker token effects for a team.
fetchSpotifyToken
Handles Spotify OAuth token refresh if necessary.
6.3 Firestore Security Rules
Implement strict security rules to ensure data integrity and protect user information:
javascript
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Players can read/write their own profiles
match /players/{playerId} {
allow read, write: if request.resource.data.name is string;
}
// Games collection
match /games/{gameId} {
allow read: if true;
allow write: if false; // Writes handled via Cloud Functions
}
// Teams collection
match /teams/{teamId} {
allow read: if true;
allow write: if false;
}
// Rounds collection
match /rounds/{roundId} {
allow read: if true;
allow write: if request.auth.token.admin == true; // Or via Cloud Functions
}
// Songs collection
match /songs/{songId} {
allow read: if true;
allow write: if false;
}
// Auxiliary functions
function isPlayerInGame(gameId) {
return exists(/databases/$(database)/documents/games/$(gameId)) &&
get(/databases/$(database)/documents/games/$(gameId)).data.players.contains(request.resource.data.playerId);
}
function isPlayerInTeam(teamId) {
return exists(/databases/$(database)/documents/teams/$(teamId)) &&
get(/databases/$(database)/documents/teams/$(teamId)).data.members.contains(request.resource.data.playerId);
}
function getGameId(roundId) {
return get(/databases/$(database)/documents/rounds/$(roundId)).data.gameId;
}
function getGameIdFromSong(songId) {
return get(/databases/$(database)/documents/songs/$(songId)).data.gameId;
}
}
}
Note: Tailor the security rules based on your exact data structure and requirements. Always test security rules thoroughly.
7. Real-time Communication Strategy
7.1 Utilizing Firestore's Real-time Capabilities
Firestore offers real-time listeners that update the frontend instantly when data changes. This feature is ideal for:
Live Score Updates: As scores are calculated, teams see updates immediately.
Song Submissions: Teams see songs added in real-time.
Challenge Announcements: Instant propagation of new challenges to all players.
7.2 Implementing Firestore Listeners
In your React components, utilize useEffect hooks to subscribe to Firestore documents or collections relevant to the current game state. For example:
Use Firestore's atomic operations and transactions to manage concurrent updates:
Transactions: Ensure that score calculations and updates are performed atomically.
Optimistic Updates: Frontend can optimistically update the UI for better responsiveness, reverting if backend validation fails.
8. Integration with Spotify Web API
8.1 Spotify API Setup
Register the Application
Create a Spotify Developer account.
Register your application to obtain Client ID and Client Secret.
Set up Redirect URIs for OAuth flows.
Implement OAuth 2.0
Use Authorization Code Flow for secure token exchange.
Store access and refresh tokens securely, possibly in Firestore or Firebase Functions' environment variables.
8.2 Fetching and Validating Songs
Search Endpoint: Use Spotify's Search API to verify song availability and fetch metadata.
Playlist Management (Optional): Create temporary playlists for game-provided songs if needed.
8.3 Playback Integration
Spotify Playback SDK: Embed the Spotify player to play 30-second snippets.
Limitations: Requires users to have Spotify Premium accounts.
Alternative: Use embedded Spotify Play Buttons or redirect to the Spotify app/browser for playback.
Considerations: Due to Spotify's restrictions, ensure compliance with their terms of service, especially regarding playback and content usage.
9. Cost Optimization Strategies
9.1 Firebase Free Tier Utilization
Leverage Firebase's generous free tier to minimize initial costs:
Authentication: Deprecated, as authentication is removed for now.
Firestore: Ample daily reads/writes for low-traffic scenarios.
Cloud Functions: Sufficient execution time and invocations for initial usage.
Hosting: Free SSL, CDN, and ample hosting bandwidth.
9.2 Efficient Data Structuring
Minimize Reads/Writes: Structure data to reduce the number of Firestore operations.
Batch Operations: Use batch writes where possible to lower costs.
Data Caching: Implement client-side caching to avoid unnecessary reads.
9.3 Optimize Cloud Functions
Function Invocation: Only invoke functions when necessary.
Execution Time: Optimize code to reduce execution durations.
Cold Starts: Keep functions warm by deploying in multiple regions if needed, although this might slightly increase costs.
9.4 Monitoring and Scaling
Firebase Console Monitoring: Keep track of usage metrics to anticipate scaling needs.
Budget Alerts: Set up billing alerts to notify when nearing budget limits.
9.5 Alternative Services (If Needed)
Hosting Alternatives: If exceeding Firebase Hosting limits, consider platforms like Vercel or Netlify.
Database Alternatives: For high read/write operations, consider integrating with Supabase or MongoDB Atlas for better scalability and pricing.
9.6 Testing Tools Integration
Vitest: Integrate Vitest for unit and integration testing in the frontend and backend.
Cypress: Use Cypress for end-to-end testing to ensure user flows work seamlessly without authentication.
10. Security Considerations
10.1 Data Protection
Secure Data Handling: Ensure player names are stored securely in Firestore.
Firestore Security Rules: Define rules to protect game data while allowing read/write operations without authentication.
Sensitive Data Handling: Avoid storing any sensitive information on the frontend.
10.2 User Permissions
As authentication is currently not implemented, ensure that Firestore security rules prevent unauthorized modifications by restricting write permissions to trusted sources, such as Cloud Functions.
10.3 Firestore Security Rules
Implement strict security rules to ensure data integrity and protect user information:
javascript
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Players can read/write their own profiles
match /players/{playerId} {
allow read, write: if request.resource.data.name is string;
}
// Games collection
match /games/{gameId} {
allow read: if true;
allow write: if false; // Writes handled via Cloud Functions
}
// Teams collection
match /teams/{teamId} {
allow read: if true;
allow write: if false;
}
// Rounds collection
match /rounds/{roundId} {
allow read: if true;
allow write: if request.auth.token.admin == true; // Or via Cloud Functions
}
// Songs collection
match /songs/{songId} {
allow read: if true;
allow write: if false;
}
// Auxiliary functions
function isPlayerInGame(gameId) {
return exists(/databases/$(database)/documents/games/$(gameId)) &&
get(/databases/$(database)/documents/games/$(gameId)).data.players.contains(request.resource.data.playerId);
}
function isPlayerInTeam(teamId) {
return exists(/databases/$(database)/documents/teams/$(teamId)) &&
get(/databases/$(database)/documents/teams/$(teamId)).data.members.contains(request.resource.data.playerId);
}
function getGameId(roundId) {
return get(/databases/$(database)/documents/rounds/$(roundId)).data.gameId;
}
function getGameIdFromSong(songId) {
return get(/databases/$(database)/documents/songs/$(songId)).data.gameId;
}
}
}
Note: Tailor the security rules based on your exact data structure and requirements. Always test security rules thoroughly.
11. Continuous Integration and Deployment
11.1 Testing Pipeline
Vitest: Configure Vitest for running unit and integration tests.
Cypress: Set up Cypress for end-to-end testing of user flows without authentication.
11.2 CI/CD Pipeline
GitHub Actions: Configure GitHub Actions to run Vitest and Cypress tests on every push and pull request.
Deployment Steps: Automate deployments to Firebase Hosting and Cloud Functions upon successful test runs.
11.3 Environment Management
Environment Variables: Manage environment configurations using .env files, ensuring no sensitive data is exposed.
12. Scalability and Performance
12.1 Frontend Optimization
Code Splitting: Use dynamic imports to load components as needed, reducing initial load times.
Lazy Loading: Implement lazy loading for images and heavy components.
Caching: Utilize service workers for caching static assets.
12.2 Backend Scaling
Serverless Benefits: Firebase Cloud Functions automatically scale with demand, ensuring performance during high-traffic periods.
Efficient Code: Optimize backend code to reduce execution times and resource consumption.
12.3 Database Scaling
Firestore Sharding: Structure data to avoid contention on single documents, enabling better scaling.
Indexing: Properly index Firestore collections to speed up query performance.
12.4 Real-time Performance
Data Minimization: Send only necessary data updates to clients.
Listener Optimization: Limit the number of real-time listeners to essential components only.
13. Development and Deployment Workflow
13.1 Version Control
Git: Use Git for source code management.
Branching Strategy: Implement a branching strategy like Gitflow for organized development.
Advertisements: Integrate non-intrusive ads to generate revenue while keeping the game free to play.
15. Implementation Roadmap
Phase 1: Planning and Setup
Finalize requirements and specifications.
Set up Firebase project and configure services (Firestore, Authentication, Hosting).
Register and set up Spotify Developer account.
Phase 2: Frontend Development
Develop player entry flows with name input instead of authentication.
Create game lobby and team management interfaces based on player names.
Implement real-time game dashboard with Firestore listeners.
Integrate Spotify Web API for song selection and playback.
Set up Vite for project scaffolding and development.
Implement shadcn components with Tailwind CSS for styling.
Phase 3: Backend and Cloud Functions
Develop Cloud Functions for game initialization, round management, and scoring.
Implement secure interactions between frontend and backend without authentication.
Integrate Spotify API within backend functions for song validation.
Phase 4: Testing
Conduct unit and integration testing using Vitest for frontend and backend.
Perform end-to-end testing using Cypress with a focus on user flows without authentication.
Optimize performance based on testing feedback.
Phase 5: Deployment
Deploy frontend using Firebase Hosting.
Deploy Cloud Functions and ensure they are correctly linked with Firestore.
Monitor deployments and perform post-deployment testing.
Phase 6: Launch and Iterate
Launch the game for a broader audience.
Collect user feedback and monitor performance.
Iterate on features and optimize based on real-world usage.
16. Conclusion
The proposed architecture leverages modern, scalable technologies to deliver a responsive and engaging Dance Floor Ranking game. By utilizing React, TypeScript, Vite, shadcn with Tailwind CSS, Node.js, and Firebase's suite of services, the platform ensures real-time interactivity, efficient state management, and secure operations while maintaining low initial costs. Integration with the Spotify Web API enriches the user experience through seamless music playback and management.
By following this architecture plan, you can develop a robust, scalable, and enjoyable game that fosters team collaboration, creativity, and fun. Future enhancements and optimizations can further elevate the game's functionality and user engagement, ensuring longevity and success in the competitive gaming landscape.
Appendices
A. Sample Challenges List
Best Song for a Road Trip
Song That Always Gets You on the Dance Floor
Most Inspiring Anthem
Classic Throwback Hit
Perfect Song for a Chill Evening
Song That Reminds You of Summer
Ultimate Karaoke Song
Best Song to Work Out To
Song with the Best Lyrics
Underrated Gem Everyone Should Know
B. Game-Provided Songs Library
(Prepare a list of songs suitable for various challenges, ensuring diversity in genre and era.)
C. Role of the Round Host
Ensure smooth progression of the round.
Manage time effectively.
Be impartial and fair in handling submissions and scoring.
Final Notes
Dance Floor Ranking is designed to create a lively and inclusive atmosphere where participants can share their love for music while engaging in friendly competition. The game's structure allows for flexibility and can be adapted to suit different group sizes and preferences. By incorporating elements like team-contributed songs, Jokers, and rotating roles, the game encourages strategic thinking, creativity, and active participation from all players.
code
// Adjusted Template for Dance Floor Ranking Project
🧠 **Smart Dev Task**:
1️⃣ **Implement the User Story**: Based on the provided implementation plan, develop the required features in alignment with the project's architecture and coding standards.
2️⃣ **Write Clean, Well-Commented Code**: Ensure the code is bug-free 🐞 and includes clear comments 📝 explaining complex logic.
3️⃣ **Follow Project's Coding Standards**:
- Use 2-space indentation.
- Keep lines under 100 characters.
- Use single quotes `' '` for strings.
- Adhere to naming conventions (`camelCase` for variables and functions).
- Maintain clean and readable code structure.
4️⃣ **Output Each File's Content**: Provide the content of each file created or modified 📂, following the markdown code block format 📑:
FILENAME
LANGUAGE
// Code goes here
code
5️⃣ **No Placeholders**: Provide the actual implementation code needed, starting from the entry point file 📚 if applicable. Ensure all code is complete and functional.
6️⃣ **Include Dependencies and Modules**:
- For **Frontend Components**:
- Include necessary imports.
- Integrate with state management, routing, and styling as per project standards.
- For **Backend Functions**:
- Ensure all dependencies are included.
- Use appropriate Firebase Cloud Functions practices.
7️⃣ **Testing**:
- Write **unit tests** and **integration tests** using the project's testing frameworks (e.g., Vitest, React Testing Library, Jest, Cypress).
- Comment on test cases to explain their purpose.
8️⃣ **Adhere to Architecture Plan**:
- Implement features according to the project's **Architecture Overview** and **Data Models**.
- Ensure consistency with existing components and modules.
🔍 **Review Task**:
1️⃣ **Identify Unclear Areas**: Summarize any areas in the instructions that are not clear, and ask for clarifications if necessary.
2️⃣ **Review the Implementation Plan**: As a skilled engineer 👷♂️, review the provided implementation plan for potential flaws 💥, missing elements 🔍, or simplifications 🧹. Make educated assumptions 🎓 if needed.
📚 **Spec Creation Task**:
1️⃣ **Create a Detailed Program Specification**:
- Outline the features, classes, functions, and methods to be implemented 🔡.
- Provide brief comments 🖊️ explaining their purposes.
- Reference the **Architecture Plan** and **Coding Standards**.
2️⃣ **Provide Code Structure**:
- Output the code structure 📂, following the markdown code block format 📑, ensuring full functionality 🔨.
- Include necessary imports, exports, and dependency declarations.
---
**[Insert Implementation Plan Here]**
By using this adjusted template, you can insert your specific implementation plans into the placeholder provided. The template ensures that all code written aligns with your project's architecture and coding standards, and provides clear guidance on how to structure and present the code and associated documentation.
Feel free to customize the template further to match any additional project requirements or preferences.