For this week each of us is free to carry out some small project chosen (it could be a little tutorial or redoing the previous assignment, for example), in couple or individually; a bit like we did for the Wes bos's project. At the end we will put them together in the group issue.
I decided to follow this tutorial whch is available also on GitHub: here you can find the code for the backend and here the frontend.
Use the IDMB Movie Website to scrape information used to build a basic REST API server, then build a simple front-end to interact with the server.
Steps
- [1:12] introduction
- [6:49] Overview of cheerio
- [7:18] Add cheerio to server code
- [7:39] Get movie titles and movie posters from IMDB search
- [11:53] Format data as JSON
- [13:04] Prepare code for modularity
- [14:12] Create a basic express app
- [15:39] Create node scripts (auto-reload with nodemon)
- [16:31] Create search route
- [18:02] Get movie id from IMDB
- [20:12] Create movie route
- [23:19] Get data from IMDB movie page
- [23:25] Title
- [26:39] MPAA Rating
- [27:59] Run time
- [29:58] Genres
- [31:45] Release date
- [32:50] IMDB rating
- [33:40] Movie poster
- [37:04] Summary
- [38:03] Directors
- [43:24] Writers
- [46:52] Actors
- [49:32] Story line
- [51:50] Things to keep in mind when scraping the web
- [53:10] Back to getting data from IMDB
- [53:10] Try getting budget
- [54:09] Production companies
- [57:46] Link to trailer (Part I)
- [1:01:21] Link to trailer (Part II)
- [1:03:40] Add caching
- [1:07:16] Deployment via now
- [1:09:45] Add CORS to server code
- [1:11:11] Create client folder
- [1:11:42] Add Bootswatch CDN
- [1:12:21] Start styling
- [1:15:50] Add search logic
- [1:18:58] Show search results on page
- [1:23:04] Create movie page
- [1:41:52] Format date with date-fns
- [1:46:04] Review of what we have built today!
- install the dependencies
npm install
- run the server for the back-end
npm run start
- the server will be available at http://localhost:3000/
- run the server for the front-end
npm run client
- the client will be available at http://localhost:8000/