- Learn React with MERN(Mongo-Express-React-Node) stack according to learning class: https://hashnode.com/post/react-tutorial-using-mern-stack-ciiyus9m700qqge53mer0isxz
npm install --global babel-cli npm install babel-preset-react
Then run transform.sh
- QUESTIONS
- Babel doesn't recognize "console.log" and treats it as syntax error, why? My bad, I should write console.log in render() instead of React.createClass()
Dynamically update the data model and re-render.
Start using state, prepare for dynamic updates.
Dynamically update the state and see the magic.
Communicate from child to a parent component.
Move data to the server.
+Implement a GET API on the server to return a list of records.
Implement a POST API to add a new record.
Change client code to fetch data from server.
Change client code to send data to server for Add record.
Persist the data in a database.
Write a script to initialize a MongoDB collection. Steps:
- use "mongod" in shell to start a default connection to mongodb
- "mongo ./scripts/init.mongo.js" in shell to initialize bugsdb collections
Create a permanent connection to the DB, change GET API to read from DB.
Change POST API to insert a record into the DB.
Use gulp to automate the manual tasks. TODO:
- Learn more about pipe steps in gulpfile.js