Backend Task 2
Backend Task 2
1. Objective:
○ Build RESTful APIs for basic user authentication and a blog platform.
○ Implement JWT (JSON Web Token) for secure user sessions.
○ Document the APIs with comprehensive details, including routes, request and
response formats.
2. Key Functionalities:
○ Authentication APIs:
■ Signup: Endpoint for user registration. Users should provide basic
information such as username, email, password, and profile details (e.g., bio,
profile picture).
■ Login: Endpoint for logging in, returning a JWT token for session handling.
■ Logout: Invalidate or clear the JWT token, allowing for a secure logout
experience.
■ Profile: Fetch and update profile information using the JWT token for
authenticated access.
○ Blog CRUD Operations:
■ Create Post: Allow authenticated users to create posts. Fields required:
■ Title: Short title of the post.
■ Image: Optional image upload functionality for the post.
■ Description: Main content of the post.
■ Date and Time of Post: Automatically capture the date and time.
■ Tags: Add optional tags for categorizing posts.
■ Read Posts: Fetch individual or multiple posts, can implement search
filter(optional).
■ Update Post: Allow users to edit their posts.
■ Delete Post: Allow users to delete their post.
1. Session Authentication and Cookie Storage: Understand how to handle sessions and
cookies as an alternative authentication method.
2. Jest API Testing Tool: Learn and implement tests using Jest to ensure API reliability.
3. OAuth: Integrate OAuth to support external authentication.