This project sets up a blog application that allows users to view a list of blogs and their detailed content.
Experience the app live here: https://pakupodisathish.github.io/BlogListProject/
Follow these steps to get the project running on your local machine:
- Clone the Repository:
git clone [https://github.com/Pakupodisathish/BlogListProject.git](https://github.com/Pakupodisathish/BlogListProject.git)
- Navigate to Project Directory:
cd BlogListProject - Install Dependencies:
npm install
- Start the Application:
The app will open in your browser, typically at
npm start
http://localhost:3000/.
The application provides the following core features:
- Upon opening the app, the Home Route is displayed.
- An HTTP GET request is made to
https://apis.ccbp.in/blogsto fetch the list of blogs. - A loader is displayed while the data is being fetched.
- Once the data is retrieved, the list of blogs is rendered.
- Clicking a blog item on the Home Route navigates to its details page.
- An HTTP GET request is made to
https://apis.ccbp.in/blogs/:id(e.g.,https://apis.ccbp.in/blogs/2) to fetch the specific blog's details. - A loader is displayed during data fetching.
- After fetching, the complete details of the selected blog are displayed.
The application interacts with these APIs:
- URL:
https://apis.ccbp.in/blogs - Method:
GET - Description: Returns a list of all available blogs.
- URL:
https://apis.ccbp.in/blogs/:id(e.g.,https://apis.ccbp.in/blogs/2) - Method:
GET - Description: Returns detailed information for a specific blog based on its ID.
The project is organized into the following React components:
App.js: Main application component, handling routing.Home/index.js: Displays the list of blogs and fetches data for the Home Route.BlogList/index.js: Renders the collection of blog items.BlogList/index.css: Styling forBlogList.
BlogItem/index.js: Renders an individual blog entry.BlogItem/index.css: Styling forBlogItem.
BlogItemDetails/index.js: Displays the detailed view of a selected blog.BlogItemDetails/index.css: Styling forBlogItemDetails.
- Routing Paths:
- Home:
/ - About:
/about - Contact:
/contact - Blog Item Details:
/blogs/:id
- Home:
- The
BrowserRouteris already set up inindex.js, so you don't need to add it toApp.js. - Loader Component: Ensure your
Loadercomponent is wrapped as<div> <Loader type="TailSpin" color="#00bfff" height={50} width={50} /> </div>