Node JS app for running a youtube's crawler that search and import music videos on mysql database.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Some things you need to install before run the project ✌🏼
$ npm install sequelize
$ npm install mysql2
$ npm install -g sequelize-auto
Create “/config” folder and place there a file called “config.json” with this structure:
"development": {
"username": "<db-user>",
"password": "<db-pasword>",
"database": "<db-name>",
"host": "<db-host>",
"dialect": "mysql",
"youtube_api_key": "<youtube-api-key>",
"last_fm_api_key": "YOUR_LASTFM_API_KEY"
}
Insert your database instance informations and generate YouTube API Key and last.fm key.
Next create the structure of the DB running the command:
$ npm run import:migrations
Now rename file “auto-generate-models-example.sh” into “auto-generate-models.sh” and edit it with your database instance info:
sequelize-auto -o "./Models/BaseStructure/" -d <db-name> -h <db-host> -u <db-user> -p <port> -x <db-password> -e mysql
Final step is about create Models from Database tables schema with running
$ sh ./auto-generate-models.sh
NB: the last step should be repeated every time you want to change your local database schema.
Check into “/models/baseStructure/” list of created Models (number must match with database tables number).
List of tables that must be in your database instance after the migration (see Installing section)
- Artists
- ArtistsAndBands
- Channels
- FavoriteVideos
- Genres
- Productions
- Users
- Videos
- ViewsHistory
Run the node server with hot reloading thanks to Nodemon 🚀
$ npm run nodemon
If you are a more quite person (but promise not to tell anyone) please use 🛵
$ npm run start
- Sequelize - Multi SQL dialect ORM
- Sequelize-auto - Tools for automatically generate models
- Passport - Authentication Middleware
- Conti Matteo - lead of entire project
See also the list of contributors who participated in this project.
This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details