Skip to content
Rishi Bharadwaj Sai Lella edited this page Jul 15, 2024 · 1 revision

React Social Media App Documentation

Welcome to the official documentation for the React Social Media App! This wiki serves as a comprehensive guide to understand and contribute to the project.

Table of Contents

  1. Overview
  2. Getting Started
  3. Components
  4. Contributing
  5. Security
  6. License

1. Overview

The React Social Media App is a frontend application built with React.js, designed for creating, viewing, and managing user-generated posts. It leverages React's component-based architecture and context API for state management.


2. Getting Started

Installation

To install and run the React Social Media App locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/rishibharadwajsai/social-media-app.git
    cd social-media-app
  2. Install dependencies:

    npm install

Running the App

To start the development server:

npm run dev

Open your browser and navigate to http://localhost:5173 to view the app.


3. Components

CreatePost

The CreatePost component allows users to create new posts by filling out a form with fields for user ID, post title, content, number of views, and tags. Upon submission, it sends a POST request to add the post to the backend.

PostListProvider

The PostListProvider component manages the state of postList, which stores all posts fetched from the backend. It uses useReducer to handle actions for adding, deleting, and initializing posts.

PostList

The PostList component renders a list of posts fetched from the PostListProvider context. It includes a loading indicator while posts are being fetched and displays a welcome message when no posts are available.

Post

The Post component renders an individual post with its title, content, tags, and number of views. It provides a delete button (MdDelete icon) to delete the post.


4. Contributing

We welcome contributions to the React Social Media App! Here's how you can contribute:

How to Contribute

  1. Fork the repository and create a new branch for your changes.
  2. Make your changes, ensuring they follow the project's coding style and conventions.
  3. Test your changes thoroughly and commit them with clear messages.
  4. Push your branch to your fork and submit a pull request to the main branch.

Code Style

  • Follow consistent coding style as demonstrated in the existing codebase.
  • Use meaningful variable and function names and comment your code when necessary.

Testing

  • Ensure your changes are thoroughly tested, including both new features and bug fixes.
  • Run existing tests to ensure they pass before submitting a pull request.

5. Security

Security Policy

Our security policy outlines how to report security vulnerabilities and our commitment to addressing them promptly.

Reporting Security Issues

To report a security issue, please email us directly at rishi.lella123@gmail.com. Provide detailed information about the vulnerability and steps to reproduce it.


6. License

This project is licensed under the MIT License. See the LICENSE file for more details.