Hi Everyone —
After a long time, I have started my #100Day Challenge to do coding everyday & learn new things. This time I have chosen toe do in #React #Node #Express #MongoDB.
Day1
On Initial day — I Had plan to have my database ready in cloud to get the API code started, for this one I have written #Node code using csvtojson library, which will help in reading the CSV file & convert to JSON. This can be used to load the data to #MongoDB using the mongoose library which worked perfectly.
Below is sample code to use the csvtojson & load data to mongodb,
const mongodb = require(‘mongodb’).MongoClient;
const csvtojson = require(‘csvtojson’);
let mongoUrl = “Your Mongo URL”;
csvtojson ().fromFile(‘CSV File’)
.then(csvData => {
mongodb.connect( mongoUrl,
{
useNewUrlParser: true, useUnifiedTopology: true
}, (err, client) => {
if(err) throw err;
client .db(“ipl-dashboard-data”)
.collection(“ipl-match-data”)
.insertMany(csvData, (err, res) => {
if(err) throw err;
console.log(`Inserted: ${res.insertedCount} rows`);
client.close();
});
} );
});
Day2
I started to work on the #Express API in #Node application — which I used over 1.5years ago, need to do some refreshing on the same to get the speed up. #Express API done by using the library & connected to my remote #MongoDB — to fetch all the data which I have placed on #Day1. It worked fine after some retries because of my less coding in past day :)
Day3
With the API & Data ready, I have planned to do some ground work on my UI side today — did the local setup for #React project. I am an #Angular developer — so started learning #React & doing this #100DaysofCoding challenge to boost me up.
Day4
Continued my learning & did some basic code stuff on the #React App to get into a shape.
Day5
Continued on the #udemy course for #reactjs state, props, components. Continued on the IPL dashboard design.
Rest to be continued….. I will try to add details everyday if not, will do it twice a week.
Top comments (2)
100DaysOfCode #Day5 Continued on the #udemy course for #reactjs state, props, components. Continued on the IPL dashboard design.
Things planned to cover up as part of learning,