|
| 1 | +# Backend API Challenge: Node.js Simple API |
| 2 | + |
| 3 | +**Creator :** XYZ |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Basic JavaScript and Node.js |
| 8 | +- Express.js |
| 9 | +- MongoDB (or any other database of your choice) |
| 10 | +- Basic knowledge of RESTful API principles |
| 11 | + |
| 12 | +## The Tech |
| 13 | + |
| 14 | +- Node.js |
| 15 | +- Express.js (for creating the API) |
| 16 | +- MongoDB (for storing data; you can use Mongoose for easier interaction) |
| 17 | +- Postman or any other API testing tool |
| 18 | + |
| 19 | +## The Challenge |
| 20 | + |
| 21 | +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. |
| 22 | + |
| 23 | +### For Beginner Level |
| 24 | + |
| 25 | +#### CRUD Operations on a Simple Resource (e.g., Articles, Tasks) |
| 26 | + |
| 27 | +**Create Resource:** Add a new resource. |
| 28 | +**Get All Resources:** Retrieve all resources. |
| 29 | +**Get Resource by ID:** Retrieve a specific resource by its ID. |
| 30 | +**Update Resource:** Update a specific resource. |
| 31 | +**Delete Resource:** Delete a specific resource. |
| 32 | + |
| 33 | +#### Bonus Points |
| 34 | + |
| 35 | +**Search Functionality:** Implement a search endpoint to find resources by title or content. |
| 36 | + |
| 37 | +### For Intermediate Level |
| 38 | + |
| 39 | +#### CRUD Operations on a Simple Resource (e.g., Articles, Tasks) |
| 40 | + |
| 41 | +**Create Resource:** Add a new resource. |
| 42 | +**Get All Resources:** Retrieve all resources. |
| 43 | +**Get Resource by ID:** Retrieve a specific resource by its ID. |
| 44 | +**Update Resource:** Update a specific resource. |
| 45 | +**Delete Resource:** Delete a specific resource. |
| 46 | + |
| 47 | +#### User Authentication |
| 48 | + |
| 49 | +**Sign Up:** Create a new user account. |
| 50 | +**Login:** Authenticate a user and return a token. |
| 51 | +**Logout:** Log out a user (invalidate the token). |
| 52 | + |
| 53 | +#### Bonus Points |
| 54 | + |
| 55 | +**Get User Profile:** Retrieve the authenticated user's profile |
| 56 | +**Search Functionality:** Implement a search endpoint to find resources by title or content. |
| 57 | + |
| 58 | +### For Advanced Level |
| 59 | + |
| 60 | +#### CRUD Operations on a Simple Resource (e.g., Articles, Tasks) |
| 61 | + |
| 62 | +**Create Resource:** Add a new resource. |
| 63 | +**Get All Resources:** Retrieve all resources. |
| 64 | +**Get Resource by ID:** Retrieve a specific resource by its ID. |
| 65 | +**Update Resource:** Update a specific resource. |
| 66 | +**Delete Resource:** Delete a specific resource. |
| 67 | + |
| 68 | +#### User Authentication |
| 69 | + |
| 70 | +**Sign Up:** Create a new user account. |
| 71 | +**Login:** Authenticate a user and return a token. |
| 72 | +**Logout:** Log out a user (invalidate the token). |
| 73 | + |
| 74 | +#### Bonus Points |
| 75 | + |
| 76 | +**Get User Profile:** Retrieve the authenticated user's profile. |
| 77 | +**Token Refresh:** Implement a token refresh mechanism to allow users to obtain a new token without re-authenticating. |
| 78 | +**Password Reset:** Implement a password reset functionality. |
| 79 | +**Search Functionality:** Implement a search endpoint to find resources by title or content. |
| 80 | + |
| 81 | +## Deadline |
| 82 | + |
| 83 | +- Its optional and its decided by the author. |
| 84 | +- If timeline is given, please specify the time required for peer review. |
| 85 | + |
| 86 | +## Deliverables (Optional) |
| 87 | + |
| 88 | +- Deploy the API on a platform like [Render](https://render.com/), [Railway](https://railway.app/), or any other cloud service. |
| 89 | +- Submit the code in a GitHub repository. |
| 90 | +- 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. |
| 91 | + |
| 92 | +### Code Submission |
| 93 | + |
| 94 | + [Backend API submission readme](../solutions/task-template-submission.md) |
| 95 | + |
| 96 | +## Going Further |
| 97 | + |
| 98 | +- **Authentication:** Learn about token-based authentication (e.g., JWT). |
| 99 | +- **Testing:** Learn about testing your API using tools like Mocha, Chai, or Jest |
0 commit comments