Skip to content

Commit 364f8fc

Browse files
harkirat singhharkirat singh
harkirat singh
authored and
harkirat singh
committedFeb 13, 2024
Week 11
1 parent 2f0644e commit 364f8fc

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
 

‎week-11/worker-app-1/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
## Simple Cloudflare app
3+
The goal is to build the backend of a `Blogging Platform`.
4+
It NEEDS to work in a serverless environment (preferably use cloudflare workers)
5+
6+
### User Management Endpoints:
7+
- POST /users/signup - User registration.
8+
Inputs: username, email, password
9+
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).
10+
11+
- POST /users/signin - User login.
12+
Inputs: email, password
13+
Actions: Authenticate the user. Return a token (JWT) for authorization in subsequent requests if successful, or an error message if authentication fails.
14+
Blog Platform Endpoints:
15+
16+
- GET /posts - Retrieve all blog posts.
17+
Actions: Fetch a list of all blog posts. Can be public or user-specific based on authentication.
18+
19+
- POST /posts - Create a new blog post.
20+
Inputs: title, body
21+
Actions: Create a new blog post associated with the authenticated user. Require authentication.
22+
23+
- GET /posts/:id - Retrieve a single blog post by ID.
24+
Actions: Fetch details of a specific blog post. Can be public or have additional details/edit capabilities for the owner.
25+
26+
- PUT /posts/:id - Update a blog post by ID.
27+
Inputs: title, body
28+
Actions: Update the specified blog post if the authenticated user is the owner. Require authentication.
29+
30+
- DELETE /posts/:id - Delete a blog post by ID.
31+
Actions: Delete the specified blog post if the authenticated user is the owner. Require authentication.
32+
33+
## Database
34+
Try using `prisma` as the ORM and Postgres as the provider.

‎week-11/worker-app-2/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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

Comments
 (0)
Please sign in to comment.