Assignment: Basic Full-Stack Blog Project using MERN
Task 1: Backend Setup using Express.js and MongoDB
- Set up a new Node.js project and install the required dependencies (express, mongoose, etc.).
- Create an Express.js server with routes for CRUD operations on blog posts.
- Define a Mongoose schema for the blog posts with fields like title, content, author, and createdAt.
Implement API routes for:
- Fetching all blog posts
- Fetching a single blog post by ID
- Creating a new blog post
- Updating an existing blog post
- Deleting a blog post
Task 2: Frontend Setup using React
- Set up a new React project using create-react-app.
Create components for:
- A blog post list to display all available blog posts
- A single blog post view
- A form to add/edit blog posts
Use React Router to handle different routes:
- / for displaying the list of blog posts
- /post/:id for displaying a single blog post
- /create for adding a new blog post
- /edit/:id for editing an existing blog post
Task 3: Connecting Frontend and Backend
- Utilize Axios or another HTTP library to make API requests from the frontend to the backend.
- Fetch all blog posts and display them in the blog post list component.
- Implement functionality to view a single blog post and its details.
- Create forms to add new blog posts and edit existing ones.
Task 4: Styling and UI Enhancement
- Apply basic styling to your components using CSS or a CSS framework like Bootstrap or Tailwind CSS.
- Ensure that the user interface is user-friendly and responsive.
Task 5:
- Implement user authentication and allow only authenticated users to create, edit, and delete blog posts.
- Add comment functionality to the blog posts.
- Implement a search feature to search for blog posts based on titles or keywords.
Submission Guidelines
Submission Instruction :
- Please create a note.txt file with in the GitHub repository.
- Please deploy your app
- Please include your deployed version link, server site GitHub repository link, client side repository link in the note.txt file
- Please submit your GitHub repository link.