/js-react-social-tutorial

The javascript version of react-social-network for tutorial purpose

Primary LanguageJavaScriptMIT LicenseMIT

Gitter

The React Social Network is an open source project relying on React a powerful javascript library for building the user interface. This project is a javascript version of React Social Network for tutorial purpose. React Social Network itsef migrated to TypeScript language but even that we are supporting .jsx and .js javascript files too. It means you can write javascript component, api, action, services, ... beside TypeScript files.

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to amir.gholzam@live.com.

DEMO

Green Open Social

Required Knowledge

I recommend that you get to know React before using React Social Network. React Social Network has built by React components, so understanding how React fits into web development is important.

(If you're not familiar with the concept of Single Page Applications (SPAs), head over to the here for a quick introduction before you read on.

Document

Use Documentation to find out more details about this project.

Features

  • React A javascript library for building user interfaces.
  • Redux is a predictable state container for JavaScript apps.
  • Material-UI A Set of React Components that Implement Google's Material Design.
  • react-redux Official React bindings for Redux.
  • Firebase products like Analytics, Realtime Database, Messaging, and Crash Reporting let you move quickly and focus on your users.
  • redux-thunk Redux Thunk middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met. The inner function receives the store methods dispatch and getState as parameters.
  • Express Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
  • React Router V4 for routing website location
  • Sass CSS with superpowers. Sass boasts more features and abilities than any other CSS extension language out there.
  • Webpack for bundling code

In my todo list

  • Documentation
  • Testing
  • Security issues
  • Performance
  • Add some features and solving bugs
    • Sharing post in social itself and other socials
    • Add link feature to post
    • Add vido post
    • Add image gallery post
    • Search post and people ...

Prerequisites

Install NodeJs

Installing

Build social network in 5 minutes

  1. Fork the react-social-network repository on Github
  2. Clone your fork to your local machine git clone git@github.com:<yourname>/react-social-network.git

You need to configure firbase first before starting other steps. We are using firebase storage to store files, firebase database to store user information and firebase authorization to authorize user with email and password.

  1. Configure firebase:

    • Get firebase config

    • Create a folder in root folder react-social-network set the name config => >react-social-network\config

    • Create three files in >react-social-network\config set their name development.env , test.env and production.env => >react-social-network\config\development.env and >react-social-network\config\test.env

    • Inside the files, you should write some keys of firebase configuration (each file is depend on the environment you work in NODE_ENV. If you set NODE_ENV=development your project will use from development.env to config firebase but if you set it NODE_ENV=test it will use test.env in test environment):

      API_KEY=[API_KEY]
      AUTH_DOMAIN=[PROJECT_ID].firebaseapp.com
      DATABASE_URL=https://[DATABASE_NAME].firebaseio.com
      PROJECT_ID=[PROJECT_ID]
      STORAGE_BUCKET=[BUCKET].appspot.com
      MESSAGING_SENDER_ID=[SENDER_ID]HOST_URL

  2. Enable Email/Password sign-in on firebase:

    • In the Firebase console, open the Auth section.
    • On the Sign in method tab, enable the Email/password sign-in method and click Save.
  3. Installing all nodejs modules: npm install

  4. Rub webpack to build bundle file webpack

  5. Running server: node server.js

Warning

  • If you're using Windows you should install all node-gyp dependencies with following commands:

$ npm install --global --production windows-build-tools and then install the package

$ npm install --global node-gyp

Contribute

React Social Network has been made by love. I planed to build a back-end for this project and improve the perfomance as I process all procedures on the fron-end side. If you'd like to help, check out the document. I'd greatly appreciate any contribution you make. :)

Authors

  • Amir Movahedi

License

This project is licensed under the MIT License - see the LICENSE file for details