项目作者: mahmudahsan

项目描述 :
A single page web application to showcase youtube videos for educational purpose.
高级语言: JavaScript
项目地址: git://github.com/mahmudahsan/python-bangla-react.git
创建时间: 2019-02-11T14:05:26Z
项目社区:https://github.com/mahmudahsan/python-bangla-react

开源协议:MIT License

下载




Build


reactjs


Firebase


License


Twitter: @mahmudahsan

Single Page React Web App

Demo 1: https://flutterbook.net

Demo 2: https://pythonbangla.com

I redevelop my original Python Django Framework based project PythonBangla to Reactjs and firebase based project. During the making of this project, I updated the UI a bit.

For last 6 months, I was learning ReactJs library. I wanted to develop something else. But before developing my other big project, I thought lets rebuild my original django project so that I can test how good I understand React, Firebase Cloud Firestore (NoSQL) etc.

I develop this project in 5 days by my part time effort. Also this project is just for exploring my knowledge, so I didn’t invest more time to add more features, like a proper admin panel etc.

Demo 1: 😎 http://pythonbangla.com/ | Source Code: Github React

Demo 2: 🤓 Django + PostgreSQL + Heroku | Source Code: Github Django


Website


Mockup


React Components

Table of Contents

Technology Used

  1. React
  2. Firebase
  3. Bootstrap
  4. JQuery
  5. Linkyfy

Features

I just want to showcase my youtube tutorials in nice way. Also this site helps SEO in Google Search Engine.

Setup in local machine

  1. First clone this project in your local machine.
  2. In the frontend directory all the source code are exists.
  3. Modify frontend/config/Setting.js and update all the info

Setup Firebase

  1. Create a project in Firebase
  2. Now follow this tutorial and get your project configuration Firebase How To
  3. Now update frontend/Model/firebaseauth.js file by your project info
  1. // Firebase Authentication Replace with your data
  2. import Firebase from 'firebase';
  3. const config = {
  4. apiKey: "sxxxx",
  5. authDomain: "ssss",
  6. databaseURL: "xxxx",
  7. projectId: "xxxx",
  8. storageBucket: "xxxx",
  9. messagingSenderId: "xxx"
  10. };
  11. export default Firebase.initializeApp(config);
  1. Our data will be look like this on firebase


    firebase

If we compare this with relational database, then collections are table name and document are each row of item in table.

  1. In Firebase Cloud Firestore the rules should be look like this. As your project need to add data, so you open public write/read. When your writing task complete, just remove the write part

    1. service cloud.firestore {
    2. match /databases/{database}/documents {
    3. match /{document=**} {
    4. allow read, write;
    5. }
    6. }
    7. }
  2. Now add <Route path="/admin" component={FirebaseForm} ></Route> this code in frontend/Router/AppRouter.js

  1. <Switch>
  2. ....
  3. <Route path="/admin" component={FirebaseForm} ></Route>
  4. <Route component={NotFoundPage} ></Route>
  5. </Switch>

Also add import FirebaseForm from '../components/FirebaseForm'; this code at the top of the frontend/Router/AppRouter.js

  1. If you save all of this, and run yarn start in terminal you can visit http://localhost:3000/admin where you can add your contents to firebase


firebase

  1. IMPORTANT: When you will deploy your project, undo the AppRouter.js modification as before. Because if you deploy this admin panel to add data, anyone can alter your database by using this form. In my case, I didn’t deploy this route in production.

Deploy in Firebase Hosting

  1. Run yarn build it will create a build folder with production files

  2. Now follow Create React App Firebase Hosting to deploy your project in firebase

  3. firebase deploy —project PROJECT_ID

Contribution

If you want to contribute on this project, you’re welcome to fork the project and submit a pull request.

Questions or feedback?

Feel free to open an issue, or find me @mahmudahsan on Twitter.