# What is Nodejs? - Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. - Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux. - Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent. ***Reference***: https://www.tutorialspoint.com/nodejs/nodejs_introduction.htm # What is Expressjs? Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy. Express provides a thin layer of fundamental web application features, without obscuring Node.js features that you know and love. ***Referecne***: https://expressjs.com/ ## Frameworks built on Expressjs: Check [Here!](https://expressjs.com/en/resources/frameworks.html) # Practical Talk With Example: We need to Create an attendance system APIs where user can: 1. Register himself on the system 1. Login to the system 1. Check in on a certain time 1. Check out on a certain time 1. List attended users today (check in time, check out time) ## ERD: ![](https://i.imgur.com/5cTh5kZ.png) #### Where: - checkin has default value true. - checkout has default value false. - createdAt will be filled using (sequelize) - updatedAt will be filled using (sequelize) - userId will be filled by us. ## User Stories: 1. User can register to the system. 2. User can login to the system. 3. * User can check in to the system using an API where he can only check in only one time today. * if user check in the second time then an error will be sent as a response. 5. * User check out from the system where he has check in record today. * if there is no check in then an error message will be sent as a response. * if the user check out today then an error message will be sent as a response. 7. Manager can get a list of attended users for this month with counting attended days for each user. ## Technically: - [ ] 1. creating Register API. - [ ] 2. creating middleware to filter unauthenticated users. - [ ] 3. Creating Login API. - [ ] 4. Creating Check In API. - [ ] 5. Creating Check Out API. - [ ] 6. creating Middelware to filter out non-managerial users. - [ ] 7. Creating User attendance counter API ### Resources: [Github Repository to check the full code](https://github.com/poode/simple-attandance-system) [Postman Collection import it inside Postman Application](https://www.getpostman.com/collections/3cd8c2a568b6972444a1) [Simple Regex Explanation Of One Pattern Used](https://regex101.com/r/4X8ogB/1) --------- ## To Learn More: **[Learn Nodejs By Practice](https://nodeschool.io/)** **[freecodecamp.org To learn javascript basics](https://www.freecodecamp.org/learn)** **[expressjs Documentation](http://expressjs.com/en/4x/api.html)**