diff --git a/solutions/task-template-submission.md b/solutions/task-template-submission.md new file mode 100644 index 0000000..675c69a --- /dev/null +++ b/solutions/task-template-submission.md @@ -0,0 +1,5 @@ +# Node.js Simple API Submission + +## Submission Link + +Name - Link to Github repo / article diff --git a/task-challenges/task-template.md b/task-challenges/task-template.md new file mode 100644 index 0000000..46088f8 --- /dev/null +++ b/task-challenges/task-template.md @@ -0,0 +1,99 @@ +# Backend API Challenge: Node.js Simple API + +**Creator :** XYZ + +## Prerequisites + +- Basic JavaScript and Node.js +- Express.js +- MongoDB (or any other database of your choice) +- Basic knowledge of RESTful API principles + +## The Tech + +- Node.js +- Express.js (for creating the API) +- MongoDB (for storing data; you can use Mongoose for easier interaction) +- Postman or any other API testing tool + +## The Challenge + +Create a simple backend API to manage a collection of resources (e.g., articles, tasks, or any other entity). This challenge will help to understand your thinking process and judge your skill level. + +### For Beginner Level + +#### CRUD Operations on a Simple Resource (e.g., Articles, Tasks) + +**Create Resource:** Add a new resource. +**Get All Resources:** Retrieve all resources. +**Get Resource by ID:** Retrieve a specific resource by its ID. +**Update Resource:** Update a specific resource. +**Delete Resource:** Delete a specific resource. + +#### Bonus Points + +**Search Functionality:** Implement a search endpoint to find resources by title or content. + +### For Intermediate Level + +#### CRUD Operations on a Simple Resource (e.g., Articles, Tasks) + +**Create Resource:** Add a new resource. +**Get All Resources:** Retrieve all resources. +**Get Resource by ID:** Retrieve a specific resource by its ID. +**Update Resource:** Update a specific resource. +**Delete Resource:** Delete a specific resource. + +#### User Authentication + +**Sign Up:** Create a new user account. +**Login:** Authenticate a user and return a token. +**Logout:** Log out a user (invalidate the token). + +#### Bonus Points + +**Get User Profile:** Retrieve the authenticated user's profile +**Search Functionality:** Implement a search endpoint to find resources by title or content. + +### For Advanced Level + +#### CRUD Operations on a Simple Resource (e.g., Articles, Tasks) + +**Create Resource:** Add a new resource. +**Get All Resources:** Retrieve all resources. +**Get Resource by ID:** Retrieve a specific resource by its ID. +**Update Resource:** Update a specific resource. +**Delete Resource:** Delete a specific resource. + +#### User Authentication + +**Sign Up:** Create a new user account. +**Login:** Authenticate a user and return a token. +**Logout:** Log out a user (invalidate the token). + +#### Bonus Points + +**Get User Profile:** Retrieve the authenticated user's profile. +**Token Refresh:** Implement a token refresh mechanism to allow users to obtain a new token without re-authenticating. +**Password Reset:** Implement a password reset functionality. +**Search Functionality:** Implement a search endpoint to find resources by title or content. + +## Deadline + +- Its optional and its decided by the author. +- If timeline is given, please specify the time required for peer review. + +## Deliverables (Optional) + +- Deploy the API on a platform like [Render](https://render.com/), [Railway](https://railway.app/), or any other cloud service. +- Submit the code in a GitHub repository. +- Create a `README` in solutions directory with the name `task-template-solution.md`, so the person doing the challenge can post their name with link to their solution. We will take input from the repo for peer review and final submission. + +### Code Submission + + [Backend API submission readme](../solutions/task-template-submission.md) + +## Going Further + +- **Authentication:** Learn about token-based authentication (e.g., JWT). +- **Testing:** Learn about testing your API using tools like Mocha, Chai, or Jest