Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/umar-muneer/conrad-express-tutorial
A short tutorial about expressjs
https://github.com/umar-muneer/conrad-express-tutorial
Last synced: 8 days ago
JSON representation
A short tutorial about expressjs
- Host: GitHub
- URL: https://github.com/umar-muneer/conrad-express-tutorial
- Owner: umar-muneer
- Created: 2021-01-10T10:58:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-25T15:28:24.000Z (over 3 years ago)
- Last Synced: 2023-02-27T22:15:47.288Z (over 1 year ago)
- Language: JavaScript
- Size: 214 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# conrad-express-tutorial
A short tutorial about expressjs## Resources
https://www.npmjs.com/package/express-bunyan-loggerhttp://expressjs.com/en/resources/middleware/body-parser.html
## Sequelize
https://sequelize.org/v4/
### Plan
* Data modeling
* Define models in sequelize
* Define associations
* find, findAll, create, update, delete
* Instances
* Advanced (hooks, scopes, paranoid, transactions)#### Data Modeling
We have three entities1. Courses
2. Students
3. Teachers* A course can have many students
* A student can take many courses
* A course can have one teacher
* A teacher can take many courses**teachers**
id | int
name | string
createdAt | Date
updatedAt | Date**students**
id | int
name | string
createdAt | Date
updatedAt | Date**courses**
id | int
name | string
teacher_id | int
createdAt | Date
updatedAt | Date**course_student**
id | int
student_id | int
course_id | int
grade | string
createdAt | Date
updatedAt | Date# How to run the Database
**docker rm -f mysql && docker run --name=mysql -v /Users/umarmuneer/Documents/mysql-data:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=your-root-password mysql**# How to run the server
**USER=your-db-user PASS=your-db-user-password npx nodemon index.js**