|
| 1 | + |
| 2 | +## Advance Blogging app |
| 3 | +Same as the first assignment, but you need to support `tags` for every blog post as well |
| 4 | + |
| 5 | +### User Management Endpoints: |
| 6 | + - POST /users/signup - User registration. |
| 7 | +Inputs: username, email, password |
| 8 | +Actions: Create a new user account. Perform validations and return a success message or error messages (e.g., email already in use, password requirements not met). |
| 9 | + |
| 10 | + - POST /users/signin - User login. |
| 11 | +Inputs: email, password |
| 12 | +Actions: Authenticate the user. Return a token (JWT) for authorization in subsequent requests if successful, or an error message if authentication fails. |
| 13 | +Blog Platform Endpoints: |
| 14 | + |
| 15 | + - GET /posts - Retrieve all blog posts. |
| 16 | +Actions: Fetch a list of all blog posts. Can be public or user-specific based on authentication. |
| 17 | + |
| 18 | + - POST /posts - Create a new blog post. |
| 19 | +Inputs: title, body, tags (array of string) |
| 20 | +Actions: Create a new blog post associated with the authenticated user. Require authentication. |
| 21 | + |
| 22 | + - GET /posts/:id - Retrieve a single blog post by ID. |
| 23 | +Actions: Fetch details of a specific blog post. Can be public or have additional details/edit capabilities for the owner. |
| 24 | + |
| 25 | + - PUT /posts/:id - Update a blog post by ID. |
| 26 | +Inputs: title, body, tags (array of string) |
| 27 | +Actions: Update the specified blog post if the authenticated user is the owner. Require authentication. |
| 28 | + |
| 29 | + - DELETE /posts/:id - Delete a blog post by ID. |
| 30 | +Actions: Delete the specified blog post if the authenticated user is the owner. Require authentication. |
| 31 | + |
| 32 | +## Database |
| 33 | +Try using `prisma` as the ORM and Postgres as the provider. You will have to use `relationships` between the `tags` and the `blogs` table. |
| 34 | + |
| 35 | +## Assumption |
| 36 | +You can assume that you only support 10 tags that the user can choose from. User doesn't need to have the ability to add more tags (even better if you implement that) |
0 commit comments