Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/druchefavour/interview
A project management app that uses Node.js, Express.js (framework), MySQL (database), Sequelize (orm) and Handlebars (templating)
https://github.com/druchefavour/interview
bootstrap css expressjs handlebars html javascript jquery mvc mysql nodejs sequelize
Last synced: 14 days ago
JSON representation
A project management app that uses Node.js, Express.js (framework), MySQL (database), Sequelize (orm) and Handlebars (templating)
- Host: GitHub
- URL: https://github.com/druchefavour/interview
- Owner: druchefavour
- Created: 2017-03-25T18:57:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T06:26:29.000Z (over 7 years ago)
- Last Synced: 2024-08-02T04:02:28.480Z (4 months ago)
- Topics: bootstrap, css, expressjs, handlebars, html, javascript, jquery, mvc, mysql, nodejs, sequelize
- Language: JavaScript
- Homepage:
- Size: 12.3 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README For This Project Management Tool App
This task is to extend this project management app. The app uses Node.js, Express.js (framework), MySQL (database), Sequelize (orm) and Handlebars (templating).
## Procedure
* Add in delete links for tasks and people. But only if the user is logged in.
* Add in the appropriate route for the delete to work.
* If a person gets deleted, cascade the delete to extend to the tasks that the person owns.
* This is what the main page should look like if a user is signed in:
![Editing a person](https://github.com/druchefavour/interview/blob/master/main-page.png)
* Also add in this functionality:
* when clicking a person on the front end, it will take you to a profile for the person showing all the tasks for that person. In addition, you'll be able to edit the person's name and update the person's name. Upon updating, it will redirect you back to this person's profile.
* After complete The profile page looks like this:![Editing a person](https://github.com/druchefavour/interview/blob/master/editing-a-person.png)
## Sequelize
This repository demonstrates the usage of sequelize within an express application.The implemented logic is a simple task tracking tool.
1. create a database called projects_db
* `mysql -u root`
* `create database projects_db;`2. Adjust the `config/config.json` to fit your environment.
3. install modules in package.json
* `npm install`4. install sequelize cli globally to be able to run migrations on your computer:
* `sudo npm install -g sequelize-cli`5. run your migrations to create your tables
* `sequelize db:migrate`6. start up the app
* `nodemon start`if you don't have nodemon
* `npm start`7. then in the browser go to http://localhost:3000
## The following parts are for your own knowledge. You don't need to do this to setup the app.
1. Want to create a migration:
`sequelize migration:create create-`edit the migration file
to run the migration file:
`sequelize db:migrate`You'll still have to make the model file in the models folder
2. curious of all the commands you can do with sequelize cli?
go here: https://github.com/sequelize/cli3. curious of all the sequelize relationships:
http://docs.sequelizejs.com/en/latest/docs/associations/4. In order to associate the models with each other, we changed the models like this:
```js
// task.js
// ...
classMethods: {
associate: function(models) {
Task.belongsTo(models.Person);
}
}
// ...
``````js
// person.js
// ...
classMethods: {
associate: function(models) {
Person.hasMany(models.Task)
}
}
// ...
```