- To learn more about React.
- Have a React boilerplate for new projects.
- Learning about Firebase Authentication.
- Hosting and Release, so far I only have experience with Heroku.
- npx create-react-app my-blog
- npm run start
- jsx -> HTML like syntax that React uses to define interfaces
- React Router
- Modularity of components and how to reuse.
- Shortcuts in package.json
- You can define in scripts section
"dev": "npx nodemon src/server.js",
- Set up a folder for our database
- mongod --dbpath ./mongo-db-data/
- .pretty() at the end of find to print it out in a nicer way (in mongod)
- increment by 1 in mongodb -> await db.collection('articles').updateOne({ name }, { $inc: { upvotes: 1 }, })
- $push add new object to an array
- React Hooks as useState -> hooks run whenever the component gets updated
- React Hooks are functions that we can call that abstract state management for our components.
- Axios
- CORS Policy, Frontend and Backend on different ports, so we have to allow that they can talk to each other => Add a proxy in package.json to make them think they run on the same origin
- After proxy setup no need for the full url
- Set up User Authentication with Firebase
- Custom Hooks
- SignIn with Firebase Authentication
- In the backend make sure, users only can upvote article ones different for backend then frontend