Discover is a web application that serves as a platform for users to share and discover blogs. It provides various features and functionality for both blog creators and readers. The project is built using React on the front end and Express on the back end. It incorporates several third-party packages to enhance the user experience and offers features like authentication, blog creation and management, wishlist functionality, and more.
Live-Demo: DISCOVER
- Introduction
- Features
- Technologies
- Installation
- Usage
- Project Structure
- API Endpoints
- Authentication
- Routes and Pages
- Custom Hooks
- Bonus Features
- Acknowledgments
Discover is a platform for bloggers and readers. It provides a clean and intuitive user interface, offering features like blog creation, management, and wishlist functionality. Users can register, log in, and manage their blogs and wishlists.
- Header with navigation links.
- Banner (hero section).
- Recent blog posts section.
- Newsletter subscription section.
- Footer.
- User authentication with login, register, profile picture, and logout buttons.
- Display six recent blogs with title, image, short description, category, details, and wishlist buttons.
- Newsletter subscription with toast messages.
- Displays all blogs added by users.
- Filter blogs by category.
- Search field to search blogs by title.
- Each blog displays title, image, short description, category, details, and wishlist buttons.
- Shows detailed information about a blog.
- Allows users to comment on blogs.
- Comments display owner name and profile picture.
- Comments are associated with the blog's ID.
- Users cannot comment on their own blogs.
- Conditional update button for blog owners to edit their blogs.
- Displays blogs wishlisted by a specific user.
- Each blog shows title, image, short description, category, details, and a remove wishlist button.
- Users can create new blogs using a form.
- Blog details include title, image URL, category, short description, and long description.
- Displays the top 10 posts based on word count in the long description.
- Shows a table with serial number, blog title, blog owner, and blog owner profile picture.
- Utilizes a table library for visualization.
Discover uses various technologies and packages, including but not limited to:
- React
- Framer Motion
- React-photo-view
- React-loading-skeleton
- Tenskack Query
- Firebase
- Express
- Axios
- React Icons
- React-toastify
- React-router
- Tailwind
- Daysi Ui
- React-icon
Please refer to the project's package.json for a complete list of dependencies.
-
Clone the client-side repository and server-side repository to your local machine.
-
Install the required packages by running the following commands in both the client and server directories:
# In the client directory npm install # In the server directory npm install
-
Configure your Firebase settings for authentication in the server-side code.
-
Start the client and server applications using the following commands:
# In the client directory npm start # In the server directory npm start
-
Access the Discover web application through your web browser at
http://localhost:3000.
- Register or log in to your account.
- Explore recent blogs on the home page.
- Add blogs, comment on blogs, and manage your wishlists.
- Discover featured blogs with top posts.
- Enjoy a seamless user experience with various animations and responsiveness.
The project is organized into client and server directories. The server handles API requests and data management, while the client is responsible for the user interface.
-
Client-side:
srccontains the main application code.commonincludes all the common components used in the project.pagescontains the various routes and page components.hooksincludes custom hooks for reusability.routesincludes all routesutilscontains utility functions.assetsholds images and other assets.App.jsis the main entry point of the client-side application.
-
Server-side:
index.jsis the main server file.configcontains configuration files.
The server-side provides API endpoints for interacting with the database. Here are some of the key endpoints:
POST /api/v1/signup: User registration.POST /api/v1/login: User login.GET /api/v1/blogs: Retrieve all blogs.GET /api/v1/blogs/:id: Retrieve a specific blog by ID.POST /api/v1/blogs: Create a new blog.PUT /api/v1/blogs/:id: Update a blog.DELETE /api/v1/blogs/:id: Delete a blog.GET /api/v1/categories: Retrieve all categories.POST /api/v1/comments/:blogId: Add a comment to a blog.DELETE /api/v1/wishlist/:blogId: Remove a blog from the wishlist.GET /api/v1/wishlist/:userId: Retrieve the user's wishlist.
Please refer to the server code for a complete list of API endpoints and their functionality.
Discover implements email and password-based authentication using Firebase for user registration and login. Additionally, it supports social media logins like Facebook, Github, Google, etc. A 404 page is displayed for routes that do not exist. Error messages are provided for password validation during registration.
-
Home Page (
/):- Displays recent blogs, a newsletter subscription, and user authentication features.
-
All Blogs Page (
/all):- Lists all blogs and provides filtering and search options.
-
Blog Details Page (
/details/:id):- Displays detailed information about a specific blog and allows comments.
-
Wishlist Page (
/wishlist):- Shows the user's wishlisted blogs.
-
Add Blog Page (
/addblog):- Allows users to create new blogs.
-
Featured Blogs Page (
/featured):- Displays the top posts based on word count in the long description.
Discover includes custom hooks for reusability, such as useAxios for form handling and useAuthantication for data fetching. These hooks can be found in the hooks directory in the client code.
-
Git Commits and Readme:
- A meaningful README file is provided.
- More than 20 meaningful git commits on the client-side repository and more than 10 on the server-side repository.
-
Reload Functionality:
- Private routes do not redirect users to the login page upon reload.
-
Responsive Design:
- The homepage is responsive for both desktop and mobile.
-
Tenstack Query:
- Tenstack Query is used for data fetching on all pages.
-
Framer Motion Package:
- Framer Motion is used for animations on the homepage.
-
JWT Authentication:
- JWT authentication is implemented on private routes.
-
Toasts:
- Toast messages are used for CRUD operations and login/signup errors.
-
Website Title:
- The website name is displayed in the website title along with a relevant favicon.
Feel free to explore, enhance, and customize Discover for your own projects and needs.