SocialVibe
Project Goal
The goal of SocialVibe is to create an innovative social media platform that fosters meaningful connections and engaging interactions among users. By integrating modern web technologies and user-centric design principles, SocialVibe aims to offer a seamless and enjoyable experience for sharing content, building communities, and staying connected with friends and family. This platform emphasizes user accessibility, and a feature-rich environment to cater to diverse social networking needs.
Live Site
You can visit the live site here: SocialVibe
Aim
The aim of SocialVibe is to:
- Provide a secure and user-friendly social media experience.
- Facilitate the creation and sharing of diverse content types.
- Enable users to build and engage with communities of interest.
- Offer advanced privacy settings to protect user data.
- Ensure accessibility for users with different needs and preferences.
- Continuously evolve based on user feedback and technological advancements.
Currently, SocialVibe allows users to:
- Register and create an account.
- View a personalized feed of content.
- Maintain and update their profile.
- Make and manage friendships.
- Search for users and content.
In the future, I plan to enhance the platform by adding:
- Chat and messaging options.
- Trending topics and content.
- Personalized people suggestions.
User Goals
SocialVibe aims to help users achieve the following goals:
-
Stay Connected: Easily connect with friends, family, and new acquaintances.
-
Share Content: Post updates, photos, and other media to share life moments and thoughts.
-
Discover Content: Find and explore content that aligns with personal interests and trends.
-
Engage Meaningfully: Participate in meaningful conversations on other posts and interactions within their network.
-
Explore Friendships: View friends' lists and visit friends' profiles to see their posts.
User Experience
Target Audience
- Individuals interested in social networking and content sharing.
- Users looking to connect with friends and discover new trends.
- Social media enthusiasts seeking an interactive platform for discussions and updates.
Design Details
Colors and Fonts Used
Font: Utilizes a readable font for the interface with appropriate fallbacks for different platforms.
Colors:
- Text color: rgb(31,41,55,1) .
- Navbar background color: #fff.
- Button colors: rgb(147, 51, 234, 1),rgb(75, 85, 99, 1), rgba(255, 99, 71, 1).
- Main background color: rgb(243 244 246,1) .
User Stories & Epics
All user stories were entered as issues in a GitHub Kanban project. Follow the link to see the project: Project Link
Epic 1: User Registration and Authentication
- #1 - As a new user, I want to register an account so that I can access the platform.
- #2 - As a user, I want to log in so that I can access my account and personalized features.
Epic 2: User Profile Management
- #3 - As a user, I want to create and update my profile so that I can share information about myself.
- #4 - As a user, I want to view other users' profiles so that I can learn more about them.
- #5 - As a user, I want to post updates so that I can share my thoughts and activities.
-
Epic 3: Social Networking Features
- #6 - As a user, I want to see a feed of posts from my friends so that I can stay updated on their activities.
- #7 - As a user, I want to search for other users so that I can find and connect with friends.
- #8 - As a user, I want to add friends so that I can expand my social network.
Epic 4: Content Interaction
- #9 - As a user, I want to like posts so that I can show my appreciation for the content.
- #10 - As a user, I want to comment on posts so that I can engage with the content and share my thoughts.
Epic 5: Future Enhancements
- #11 - As a user, I want to use a chat feature so that I can communicate directly with my friends (future development).
- #12 - As a user, I want to see trending topics so that I can stay updated on popular content (future development).
- #13 - As a user, I want to receive friend suggestions so that I can connect with more people (future development).
Design
ERD
Entity Relationship Diagram
Wireframes
Home Page
Login Page
Signup Page
Edit Profile Form
Profile Page
Search Page
Friends Page
Features
User Registration
- Feature: Users can register by providing necessary details like username, email, and password.
- Benefit: Allows users to create a personalized account and access the platform's features.
Signup Desktop
Signup Mobile
User Login
- Feature: Users can log in using their registered email and password.
- Benefit: Enables users to access their personalized content and maintain session security.
Login Desktop
Login Mobile
Feeds
- Feature: Displays a personalized feed of posts from the user's friends and connections.
- Benefit: Keeps users updated with the latest activities and posts from their network.
Feed Desktop
Feed Mobile
Profile Editing Form
- Feature: Users can edit their profile information, including profile picture, name, and personal email.
- Benefit: Allows users to keep their profile information current and reflective of their identity.
Edit Profile Form Desktop
Edit Profile Form Mobile
Profile Page
- Feature: Displays user's profile with friends count, post count, and options to add posts (text or image), read posts, and delete posts.
- Benefit: Provides a comprehensive view of the user's activity and allows content management.
Profile Page Desktop
Profile Page Mobile
Friend Management
- Feature: Users can see incoming friend requests, accept or reject them, and view a list of their friends.
- Benefit: Facilitates building and managing a social network.
Friends Page Desktop
Friends Page Mobile
Comment and Like Posts
- Feature: Users can like and comment on posts to engage with the content.
- Benefit: Encourages interaction and engagement on the platform.
Comment and Like Post Desktop
Comment and Like Post Mobile
Search Functionality
- Feature: Users can search for other users and posts using a dedicated search page.
- Benefit: Makes it easy to find specific content and connect with new users.
Search Page Desktop
Search Page Mobile
Future Features
Trends
- Feature: Display trending topics and content based on user engagement and activity.
- Benefit: Keeps users informed about popular discussions and trending content on the platform.
Chat
- Feature: Real-time chat functionality for direct messaging between users.
- Benefit: Enhances communication by allowing private and instant conversations.
People You May Know
- Feature: Suggests potential friends based on mutual connections and shared interests.
- Benefit: Helps users expand their social network by connecting with people who have common interests or mutual friends.
FlowChart
SocialVibe Flow Chart
Generated by Lucidchart
Description
- Home Page: The starting point of the app.
- Login Page: Users can log in here.
- Signup Page: New users can create an account.
- Profile Page: Users can view and manage their profile.
- Edit Profile Page: Users can edit their profile details.
- Search Page: Users can search for friends and other content.
- Friends Page: Users can view their friends list.
- Feed Page: Users can view the latest updates and posts from their friends and connections.
Project Structure
This project utilizes Vite for fast development and React for building user interfaces.
React
React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It allows for the creation of reusable components which manage their own state, making it easier to develop and maintain complex UIs.
Reasons for using React:
- Speed: Enhances page loading speed and overall user experience.
- Flexibility: Easier to maintain and more adaptable due to its modular structure.
- React Bootstrap: Provides pre-built components for improved styling and responsiveness.
- Reusability: Facilitates the creation and reuse of components across the application.
Reusable Components
These components are created and reused across multiple pages of this application.
<FeedForm />
: Manages the input form for creating new feed items.
<FeedItem />
: Displays individual feed items.
<Footer />
: Provides the footer section of the application.
<NavBar />
: Contains navigation links and user profile actions.
<ProfileInfo />
: Displays user profile information.
<Toast />
: Handles toast notifications for user feedback.
<Loading />
: Renders a visual indicator (e.g., "Loading...") to inform users that data is being fetched.
Pages
- Home: The main landing page of the application.
- Edit Profile: Allows users to update their profile information.
- Feed: Displays a list of feed items.
- Friends: Manages user's friend list and friend requests.
- Login: User login page.
- Signup: User registration page.
- Post: Handles creating and viewing individual posts.
- Profile: Displays the user's profile page.
- Search: Provides search functionality for users and posts.
Contexts
- ToastContext: Manages toast notifications.
- UserContext: Handles user authentication and profile information.
- SearchContext: Manages the search functionality.
- PostsContext: Manages posts, including creating, editing, and deleting posts.
- FriendshipContext: Manages friendships and friend requests.
Providers
All contexts are wrapped in the AppProviders
component to provide global state management.
Bug
Issue Description
When a user manually types the URL of a feed in the browser without being authenticated, the feed form is visible, but the user cannot make requests due to the lack of authentication token.
FeedForm bug
Proposed Solution
To address this issue, we can we either return null or a form based on the user's authentication status. The isAuthenticated
flag is already available in the UserContext
, which manages user authentication state throughout the application.
Implementation Steps
-
Context Integration: Ensure isAuthenticated
is properly managed in UserContext
and accessible throughout the application.
-
Conditional Rendering: Modify the rendering logic for the feed form component (<FeedForm />
) to check the isAuthenticated
flag before displaying the form.
Solution:
import { useContext } from 'react';
import { UserContext } from './UserContext';
const FeedForm = () => {
const { isAuthenticated } = useContext(UserContext);
return isAuthenticated ? (
<div>
{/* Render feed form content */}
</div>
) : (
<></> // Render nothing or a placeholder if user is not authenticated
);
};
export default FeedForm;
Technologies Used
Languages
Frameworks and Libraries
-
Axios
- Version: 1.7.2
- Description: Promise-based HTTP client for making API requests within the React application. Axios handles API communication efficiently and manages CORS (Cross-Origin Resource Sharing) seamlessly.
- Justification: Used for interacting with API endpoints and managing HTTP requests in a structured and efficient manner.
-
React
- Version: 18.2.0
- Description: JavaScript library for building user interfaces. React enables component-based UI development and state management, serving as the core framework for the application.
- Justification: Essential for creating interactive and responsive user interfaces, managing application state, and rendering components efficiently.
-
React Router Dom
- Version: 6.23.1
- Description: Declarative routing library for React applications. React Router Dom facilitates navigation between different views and components based on the URL, providing a seamless single-page application (SPA) experience.
- Justification: Used for handling client-side routing within the application, enabling navigation and rendering of components based on the URL.
-
Serve
- Version: 14.2.3
- Description: Simple server for serving static files, typically used to serve the production build output directory (
dist
) after building the application using Vite.
- Justification: Used to serve static files generated during the production build process, ensuring that the application runs correctly in a production environment.
-
Tailwind CSS
- Version: 3.4.4
- Description: Utility-first CSS framework for rapidly building custom user interfaces.
- Justification: Enables rapid UI development with its utility-first approach, reducing the need for writing custom CSS and speeding up the styling process.
-
Jest
- Version: 29.7.0
- Description: JavaScript testing framework with a focus on simplicity.
- Justification: Used for writing and running tests to ensure the reliability and functionality of JavaScript code, including React components and utility functions.
-
Vite
- Version: 5.2.0
- Description: Next-generation frontend tool that sets up fast refresh and optimized production builds.
- Justification: Provides a development environment with fast build times and instant hot module replacement (HMR), enhancing the developer experience and improving productivity.
-
React Testing Library
- Description: Simple and complete React DOM testing utilities that encourage good testing practices.
- Justification: Used for testing React components by focusing on user interactions, ensuring that the components behave as expected from the user's perspective, promoting effective and reliable testing practices.
Linter, Prettier, and Formatter
-
ESLint
- Description: ESLint is a static code analysis tool for identifying problematic patterns found in JavaScript and JSX code. It ensures code quality and adherence to coding standards.
- Commands:
npm run lint
: Runs ESLint to check for code issues.
npm run lint:fix
: Automatically fixes ESLint issues where possible.
- Configuration:
- Uses
eslint-config-airbnb
as the base configuration.
- Additional plugins include
eslint-plugin-import
, eslint-plugin-jsx-a11y
, eslint-plugin-react
, and eslint-plugin-react-hooks
.
-
Prettier
- Description: Prettier is a code formatter that enforces a consistent style by parsing code and reprinting it with its own rules, taking care of formatting concerns such as indentation, semicolons, and quotes.
- Command:
npm run format
- Configuration:
- Prettier is configured to format JavaScript and JSX files located in the
src
directory.
Tools & Programs
- Chrome DevTools: Built-in debugging tools for various browser debugging tasks.
Agile Development
About
Agile development is adopted to efficiently manage the development process of the project, ensuring flexibility and iterative improvements.
User Story Template
Using GitHub issues, a user story template was created to define features and tasks for the project. The template categorizes tasks into three labels: must have, could have, and should have.
Userstory Template
Kanban Board
The project's progress and task status are visualized through a Kanban board. Each task is represented as a card that can be moved across columns indicating its current status—todo, in progress, and completed.
Kanban Board
Example Kanban Board
MoSCoW Prioritization
MoSCoW prioritization technique is employed to prioritize project requirements based on their importance and urgency. This ensures that essential features are addressed first, followed by those of lower priority.
MoSCoW Prioritization Example
Milestones
Milestones are set to mark significant stages or deadlines within the project timeline. Each milestone is linked with relevant issues and tasks to ensure alignment with project goals and deadlines.
Example Milestones
Testing
A separate testing document has been created as Testing.md
Deployment
Deploying the SocialVibe App on Heroku
Steps to Deploy:
-
Login to Heroku:
- Create an account or log in to Heroku at Heroku.
-
Create a New App:
- Click on New > Create new app in the Heroku dashboard.
- Choose an app name and select the region.
- Click on Create app.
-
Configure Environment Variables:
- In the app dashboard, navigate to the Settings tab.
- Click on Reveal Config Vars.
- Ensure all necessary environment variables are sets if needed.
-
Add Buildpacks:
- Go to the Settings tab.
- Scroll down to Buildpacks and add the following buildpacks:
-
Deploy from GitHub:
- Navigate to the Deploy tab.
- Choose GitHub as the deployment method.
- Connect to your GitHub account if prompted.
- Search for and select the repository you want to deploy.
- Click Connect to connect the repository.
-
Automatic and Manual Deployment:
- Choose whether you want to enable automatic deployments (from a selected branch) or manual deployments.
- Click on Deploy Branch to deploy manually.
Cloning & Forking
Fork
- On GitHub.com, navigate to the zohaibshahzadkhan/SocialVibe-React-App repository.
- In the top-right corner of the page, click Fork.
- By default, forks are named the same as their parent repositories. You can change the name of the fork to distinguish it further.
- Add a description to your fork.
- Click Create fork.
Clone
- Above the list of files click the button that says 'Code'.
- Copy the URL for the repository.
- Open Terminal. Change the directory to the location where you want the cloned directory.
- Type git clone, and then paste the URL
- Press Enter.
Local Deployment
- On GitHub.com, navigate to the zohaibshahzadkhan/SocialVibe-React-App repository and clone it.
- Once you clone the repository you will need to install the node packages, you can do this by typing
npm install
into the terminal from root directory of the project.
- Run
npm run dev
from the root of the project folder to start local deployment server.
Credits
Learning Resources
- Code Institute: Thank you for the tutorials on learning Django REST Framework and React.
Problem Solving
- Stack Overflow: Grateful for the community's help in troubleshooting issues, especially with the latest versions of packages.
Design and Assets
- Heroicons (heroicons.co): Icons used throughout the project were sourced from Heroicons.
- Freepik: Special thanks for providing icons that contributed to the project's visual appeal.
Design Tools
- Figma: Used Figma for creating wireframes and designing the user interface.
Styling
- Tailwind CSS Community: Appreciation for the vibrant community and resources that helped in styling the project using Tailwind CSS.
This project wouldn't have been possible without the valuable resources and support from these platforms and communities. Thank you!