Phase: Submission
Registration Deadline: November 30, 2024
Submission Deadline: December 7, 2024
1 Place
2 Place
3 Place
Code-quests is a platform that helps businesses publish projects (called Quests) and ask a community of developers and designers to compete to build the best, highest-quality implementation or design.
In this quest, the goal is to build a high-quality RESTful APIs and make background Task that powers part of this platform.
The features we aim to develop will focus on a user points system and badges. The system should enable users to earn points and acquire badges, each associated with specific rewards. Additionally, we will implement a nightly task using node-cron to ensure accurate point calculations for users based on predefined rules and to update the leaderboard accordingly.
Requirements
Use TypeScript, Node.js LTS, Feathers.js
Automatically generated OpenApiSpec (OAS) must be generated automatically, using feathers-swagger or any other alternative. Note that Models Schema can be automatically generated using sequalize-to-json
PostgreSQL Database, with Code first migrations (database generated from code)
Follows 12-Factor App principles, including accepting configurations using Environment Variables, including DB connection string.
We will share with you the repo so you can download the project and follow the provided instructions for installation.
REST API Resources
The following resources will need to be implemented as REST APIs with standard CRUD operations (feathers.js defines resources as services with find, list, get, edit, update, delete)
You can view the details of the database models that need to be created at this link.
Tasks
Create Models for the User Points System and Badges
Create REST APIs Based on the Models
Allow users to view their badges.
Allow users to see their points and rank.
Provide users with information about their next badge.
Allow users to assign their next badge.
Enable admins to add, update, or delete badges and rewards.
Create a Leaderboard System
Display a system leaderboard showing all users along with their ranks and points.
Implement a Nightly Task using Node-Cron that ensures accurate point calculations for users based on predefined rules and update the leaderboard accordingly. The process involves the following steps:
Check Last Run Time: Verify the last execution time to prevent duplicate runs on the same day.
Fetch Data: Retrieve all user accounts and their associated point rules from the database.
Calculate Points: Compute points for each user based on the predefined rules.
Update Leaderboard: Refresh the leaderboard with the newly calculated points for each user.
Log Execution Time: Record the current time as the last run time in the database after completing the calculations and updates.
Acceptance Criteria
Please read the Backend Scorecard to see how the winners will be selected, and how we evaluate the best code submission.
Minimum acceptable score is 80 (80% of 100). First, Second, Third place will be the highest score above 80.
If two submissions earn the same score, the first submission will get the highest place.