├── .gitignore
├── README.md
├── articles
├── README.md
├── application-requirements-and-landscape
│ ├── README.md
│ ├── Waterfall_model.png
│ ├── agile-model-of-se.png
│ └── devops.png
├── understand-programming-languages
│ └── README.md
└── we-need-freedom
│ └── README.md
├── class-overview
├── Lecture-01
│ ├── README.md
│ ├── Waterfall_model.png
│ ├── agile-model-of-se.png
│ └── devops.png
├── Lecture-02
│ └── README.md
├── Lecture-03
│ ├── Programming Language Landscape.png
│ └── README.md
├── Lecture-04
│ └── README.md
├── Lecture-05-06
│ ├── README.md
│ └── Screenshot_1.png
├── Lecture-07
│ └── README.md
├── Lecture-08
│ └── README.md
├── Lecture-09
│ └── README.md
├── Lecture-10
│ ├── README.md
│ ├── Screenshot_1.png
│ ├── Screenshot_2.png
│ ├── Screenshot_3.png
│ └── event-loop.gif
├── Lecture-11
│ ├── README.md
│ └── Screenshot_1.png
├── Lecture-12
│ ├── README.md
│ ├── decision-tree.jpg
│ ├── disable.jpg
│ ├── enable.jpg
│ ├── login-process.jpg
│ ├── registration-process.jpg
│ └── timesheet.jpg
├── Lecture-13
│ ├── README.md
│ └── images
│ │ └── Screenshot_2.png
├── Lecture-14
│ └── README.md
├── Lecture-15
│ ├── README.md
│ └── images
│ │ ├── 1000.png
│ │ ├── 500.png
│ │ ├── all.png
│ │ ├── books.png
│ │ ├── postreq.png
│ │ └── postres.png
├── Lecture-16
│ ├── README.md
│ └── images
│ │ └── error.png
├── Lecture-17
│ ├── README.md
│ └── images
│ │ ├── bulk.png
│ │ ├── delete.png
│ │ ├── draw-1.png
│ │ ├── draw-2.png
│ │ ├── findbyid.png
│ │ ├── health.png
│ │ ├── sell.png
│ │ ├── sell2.png
│ │ ├── tickets1.png
│ │ ├── ticketsAll-1.png
│ │ ├── ticketsAll-2.png
│ │ ├── ticketsAll-3.png
│ │ ├── ticketsAll-4.png
│ │ ├── update.png
│ │ └── username.png
├── Lecture-18
│ ├── README.md
│ └── images
│ │ ├── Screenshot_1.png
│ │ ├── Screenshot_2.png
│ │ ├── data-duplication.png
│ │ ├── document-oriented.png
│ │ ├── key_value.png
│ │ └── wide_column.png
├── Lecture-19
│ └── README.md
├── Lecture-20
│ ├── README.md
│ └── images
│ │ ├── database-1.png
│ │ ├── db-2.png
│ │ ├── db-3.png
│ │ ├── entity-diagram.png
│ │ ├── error.png
│ │ ├── example.png
│ │ ├── mongodb-1.png
│ │ ├── schematypes.png
│ │ └── success.png
├── Lecture-21
│ └── README.md
├── Lecture-22
│ ├── README.MD
│ └── images
│ │ ├── console.png
│ │ ├── db-1.png
│ │ ├── db-2.png
│ │ ├── login-1.png
│ │ ├── login-2.png
│ │ ├── login-process.jpg
│ │ ├── reg-2.png
│ │ ├── reg-3.png
│ │ ├── reg-4.png
│ │ ├── reg-5.png
│ │ ├── reg-6.png
│ │ ├── register1.png
│ │ └── registration-process.jpg
├── Lecture-23
│ ├── README.md
│ └── images
│ │ ├── auth.png
│ │ ├── bearer.png
│ │ ├── date.png
│ │ ├── decode-1.png
│ │ ├── decode.png
│ │ ├── header.png
│ │ ├── new-db.png
│ │ ├── new-login.png
│ │ ├── new-reg.png
│ │ ├── pvt.png
│ │ ├── tkn-1.png
│ │ ├── tkn-2.png
│ │ ├── token-1.png
│ │ └── v1.png
├── Lecture-24
│ ├── README.md
│ └── images
│ │ ├── del.png
│ │ ├── get-users.png
│ │ ├── getid.png
│ │ ├── getiderr.png
│ │ ├── login-1.png
│ │ ├── new-user.png
│ │ ├── patch.png
│ │ ├── put.png
│ │ ├── reg.png
│ │ ├── unauth.png
│ │ ├── user-crud.png
│ │ └── user-token.png
├── Lecture-25
│ └── README.md
├── Lecture-26
│ ├── README.md
│ └── images
│ │ ├── attend-2.png
│ │ ├── attend-fail.png
│ │ ├── attend.png
│ │ ├── disable.png
│ │ ├── get-enable.png
│ │ ├── notion-2.png
│ │ ├── notion.png
│ │ ├── running-1.png
│ │ ├── running.png
│ │ ├── st-status.png
│ │ ├── status-com.png
│ │ └── status.png
├── Lecture-27
│ ├── Client Server.drawio
│ ├── README.md
│ └── images
│ │ ├── 2021stateofjs.png
│ │ ├── Frontend-Layer.jpg
│ │ ├── backend-client.jpg
│ │ ├── drawio-ext.png
│ │ └── react-overview.jpg
├── Lecture-28
│ └── README.md
├── Lecture-29
│ ├── README.md
│ └── images
│ │ ├── atoms.jpg
│ │ ├── blank.png
│ │ ├── div.png
│ │ ├── dynamic.png
│ │ ├── h1.png
│ │ ├── molecule.jpg
│ │ ├── organism-examples.jpg
│ │ ├── p.png
│ │ ├── page1.jpg
│ │ ├── product_hunt.png
│ │ ├── react-1.png
│ │ ├── react-2.png
│ │ ├── react-3.png
│ │ ├── react-4.png
│ │ ├── react-5.png
│ │ ├── style.png
│ │ └── template1.jpg
└── README.md
├── demo
├── react-demo
│ ├── .gitignore
│ ├── index.html
│ ├── package.json
│ ├── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── App10.jsx
│ │ ├── App2.jsx
│ │ ├── App3.jsx
│ │ ├── App4.jsx
│ │ ├── App5.jsx
│ │ ├── App6.jsx
│ │ ├── App7.jsx
│ │ ├── App8.jsx
│ │ ├── App9.jsx
│ │ ├── App_hook.js
│ │ ├── components
│ │ │ ├── contact-app
│ │ │ │ ├── ContactForm.jsx
│ │ │ │ └── Table.jsx
│ │ │ ├── history
│ │ │ │ ├── HistoryItem.jsx
│ │ │ │ └── HistorySection.jsx
│ │ │ ├── inputs
│ │ │ │ └── InputSection.jsx
│ │ │ ├── operations
│ │ │ │ └── OperationSection.jsx
│ │ │ └── ui
│ │ │ │ ├── Button.jsx
│ │ │ │ └── NumberField.jsx
│ │ ├── hooks
│ │ │ ├── useCounter.js
│ │ │ └── useFetchData.js
│ │ └── main.jsx
│ ├── vite.config.js
│ └── yarn.lock
├── react-structure
│ ├── .gitignore
│ ├── index.html
│ ├── package.json
│ ├── src
│ │ ├── app
│ │ │ ├── App.jsx
│ │ │ ├── App2.jsx
│ │ │ └── App3.jsx
│ │ ├── components
│ │ │ ├── UI
│ │ │ │ ├── buttons
│ │ │ │ │ └── Button.jsx
│ │ │ │ ├── inputs
│ │ │ │ │ ├── Label.jsx
│ │ │ │ │ └── TextInput.jsx
│ │ │ │ └── texts
│ │ │ │ │ └── Text.jsx
│ │ │ ├── shared
│ │ │ │ └── forms
│ │ │ │ │ └── InputGroup.jsx
│ │ │ └── task
│ │ │ │ └── Task.jsx
│ │ ├── hooks
│ │ │ └── useForm.js
│ │ ├── main.css
│ │ ├── main.jsx
│ │ ├── pages
│ │ │ └── dashboard
│ │ │ │ └── index.jsx
│ │ └── utils
│ │ │ └── object-utils.js
│ ├── vite.config.js
│ └── yarn.lock
└── track-zone
│ ├── .gitignore
│ ├── index.html
│ ├── package.json
│ ├── src
│ ├── App.jsx
│ ├── components
│ │ ├── clock-list
│ │ │ ├── clock-list-item.jsx
│ │ │ └── index.jsx
│ │ ├── local-clock
│ │ │ └── index.jsx
│ │ └── shared
│ │ │ ├── clock-actions
│ │ │ └── index.jsx
│ │ │ ├── clock-display
│ │ │ ├── index.jsx
│ │ │ └── index.module.css
│ │ │ └── clock-form
│ │ │ └── index.jsx
│ ├── constants
│ │ └── timezone.js
│ ├── hooks
│ │ ├── useClock.jsx
│ │ ├── useEvents.jsx
│ │ └── useTimer.jsx
│ ├── index.css
│ ├── main.jsx
│ └── utils
│ │ └── timezone.js
│ ├── vite.config.js
│ └── yarn.lock
├── examples
├── README.md
└── icon-box
│ ├── REDME.md
│ ├── icon-box-output.png
│ ├── index.html
│ └── style.css
├── live-classes
└── README.md
├── projects
├── README.md
├── attendance-system
│ └── server
│ │ ├── .gitignore
│ │ ├── controller
│ │ ├── admin-attendance.js
│ │ ├── auth.js
│ │ ├── student-attendance.js
│ │ └── users.js
│ │ ├── db.js
│ │ ├── middleware
│ │ └── authenticate.js
│ │ ├── models
│ │ ├── AdminAttendance.js
│ │ ├── Profile.js
│ │ ├── StudentAttendance.js
│ │ └── User.js
│ │ ├── package.json
│ │ ├── routes
│ │ ├── admin-attendance.js
│ │ ├── auth.js
│ │ ├── index.js
│ │ ├── student-attendance.js
│ │ └── users.js
│ │ ├── server.js
│ │ ├── service
│ │ ├── auth.js
│ │ └── user.js
│ │ ├── utils
│ │ └── error.js
│ │ └── yarn.lock
└── raffle-draw
│ ├── app
│ ├── app.js
│ ├── error.js
│ ├── middleware.js
│ └── routes.js
│ ├── db
│ └── db.js
│ ├── default.env
│ ├── models
│ └── Ticket.js
│ ├── package.json
│ ├── public
│ └── index.html
│ ├── requirements.md
│ ├── routes
│ └── ticket.js
│ ├── server.js
│ ├── test
│ └── test.js
│ └── yarn.lock
├── references
└── README.md
├── resources
├── README.md
├── lecture-0
│ ├── README.md
│ └── lecture0-diagram.jpg
├── lecture-01
│ ├── README.md
│ ├── ps-caffe
│ │ └── README.md
│ ├── sdlc
│ │ └── README.md
│ └── technology
│ │ └── README.md
├── lecture-02
│ └── README.md
├── lecture-03
│ ├── Programming Language Landscape.drawio
│ ├── Programming Language Landscape.png
│ ├── README.md
│ └── app.js
├── lecture-04
│ └── README.md
├── lecture-05
│ ├── README.md
│ └── img
│ │ ├── 1.jpeg
│ │ ├── 10.jpeg
│ │ ├── 11.jpeg
│ │ ├── 2.jpeg
│ │ ├── 3.jpeg
│ │ ├── 4.jpeg
│ │ ├── 5.jpeg
│ │ ├── 6.jpeg
│ │ ├── 7.jpeg
│ │ ├── 8.jpeg
│ │ └── 9.jpeg
├── lecture-06
│ └── README.md
├── lecture-07
│ ├── README.md
│ └── images
│ │ ├── computer-science-distilled.jpg
│ │ ├── elements-of-programming-interviews.jpg
│ │ ├── head-first-js-programming.jpg
│ │ ├── introduction-to-algorithms.jpg
│ │ ├── js-cookbook.jpg
│ │ ├── js-the-definitive-guide.jpg
│ │ ├── js-the-good-parts.jpg
│ │ ├── nodejs-8-the-right-way.jpg
│ │ └── you-dont-know-js.jpg
├── lecture-08
│ └── README.md
├── lecture-09
│ └── README.md
├── lecture-10
│ ├── README.md
│ └── event-loop.gif
├── lecture-11
│ └── README.md
├── lecture-12
│ ├── README.md
│ ├── lec-12.drawio
│ └── visualize-our-model.jpg
├── lecture-13
│ └── README.md
├── lecture-14
│ └── README.md
├── lecture-15
│ └── README.md
├── lecture-16
│ └── README.md
├── lecture-17
│ └── README.md
├── lecture-18
│ └── README.md
├── lecture-19
│ └── README.md
├── lecture-20
│ └── README.md
└── lecture-22
│ └── README.md
├── src
├── README.md
├── attendance-system
│ └── server
│ │ ├── db.js
│ │ ├── models
│ │ ├── AdminAttendance.js
│ │ ├── Profile.js
│ │ ├── StudentAttendance.js
│ │ └── User.js
│ │ ├── package.json
│ │ ├── server.js
│ │ └── yarn.lock
├── lecture-04
│ ├── array.js
│ ├── condition.js
│ ├── function.js
│ ├── loop.js
│ ├── operatorNotes.txt
│ └── variables
│ │ ├── dynamicVariable.js
│ │ └── staticVariable.js
├── lecture-05
│ ├── Array Traverse
│ │ ├── declarativeWay.js
│ │ └── imperativeWay.js
│ ├── arr.js
│ ├── delete.js
│ ├── object.js
│ ├── task.md
│ └── update.js
├── lecture-08
│ └── app.js
├── lecture-09
│ └── app.js
├── lecture-10
│ ├── app.js
│ ├── package.json
│ └── yarn.lock
├── lecture-11
│ ├── app.js
│ ├── package.json
│ └── yarn.lock
├── lecture-13
│ └── attendance-system
│ │ └── server
│ │ ├── models
│ │ ├── AdminAttendance.js
│ │ ├── Profile.js
│ │ ├── StudentAttendance.js
│ │ └── User.js
│ │ ├── package.json
│ │ └── server.js
├── lecture-15
│ ├── package.json
│ ├── server.js
│ └── yarn.lock
├── lecture-16
│ ├── app
│ │ ├── app.js
│ │ ├── error.js
│ │ ├── middleware.js
│ │ └── routes.js
│ ├── default.env
│ ├── package.json
│ ├── public
│ │ └── index.html
│ ├── server.js
│ └── yarn.lock
├── lecture-22
│ └── attendance-system
│ │ └── server
│ │ ├── db.js
│ │ ├── models
│ │ ├── AdminAttendance.js
│ │ ├── Profile.js
│ │ ├── StudentAttendance.js
│ │ └── User.js
│ │ ├── package.json
│ │ ├── server.js
│ │ └── yarn.lock
├── lecture-23
│ └── attendance-system
│ │ └── server
│ │ ├── controller
│ │ └── auth.js
│ │ ├── db.js
│ │ ├── middleware
│ │ └── authenticate.js
│ │ ├── models
│ │ ├── AdminAttendance.js
│ │ ├── Profile.js
│ │ ├── StudentAttendance.js
│ │ └── User.js
│ │ ├── package.json
│ │ ├── routes
│ │ ├── auth.js
│ │ └── index.js
│ │ ├── server.js
│ │ ├── service
│ │ ├── auth.js
│ │ └── user.js
│ │ ├── utils
│ │ └── error.js
│ │ └── yarn.lock
├── lecture-24
│ └── attendance-system
│ │ └── server
│ │ ├── controller
│ │ ├── auth.js
│ │ └── users.js
│ │ ├── db.js
│ │ ├── middleware
│ │ └── authenticate.js
│ │ ├── models
│ │ ├── AdminAttendance.js
│ │ ├── Profile.js
│ │ ├── StudentAttendance.js
│ │ └── User.js
│ │ ├── package.json
│ │ ├── routes
│ │ ├── auth.js
│ │ ├── index.js
│ │ └── users.js
│ │ ├── server.js
│ │ ├── service
│ │ ├── auth.js
│ │ └── user.js
│ │ ├── utils
│ │ └── error.js
│ │ └── yarn.lock
├── lecture-26
│ └── attendance-system
│ │ └── server
│ │ ├── controller
│ │ ├── admin-attendance.js
│ │ ├── auth.js
│ │ ├── student-attendance.js
│ │ └── users.js
│ │ ├── db.js
│ │ ├── middleware
│ │ └── authenticate.js
│ │ ├── models
│ │ ├── AdminAttendance.js
│ │ ├── Profile.js
│ │ ├── StudentAttendance.js
│ │ └── User.js
│ │ ├── package.json
│ │ ├── routes
│ │ ├── admin-attendance.js
│ │ ├── auth.js
│ │ ├── index.js
│ │ ├── student-attendance.js
│ │ └── users.js
│ │ ├── server.js
│ │ ├── service
│ │ ├── auth.js
│ │ └── user.js
│ │ ├── utils
│ │ └── error.js
│ │ └── yarn.lock
├── lecture-29
│ ├── app.js
│ ├── index.html
│ └── react-app
│ │ └── first-app
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ ├── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
│ │ └── yarn.lock
├── mongo-demo
│ ├── index.js
│ ├── package.json
│ └── yarn.lock
└── raffle-draw
│ ├── app
│ ├── app.js
│ ├── error.js
│ ├── middleware.js
│ └── routes.js
│ ├── db
│ └── db.js
│ ├── default.env
│ ├── models
│ └── Ticket.js
│ ├── package.json
│ ├── requirements.md
│ ├── routes
│ └── ticket.js
│ ├── server.js
│ ├── test
│ └── test.js
│ └── yarn.lock
└── timestamp
├── Class - 7.md
├── Class - 8.md
├── Class - 9.md
├── Class 10.md
├── class - 0.md
├── class - 1.md
├── class - 4.md
└── class - 5.md
/README.md:
--------------------------------------------------------------------------------
1 | # FullStack Army - The Most Advanced MERN Stack Resources
2 |
3 | In this repository, you will find source codes, explanations, and other resources for **FullStack Army - Complete MERN Stack Course in Bangla**. It is an open-source repository and feels free to add documentation, examples, and other references when necessary. Please create issues when you get confused or if something does not work. Other members will help you to solve your issues.
4 |
5 | ## Quick Links
6 |
7 | - [Live Classes](live-classes/README.md) - You will find all class links.
8 | - [Articles](articles/README.md) - You will find many articles related to this course.
9 | - [Examples](examples/README.md) - You will find some examples in this directory.
10 | - [Projects](projects/README.md) - You will find all the class projects and other projects in this directory.
11 | - [References](references/README.md) - You will find all references related to this course in this directory.
12 | - [Resources](resources/README.md) - You will find all resources related to this course.
13 | - [Source Code](src/README.md) - You will find all source codes of all classes in this folder.
14 | - [Class Overview](./class-overview/README.md) - You will find the overviews of all classes in this directory
15 |
16 | ### Our Contributors
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/articles/README.md:
--------------------------------------------------------------------------------
1 | # Community Driven Articles
2 |
3 | Write and share your valuable articles for our community. You can write article in both Bengali or English. But Bengali is most preferable for our audiences. You can write single or series articles. To share your article please follow the instructions below.
4 |
5 | **Instructions:**
6 |
7 | - Create a directory inside `articles` for your new article. Give it a proper name for your article or series.
8 | - Put all necessary assets inside your `asset` directory.
9 | - For single article you can simply create a `README.md` file. Share author information at the end of the article.
10 | - For series article use `README.md` file to share your table of contents, basic overview of the series and author information.
11 | - After your pull request being merged make sure you also update `articles/README.md` file with your newly created article link.
12 |
13 | ---
14 |
15 | **Important Articles:**
16 |
17 | _Here we will pin the most important and valuable articles_
18 |
19 | **Article Series:**
20 | _List of all series articles_
21 |
22 | **Articles:**
23 |
24 | - `Programming` [Understand Programming Languages](understand-programming-languages/README.md)
25 | - [Application Requirements and Landscape](./application-requirements-and-landscape/README.md)
26 | - [We Need Freedom, We have to Stop Technology War](./we-need-freedom/README.md)
27 |
--------------------------------------------------------------------------------
/articles/application-requirements-and-landscape/Waterfall_model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/articles/application-requirements-and-landscape/Waterfall_model.png
--------------------------------------------------------------------------------
/articles/application-requirements-and-landscape/agile-model-of-se.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/articles/application-requirements-and-landscape/agile-model-of-se.png
--------------------------------------------------------------------------------
/articles/application-requirements-and-landscape/devops.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/articles/application-requirements-and-landscape/devops.png
--------------------------------------------------------------------------------
/class-overview/Lecture-01/Waterfall_model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-01/Waterfall_model.png
--------------------------------------------------------------------------------
/class-overview/Lecture-01/agile-model-of-se.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-01/agile-model-of-se.png
--------------------------------------------------------------------------------
/class-overview/Lecture-01/devops.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-01/devops.png
--------------------------------------------------------------------------------
/class-overview/Lecture-03/Programming Language Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-03/Programming Language Landscape.png
--------------------------------------------------------------------------------
/class-overview/Lecture-05-06/Screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-05-06/Screenshot_1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-07/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 7 - QNA 1 - Don't Miss The Last Part
2 |
3 | এই লেকচারে কিছু QNA সেশন ছিল। আর কিছু বইয়ের নাম বলা হয়েছে। সেগুলো সব আপনারা এই [লিংক](../../resources/lecture-07/README.md) এ পাবেন। আপনারা ভিডিও দেখে নিজের প্রয়োজনমতো রিসোর্স নিজেরা তৈরি করে নিবেন।
4 |
--------------------------------------------------------------------------------
/class-overview/Lecture-10/Screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-10/Screenshot_1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-10/Screenshot_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-10/Screenshot_2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-10/Screenshot_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-10/Screenshot_3.png
--------------------------------------------------------------------------------
/class-overview/Lecture-10/event-loop.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-10/event-loop.gif
--------------------------------------------------------------------------------
/class-overview/Lecture-11/Screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-11/Screenshot_1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-12/decision-tree.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-12/decision-tree.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-12/disable.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-12/disable.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-12/enable.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-12/enable.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-12/login-process.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-12/login-process.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-12/registration-process.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-12/registration-process.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-12/timesheet.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-12/timesheet.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-13/images/Screenshot_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-13/images/Screenshot_2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-14/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 14 - Backend 1 | Course planning and discussion
2 |
3 | আজ থেকে পূর্বের কিছু ব্যাকএন্ডের ক্লাস নিয়ে আলোচনা হবে। এখানে এক্সপ্রেস নিয়ে বিস্তারিত আলোচনা করা হয়েছিল। সেভাবেই ক্লাসের ওভারভিউ তৈরি হবে। অনেক কিছু আগে আলোচনা হয়েছে এমন টপিকও থাকতে পারে। ক্লাসে যা যা আলোচনা হবে তা যদি আগের ক্লাসেও থেকে থাকে তবুও এখানে আমি লিখবো। শুরু করা যাক।
4 |
5 | ব্যাকএন্ডের মাস্টার লেভেল বলতে কিছু হয় না। যতোই যেতে থাকবেন ততোই মনে হবে শেখা কম পড়ে গেছে। যারা ব্যাকএন্ড ডেভেলপার তারা প্রব্লেম সলভ করতে ভালবাসেন। ব্যাকএন্ডের জন্য প্রব্লেম সলভিং স্কিল অনেক গুরত্বপূর্ণ। কারণ একটা অ্যাপ্লিকেশনের ব্যাকএন্ড অন্য অ্যাপ্লিকেশনে ব্যবহার করা যায় না সাধারণত। ফ্রন্টএন্ডের একটা মজা আছে। তা হলো আমি একটা অ্যাপ্লিকেশনের জন্য যদি একটা কম্পোনেন্ট ডিজাইন করি তাহলে অন্য অ্যাপ্লিকেশনেও আমরা সেই কম্পোনেন্ট ইউজ করতে পারবো। কিন্তু ব্যাকএন্ডের বিজনেস লজিক কখনও এক হয় না। কিছু কিছু মডিউলস ইউজ করা যায়। যেমন লগইন, অথেনটিকেশন। কিন্তু ম্যাক্সিমাম ক্ষেত্রে কিছু চেইঞ্জ থাকবেই।
6 |
7 | আজকের ক্লাসে ব্যাকএন্ড জার্নির একটা কারিকুলাম দেয়া হয়েছে। সেটা নিচে দেয়া হলো।
8 |
9 | - ExpressJS
10 | - MongoDB
11 | - PostgreSQL
12 | - REST API
13 | - GraphQL
14 | - Application Building Process
15 | - Architecture
16 | - Cloud
17 | - Documentation
18 | - Testing
19 | - Unit Testing
20 | - Acceptance Testing
21 | - Caching
22 | - Email and SMS
23 | - Event Driven Development
24 | - Distributed Login
25 | - Serverless
26 | - No code low code
27 |
28 | এগুলোই মূলত এই ক্লাসের আলোচ্য বিষয় ছিল।
29 |
30 | ## AUTHOR
31 |
32 | [Aditya Chakraborty](https://github.com/adityackr)
33 |
--------------------------------------------------------------------------------
/class-overview/Lecture-15/images/1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-15/images/1000.png
--------------------------------------------------------------------------------
/class-overview/Lecture-15/images/500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-15/images/500.png
--------------------------------------------------------------------------------
/class-overview/Lecture-15/images/all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-15/images/all.png
--------------------------------------------------------------------------------
/class-overview/Lecture-15/images/books.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-15/images/books.png
--------------------------------------------------------------------------------
/class-overview/Lecture-15/images/postreq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-15/images/postreq.png
--------------------------------------------------------------------------------
/class-overview/Lecture-15/images/postres.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-15/images/postres.png
--------------------------------------------------------------------------------
/class-overview/Lecture-16/images/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-16/images/error.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/bulk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/bulk.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/delete.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/draw-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/draw-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/draw-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/draw-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/findbyid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/findbyid.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/health.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/health.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/sell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/sell.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/sell2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/sell2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/tickets1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/tickets1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/ticketsAll-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/ticketsAll-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/ticketsAll-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/ticketsAll-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/ticketsAll-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/ticketsAll-3.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/ticketsAll-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/ticketsAll-4.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/update.png
--------------------------------------------------------------------------------
/class-overview/Lecture-17/images/username.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-17/images/username.png
--------------------------------------------------------------------------------
/class-overview/Lecture-18/images/Screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-18/images/Screenshot_1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-18/images/Screenshot_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-18/images/Screenshot_2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-18/images/data-duplication.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-18/images/data-duplication.png
--------------------------------------------------------------------------------
/class-overview/Lecture-18/images/document-oriented.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-18/images/document-oriented.png
--------------------------------------------------------------------------------
/class-overview/Lecture-18/images/key_value.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-18/images/key_value.png
--------------------------------------------------------------------------------
/class-overview/Lecture-18/images/wide_column.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-18/images/wide_column.png
--------------------------------------------------------------------------------
/class-overview/Lecture-19/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 19 - Backend 6 | Adda with Random Topics | You can Skip
2 |
3 | এই ক্লাসে কিছু র্যান্ডম টপিক নিয়ে আলোচনা হয়েছে। সেরকম কোনো বিষয়বস্তু ছিল না। আপনারা চাইলে এটার ভিডিও দেখতে পারেন অথবা স্কিপ করতে পারেন।
4 |
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/database-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/database-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/db-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/db-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/db-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/db-3.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/entity-diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/entity-diagram.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/error.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/example.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/mongodb-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/mongodb-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/schematypes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/schematypes.png
--------------------------------------------------------------------------------
/class-overview/Lecture-20/images/success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-20/images/success.png
--------------------------------------------------------------------------------
/class-overview/Lecture-21/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 21 - QNA on Express 101 and Books
2 |
3 | ## মোটামুটি লেভেলের প্রব্লেম সলভার হতে গেলে কি কি ডাটা স্ট্রাকচার এবং অ্যালগরিদম লাগতে পারে?
4 |
5 | মোটামুটি লেভেলের প্রব্লেম সলভার হতে গেলে নিচের ডাটা স্ট্রাকচার এবং অ্যালগরিদম জানা থাকতে হবে।
6 |
7 | - **ডাটা স্ট্রাকচার**
8 |
9 | - Stack
10 | - Queue
11 | - Linked List
12 | - Tree
13 | - Hashmap
14 | - Hash Table
15 | - Heap
16 |
17 | - **অ্যালগরিদম**
18 |
19 | - Searching Sorting
20 | - Dynamic Programming
21 | - Recursive Programming
22 | - Divide and Conquer
23 |
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/console.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/console.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/db-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/db-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/db-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/db-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/login-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/login-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/login-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/login-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/login-process.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/login-process.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/reg-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/reg-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/reg-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/reg-3.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/reg-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/reg-4.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/reg-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/reg-5.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/reg-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/reg-6.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/register1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/register1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-22/images/registration-process.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-22/images/registration-process.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/auth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/auth.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/bearer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/bearer.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/date.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/decode-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/decode-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/decode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/decode.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/header.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/new-db.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/new-db.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/new-login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/new-login.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/new-reg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/new-reg.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/pvt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/pvt.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/tkn-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/tkn-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/tkn-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/tkn-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/token-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/token-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-23/images/v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-23/images/v1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/del.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/del.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/get-users.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/get-users.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/getid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/getid.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/getiderr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/getiderr.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/login-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/login-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/new-user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/new-user.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/patch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/patch.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/put.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/put.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/reg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/reg.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/unauth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/unauth.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/user-crud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/user-crud.png
--------------------------------------------------------------------------------
/class-overview/Lecture-24/images/user-token.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-24/images/user-token.png
--------------------------------------------------------------------------------
/class-overview/Lecture-25/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 25 - QNA on 5 Recorded Courses and Motivational ADDA
2 |
3 | এখানে আজ কিছু রেকর্ডেড ভিডিওর উপর আলোচনা এবং আড্ডা দেয়া হয়েছে। এখানে আসলে লেখার মতো কিছু নাই। এই QNA সেকশনগুলো আমি লিখবো না। এটা আপনারা শুনবেন। নিজের মতো করে যা যা দরকার সব নিয়ে নিবেন। ভিডিওটা ভাল করে দেখলেই আশা করি হয়ে যাবে।
4 |
5 | ## AUTHOR
6 |
7 | [Aditya Chakraborty](https://github.com/adityackr)
8 |
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/attend-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/attend-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/attend-fail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/attend-fail.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/attend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/attend.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/disable.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/get-enable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/get-enable.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/notion-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/notion-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/notion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/notion.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/running-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/running-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/running.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/st-status.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/st-status.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/status-com.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/status-com.png
--------------------------------------------------------------------------------
/class-overview/Lecture-26/images/status.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-26/images/status.png
--------------------------------------------------------------------------------
/class-overview/Lecture-27/images/2021stateofjs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-27/images/2021stateofjs.png
--------------------------------------------------------------------------------
/class-overview/Lecture-27/images/Frontend-Layer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-27/images/Frontend-Layer.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-27/images/backend-client.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-27/images/backend-client.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-27/images/drawio-ext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-27/images/drawio-ext.png
--------------------------------------------------------------------------------
/class-overview/Lecture-27/images/react-overview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-27/images/react-overview.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-28/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 28 [Frontend 1] - Frontend Course Planning & Discussion
2 |
3 | এই ক্লাসে বুটক্যাম্পের কোর্স আউটলাইন নিয়ে আলোচনা করা হয়েছে। যেহেতু এটা ফুলস্ট্যাক আর্মিতে পরে মার্জ হয়ে গিয়েছে সেহেতু এই আউটলাইন এখন দরকার নেই। তবে এই লেকচার থেকে অনেক কিছু জানতে পারবেন। তাই আপনারা ভিডিওটা দেখবেন এবং আপনাদের প্রয়োজনমতো ইনফরমেশন নিয়ে নিবেন।
4 |
5 | অ্যাপ্লিকেশন বানাতে হলে আগে অ্যাপ্লিকেশন ইউজ করতে জানতে হবে। তাহলে আপনি ফিচার সম্পর্কে জানতে পারবেন। আপনারা ৫টা অ্যাপ্লিকেশন ইউজ করে সেগুলোর ফিচার গুলো নোট করবেন। কোন ফিচারের কাজ কি, কোনটা নতুন দেখছেন, কোনটা আগে একরকম দেখেছেন এখন কিছুটা চেইঞ্জ পাচ্ছেন এসব। অ্যাপ্লিকেশন কি কি ইউজ করবেন? [Product Hunt](https://www.producthunt.com/) এ ঢুকে আপনারা অনেক অ্যাপ্লিকেশনের লিংক পাবেন। সেখান থেকে নিজের পছন্দমতো প্রোডাক্ট ব্যবহার করবেন আর ঐ প্রোডাক্ট সম্পর্কে একটা ডকুমেন্টেশন বানাবেন।
6 |
7 | ## Author
8 |
9 | - [Aditya Chakraborty](https://github.com/adityackr)
10 |
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/atoms.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/atoms.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/blank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/blank.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/div.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/div.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/dynamic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/dynamic.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/h1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/h1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/molecule.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/molecule.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/organism-examples.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/organism-examples.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/p.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/page1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/page1.jpg
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/product_hunt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/product_hunt.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/react-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/react-1.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/react-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/react-2.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/react-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/react-3.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/react-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/react-4.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/react-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/react-5.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/style.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/style.png
--------------------------------------------------------------------------------
/class-overview/Lecture-29/images/template1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/class-overview/Lecture-29/images/template1.jpg
--------------------------------------------------------------------------------
/demo/react-demo/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/demo/react-demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/demo/react-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-demo",
3 | "private": true,
4 | "version": "0.0.0",
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "vite build",
8 | "preview": "vite preview"
9 | },
10 | "dependencies": {
11 | "prop-types": "^15.8.1",
12 | "react": "^18.0.0",
13 | "react-dom": "^18.0.0",
14 | "shortid": "^2.2.16",
15 | "styled-components": "^5.3.5"
16 | },
17 | "devDependencies": {
18 | "@types/react": "^18.0.0",
19 | "@types/react-dom": "^18.0.0",
20 | "@vitejs/plugin-react": "^1.3.0",
21 | "vite": "^2.9.5"
22 | },
23 | "resolutions": {
24 | "styled-components": "^5"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo/react-demo/src/App.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | padding: 0;
4 | box-sizing: border-box;
5 | }
6 |
7 | body {
8 | font-family: Arial, Helvetica, sans-serif;
9 | color: #212121;
10 | }
11 |
12 | .day-card {
13 | width: 300px;
14 | padding: 1rem;
15 | background-color: antiquewhite;
16 | border-radius: 0.25rem;
17 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
18 | }
19 |
20 | .title {
21 | font-size: 1.5rem;
22 | font-weight: 600;
23 | text-align: center;
24 | }
25 |
26 | .sub-title {
27 | font-size: 1.2rem;
28 | font-weight: 500;
29 | text-align: center;
30 | margin-top: 0.5rem;
31 | }
32 |
33 | .tag-ul {
34 | padding: 1rem;
35 | }
36 |
37 | .tag-ul li {
38 | list-style-type: none;
39 | }
40 |
41 | .line {
42 | width: 5rem;
43 | height: 2px;
44 | background-color: #212121;
45 | }
46 |
47 | .notes {
48 | line-height: 1.5;
49 | margin-top: 1rem;
50 | }
51 |
52 | .comments {
53 | margin-top: 1rem;
54 | }
55 |
56 | .comment-item h3 {
57 | font-weight: 600;
58 | font-size: 1.2rem;
59 | }
60 | .comment-item p {
61 | font-size: 0.9rem;
62 | margin-top: 0.5rem;
63 | }
64 |
65 | .tasks {
66 | margin-top: 1rem;
67 | padding: 1rem;
68 | }
69 |
70 | .tasks li {
71 | list-style-type: none;
72 | margin-bottom: 0.5rem;
73 | }
74 |
75 | .cards-group {
76 | display: flex;
77 | align-items: flex-start;
78 | gap: 1rem;
79 | }
80 |
--------------------------------------------------------------------------------
/demo/react-demo/src/App.jsx:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 |
3 | const fontSizes = {
4 | sm: '0.8rem',
5 | md: '1rem',
6 | lg: '1.2rem',
7 | };
8 | const BaseButton = styled.button`
9 | border: none;
10 | border-radius: 0.15rem;
11 | outline: none;
12 | text-transform: uppercase;
13 | letter-spacing: 2px;
14 | padding: 0.5rem 1rem;
15 | cursor: pointer;
16 | font-size: ${(props) => fontSizes[props.size] ?? '1rem'};
17 | `;
18 |
19 | const PrimaryButton = styled(BaseButton)`
20 | background: red;
21 | color: white;
22 | `;
23 |
24 | const App = () => {
25 | return (
26 |
27 |
Styled Component
28 |
29 | I am a button
30 |
31 |
Primary Button
32 |
33 | );
34 | };
35 |
36 | export default App;
37 |
--------------------------------------------------------------------------------
/demo/react-demo/src/App10.jsx:
--------------------------------------------------------------------------------
1 | import useFetchData from './hooks/useFetchData';
2 |
3 | const App = () => {
4 | const users = useFetchData(
5 | 'https://jsonplaceholder.typicode.com/users',
6 | (data) => data.map((item) => ({ id: item.id, name: item.name }))
7 | );
8 | const posts = useFetchData(
9 | 'https://jsonplaceholder.typicode.com/posts',
10 | (data) => data.slice(0, 10)
11 | );
12 | const comments = useFetchData(
13 | 'https://jsonplaceholder.typicode.com/comments',
14 | (data) => data.slice(0, 10)
15 | );
16 |
17 | return (
18 |
26 |
27 |
Users
28 |
29 | {users.loading && Loading...
}
30 | {users.error && {users.error}
}
31 | {users.data?.map((user) => (
32 | {user.name}
33 | ))}
34 |
35 |
36 |
Posts
37 |
38 | {posts.loading && Loading...
}
39 | {posts.error && {posts.error}
}
40 | {posts.data?.map((post) => (
41 | {post.title}
42 | ))}
43 |
44 |
45 |
Comments
46 |
47 | {comments.loading && Loading...
}
48 | {comments.error && {comments.error}
}
49 | {comments.data?.map((post) => (
50 | {post.name}
51 | ))}
52 |
53 |
54 | );
55 | };
56 |
57 | export default App;
58 |
59 | /**
60 | * 1. fetch and update state
61 | * 2. handle loading
62 | * 3. handle error
63 | */
64 |
--------------------------------------------------------------------------------
/demo/react-demo/src/App6.jsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 | import ContactForm from './components/contact-app/ContactForm';
3 | import Table from './components/contact-app/Table';
4 |
5 | const App = () => {
6 | const [contacts, setContacts] = useState([]);
7 | const getContact = (contact) => {
8 | setContacts([].concat(contacts, contact));
9 | };
10 |
11 | return (
12 |
13 |
Contact APP
14 |
15 |
16 |
17 | );
18 | };
19 |
20 | export default App;
21 |
--------------------------------------------------------------------------------
/demo/react-demo/src/App7.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from 'react';
2 |
3 | let timeInterval = null;
4 |
5 | const App = () => {
6 | const [count, setCount] = useState(0);
7 | const [lock, setLock] = useState(false);
8 | const [timeCount, setTimeCount] = useState(5);
9 |
10 | useEffect(() => {
11 | if (count == 5) {
12 | setLock(true);
13 | }
14 | return () => {};
15 | }, [count]);
16 |
17 | /**
18 | * 1. create an interval for timeCount
19 | * 2. set count to 0, set lock to false and time count to 5
20 | */
21 |
22 | useEffect(() => {
23 | if (lock && timeInterval === null) {
24 | timeInterval = setInterval(() => {
25 | setTimeCount((prev) => prev - 1);
26 | }, 1000);
27 | }
28 | }, [lock]);
29 |
30 | useEffect(() => {
31 | if (timeCount === 0) {
32 | clearInterval(timeInterval);
33 | setCount(0);
34 | setLock(false);
35 | setTimeCount(5);
36 | }
37 | }, [timeCount]);
38 |
39 | return (
40 |
41 |
{count}
42 |
49 |
50 | );
51 | };
52 |
53 | export default App;
54 |
--------------------------------------------------------------------------------
/demo/react-demo/src/App8.jsx:
--------------------------------------------------------------------------------
1 | import useApp from './App_hook';
2 |
3 | const App = () => {
4 | const { user, id, loading, max, prevHandler, nextHandler } = useApp();
5 | return (
6 |
7 |
User Detail - {id}
8 | {loading &&
loading...
}
9 | {!loading && user && (
10 |
11 | name: {user.name}
12 |
13 | email: {user.email}
14 |
15 | phone: {user.phone}
16 |
17 | )}
18 |
19 |
22 |
25 |
26 |
27 | );
28 | };
29 |
30 | export default App;
31 |
--------------------------------------------------------------------------------
/demo/react-demo/src/App_hook.js:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from 'react';
2 |
3 | const cacheData = {};
4 |
5 | const useApp = () => {
6 | const [user, setUser] = useState(null);
7 | const [loading, setLoading] = useState(false);
8 | const [id, setId] = useState(1);
9 | const max = 10;
10 |
11 | useEffect(() => {
12 | if (cacheData[`user-${id}`]) {
13 | setUser(cacheData[`user-${id}`]);
14 | return;
15 | }
16 | setLoading(true);
17 | fetchUsers(id)
18 | .then((data) => {
19 | setUser(data);
20 | })
21 | .finally(() => setLoading(false));
22 | }, [id]);
23 |
24 | useEffect(() => {
25 | if (!cacheData[`user-${id + 1}`] && id < max) {
26 | fetchUsers(id + 1);
27 | }
28 | }, [id]);
29 |
30 | const fetchUsers = (id) => {
31 | return fetch(`https://jsonplaceholder.typicode.com/users/${id}`)
32 | .then((res) => res.json())
33 | .then((data) => {
34 | cacheData[`user-${id}`] = data;
35 | return data;
36 | });
37 | };
38 |
39 | const nextHandler = () => {
40 | if (id < max) {
41 | setId(id + 1);
42 | }
43 | };
44 |
45 | const prevHandler = () => {
46 | if (id > 1) {
47 | setId(id - 1);
48 | }
49 | };
50 |
51 | return {
52 | user,
53 | id,
54 | loading,
55 | max,
56 | prevHandler,
57 | nextHandler,
58 | };
59 | };
60 |
61 | export default useApp;
62 |
--------------------------------------------------------------------------------
/demo/react-demo/src/components/contact-app/ContactForm.jsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | const CONTACT_FORM_INIT_STATE = {
4 | name: '',
5 | email: '',
6 | group: '',
7 | };
8 |
9 | const ContactForm = ({ getContact }) => {
10 | const [values, setValues] = useState({ ...CONTACT_FORM_INIT_STATE });
11 | const { name, email, group } = values;
12 |
13 | const handleChange = (e) => {
14 | setValues({
15 | ...values,
16 | [e.target.name]: e.target.value,
17 | });
18 | };
19 |
20 | const handleSubmit = (e) => {
21 | e.preventDefault();
22 | getContact(values);
23 | setValues({ ...CONTACT_FORM_INIT_STATE });
24 | };
25 |
26 | return (
27 |
64 | );
65 | };
66 |
67 | export default ContactForm;
68 |
--------------------------------------------------------------------------------
/demo/react-demo/src/components/history/HistorySection.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import HistoryItem from './HistoryItem';
3 |
4 | const HistorySection = ({ histories, restoredHistory, handleRestoreBtn }) => {
5 | return (
6 |
7 |
History
8 | {histories.length === 0 ? (
9 |
10 | There is no history
11 |
12 | ) : (
13 |
14 | {histories.map((historyItem) => (
15 |
21 | ))}
22 |
23 | )}
24 |
25 | );
26 | };
27 |
28 | HistoryItem.propTypes = {
29 | histories: PropTypes.arrayOf(
30 | PropTypes.shape({
31 | id: PropTypes.number.isRequired,
32 | inputs: PropTypes.shape({
33 | a: PropTypes.number.isRequired,
34 | b: PropTypes.number.isRequired,
35 | }).isRequired,
36 | operation: PropTypes.string.isRequired,
37 | result: PropTypes.number.isRequired,
38 | date: PropTypes.object.isRequired,
39 | })
40 | ),
41 | restoredHistory: PropTypes.number.isRequired,
42 | handleRestoreBtn: PropTypes.func.isRequired,
43 | };
44 |
45 | export default HistorySection;
46 |
--------------------------------------------------------------------------------
/demo/react-demo/src/components/inputs/InputSection.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import NumberField from '../ui/NumberField';
3 |
4 | const InputSection = ({ inputs, handleInputFields }) => {
5 | return (
6 |
14 |
24 | Inputs
25 |
26 |
33 |
38 |
43 |
44 |
45 | );
46 | };
47 |
48 | InputSection.propTypes = {
49 | inputs: PropTypes.shape({
50 | a: PropTypes.number.isRequired,
51 | b: PropTypes.number.isRequired,
52 | }).isRequired,
53 | handleInputFields: PropTypes.func.isRequired,
54 | };
55 |
56 | export default InputSection;
57 |
--------------------------------------------------------------------------------
/demo/react-demo/src/components/operations/OperationSection.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import shortid from 'shortid';
3 | import Button from '../ui/Button';
4 |
5 | const OperationSection = ({ handleArithmeticOps, handleClearOps }) => {
6 | const operations = [
7 | {
8 | id: shortid.generate(),
9 | text: '+',
10 | onClick: () => handleArithmeticOps('+'),
11 | },
12 | {
13 | id: shortid.generate(),
14 | text: '-',
15 | onClick: () => handleArithmeticOps('-'),
16 | },
17 | {
18 | id: shortid.generate(),
19 | text: '*',
20 | onClick: () => handleArithmeticOps('*'),
21 | },
22 | {
23 | id: shortid.generate(),
24 | text: '/',
25 | onClick: () => handleArithmeticOps('/'),
26 | },
27 | {
28 | id: shortid.generate(),
29 | text: '%',
30 | onClick: () => handleArithmeticOps('%'),
31 | },
32 | {
33 | id: shortid.generate(),
34 | text: '**',
35 | onClick: () => handleArithmeticOps('**'),
36 | },
37 | {
38 | id: shortid.generate(),
39 | text: 'clear',
40 | onClick: handleClearOps,
41 | },
42 | ];
43 |
44 | return (
45 |
46 |
Operations
47 |
48 | {operations.map((ops) => (
49 |
54 | ))}
55 |
56 |
57 | );
58 | };
59 |
60 | OperationSection.propTypes = {
61 | handleArithmeticOps: PropTypes.func.isRequired,
62 | handleClearOps: PropTypes.func.isRequired,
63 | };
64 |
65 | export default OperationSection;
66 |
--------------------------------------------------------------------------------
/demo/react-demo/src/components/ui/Button.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 |
3 | const Button = ({ text, onClick, disabled, customStyle }) => {
4 | const disabledStyle = {
5 | backgroundColor: '#999',
6 | color: '#333',
7 | cursor: 'default',
8 | };
9 |
10 | const style = {
11 | padding: '0.25rem 1rem',
12 | backgroundColor: '#ddd',
13 | color: '#212121',
14 | borderRadius: '0.10rem',
15 | cursor: 'pointer',
16 | border: 'none',
17 | ...customStyle,
18 | ...(disabled && disabledStyle),
19 | };
20 |
21 | console.log(customStyle, disabled);
22 |
23 | return (
24 |
27 | );
28 | };
29 |
30 | Button.propTypes = {
31 | text: PropTypes.string.isRequired,
32 | onClick: PropTypes.func.isRequired,
33 | disabled: PropTypes.bool,
34 | customStyle: PropTypes.object,
35 | };
36 |
37 | Button.defaultProps = {
38 | customStyle: {},
39 | disabled: false,
40 | };
41 |
42 | export default Button;
43 |
--------------------------------------------------------------------------------
/demo/react-demo/src/components/ui/NumberField.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 |
3 | const NumberField = ({ value, onChange, name }) => {
4 | const style = {
5 | padding: '0.25rem',
6 | borderRadius: '0.1rem',
7 | border: '1px solid gray',
8 | background: '#fff',
9 | outline: 'none',
10 | width: '100%',
11 | };
12 | return (
13 |
20 | );
21 | };
22 |
23 | NumberField.propTypes = {
24 | value: PropTypes.number.isRequired,
25 | name: PropTypes.string.isRequired,
26 | onChange: PropTypes.func.isRequired,
27 | };
28 |
29 | export default NumberField;
30 |
--------------------------------------------------------------------------------
/demo/react-demo/src/hooks/useCounter.js:
--------------------------------------------------------------------------------
1 | import { useState } from 'react';
2 |
3 | const useCounter = ({ initial = 0, lowerBound = 0, upperBound = 10 }) => {
4 | const [count, setCounter] = useState(initial);
5 |
6 | const handleInc = () => {
7 | if (count < upperBound) {
8 | setCounter(count + 1);
9 | }
10 | };
11 |
12 | const handleDec = () => {
13 | if (count > lowerBound) {
14 | setCounter(count - 1);
15 | }
16 | };
17 |
18 | return {
19 | count,
20 | lowerBound,
21 | upperBound,
22 | handleInc,
23 | handleDec,
24 | };
25 | };
26 |
27 | export default useCounter;
28 |
--------------------------------------------------------------------------------
/demo/react-demo/src/hooks/useFetchData.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from 'react';
2 |
3 | const useFetchData = (url, cb) => {
4 | const [data, setData] = useState(null);
5 | const [loading, setLoading] = useState(false);
6 | const [error, setError] = useState('');
7 |
8 | useEffect(() => {
9 | fetchData();
10 | }, []);
11 |
12 | const fetchData = async () => {
13 | setLoading(true);
14 | try {
15 | const res = await fetch(url);
16 | const result = await res.json();
17 | if (cb) {
18 | setData(cb(result));
19 | } else {
20 | setData(result);
21 | }
22 | setError('');
23 | setLoading(false);
24 | } catch (e) {
25 | setError(e.message);
26 | setLoading(false);
27 | }
28 | };
29 |
30 | return {
31 | data,
32 | loading,
33 | error,
34 | };
35 | };
36 |
37 | export default useFetchData;
38 |
--------------------------------------------------------------------------------
/demo/react-demo/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | // ReactDOM.createRoot(document.getElementById('root')).render(
6 | //
7 | //
8 | //
9 | // );
10 |
11 | ReactDOM.createRoot(document.getElementById('root')).render(
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/demo/react-demo/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()]
7 | })
8 |
--------------------------------------------------------------------------------
/demo/react-structure/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/demo/react-structure/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/demo/react-structure/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-structure",
3 | "private": true,
4 | "version": "0.0.0",
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "vite build",
8 | "preview": "vite preview"
9 | },
10 | "dependencies": {
11 | "react": "^18.0.0",
12 | "react-dom": "^18.0.0",
13 | "styled-components": "^5.3.5"
14 | },
15 | "devDependencies": {
16 | "@types/react": "^18.0.0",
17 | "@types/react-dom": "^18.0.0",
18 | "@vitejs/plugin-react": "^1.3.0",
19 | "vite": "^2.9.9"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/demo/react-structure/src/components/UI/buttons/Button.jsx:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 |
3 | const Button = styled.button`
4 | border: none;
5 | outline: none;
6 | background: #e1e1e1;
7 | color: #333;
8 | border-radius: 0.15rem;
9 | padding: 0.25rem 1rem;
10 | font-size: 0.9rem;
11 | font-family: Arial;
12 | font-weight: 500;
13 | letter-spacing: 0.1rem;
14 | text-transform: uppercase;
15 | cursor: pointer;
16 |
17 | &:hover {
18 | background: #ccc;
19 | }
20 | `;
21 |
22 | export default Button;
23 |
--------------------------------------------------------------------------------
/demo/react-structure/src/components/UI/inputs/Label.jsx:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 |
3 | const fontSizes = {
4 | sm: '0.8rem',
5 | md: '1rem',
6 | lg: '1.1rem',
7 | };
8 |
9 | const lineHeights = {
10 | sm: 1.2,
11 | md: 1.4,
12 | lg: 1.6,
13 | };
14 |
15 | const Label = styled.label`
16 | font-family: Arial;
17 | font-size: ${(props) => fontSizes[props.size] ?? '1rem'};
18 | color: #222;
19 | line-height: ${(props) => lineHeights[props.line] ?? 1.3};
20 | user-select: none;
21 | `;
22 |
23 | export default Label;
24 |
--------------------------------------------------------------------------------
/demo/react-structure/src/components/UI/inputs/TextInput.jsx:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 |
3 | const TextInput = styled.input`
4 | width: 100%;
5 | border: ${(props) =>
6 | props.error ? '2px solid #ff0000' : '1px solid #efefef'};
7 | outline: none;
8 | padding: 0.25rem 0.5rem;
9 | background: transparent;
10 | font-size: 0.9rem;
11 | font-family: Arial;
12 | color: #333;
13 |
14 | &:focus {
15 | border: 2px solid skyblue;
16 | }
17 | `;
18 |
19 | export default TextInput;
20 |
--------------------------------------------------------------------------------
/demo/react-structure/src/components/UI/texts/Text.jsx:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 |
3 | const fontSizes = {
4 | sm: '0.8rem',
5 | md: '1rem',
6 | lg: '1.1rem',
7 | };
8 |
9 | const lineHeights = {
10 | sm: 1.2,
11 | md: 1.4,
12 | lg: 1.6,
13 | };
14 |
15 | const Text = styled.p`
16 | font-family: Arial;
17 | font-size: ${(props) => fontSizes[props.size] ?? '1rem'};
18 | color: #222;
19 | line-height: ${(props) => lineHeights[props.line] ?? 1.3};
20 | `;
21 |
22 | export default Text;
23 |
--------------------------------------------------------------------------------
/demo/react-structure/src/components/shared/forms/InputGroup.jsx:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components';
2 | import TextInput from '../../UI/inputs/TextInput';
3 | import Label from '../../UI/inputs/Label';
4 |
5 | const Container = styled.div`
6 | width: 100%;
7 | padding: 1rem;
8 | border: 1px solid #e1e1e1;
9 | display: flex;
10 | flex-direction: column;
11 | gap: 0.5rem;
12 | `;
13 |
14 | const ErrorMessage = styled.div`
15 | font-size: 0.8rem;
16 | color: red;
17 | `;
18 |
19 | const InputGroup = ({
20 | label,
21 | name,
22 | value,
23 | placeholder,
24 | error,
25 | onChange,
26 | onFocus,
27 | onBlur,
28 | }) => {
29 | return (
30 |
31 |
32 |
42 | {error && {error}}
43 |
44 | );
45 | };
46 |
47 | export default InputGroup;
48 |
--------------------------------------------------------------------------------
/demo/react-structure/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './app/App';
4 | import './main.css';
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render();
7 |
--------------------------------------------------------------------------------
/demo/react-structure/src/pages/dashboard/index.jsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/demo/react-structure/src/pages/dashboard/index.jsx
--------------------------------------------------------------------------------
/demo/react-structure/src/utils/object-utils.js:
--------------------------------------------------------------------------------
1 | export const isObjEmpty = (obj) => {
2 | return Object.keys(obj).length === 0;
3 | };
4 |
5 | export const deepClone = (obj) => {
6 | return JSON.parse(JSON.stringify(obj));
7 | };
8 |
--------------------------------------------------------------------------------
/demo/react-structure/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()]
7 | })
8 |
--------------------------------------------------------------------------------
/demo/track-zone/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/demo/track-zone/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/demo/track-zone/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "track-zone",
3 | "private": true,
4 | "version": "0.0.0",
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "vite build",
8 | "preview": "vite preview"
9 | },
10 | "dependencies": {
11 | "date-fns": "^2.28.0",
12 | "prop-types": "^15.8.1",
13 | "react": "^18.0.0",
14 | "react-dom": "^18.0.0",
15 | "shortid": "^2.2.16",
16 | "styled-components": "^5.3.5"
17 | },
18 | "devDependencies": {
19 | "@types/react": "^18.0.0",
20 | "@types/react-dom": "^18.0.0",
21 | "@vitejs/plugin-react": "^1.3.0",
22 | "vite": "^2.9.9"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/demo/track-zone/src/App.jsx:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from 'react';
2 | import { generate } from 'shortid';
3 | import ClockList from './components/clock-list';
4 | import LocalClock from './components/local-clock';
5 | import ClockDisplay from './components/shared/clock-display';
6 | import useClock from './hooks/useClock';
7 | import useEvents from './hooks/useEvents';
8 | import useTimer from './hooks/useTimer';
9 |
10 | const LOCAL_CLOCK_INIT = {
11 | title: 'My Clock',
12 | timezone: '',
13 | offset: 0,
14 | date: null,
15 | };
16 |
17 | function App() {
18 | const [localClock, setLocalClock] = useState({ ...LOCAL_CLOCK_INIT });
19 | const [clocks, setClocks] = useState([]);
20 |
21 | const updateLocalClock = (data) => {
22 | setLocalClock({
23 | ...localClock,
24 | ...data,
25 | });
26 | };
27 |
28 | const createClock = (clock) => {
29 | clock.id = generate();
30 | setClocks([...clocks, clock]);
31 | };
32 |
33 | const updateClock = (updatedClock) => {
34 | const updatedClocks = clocks.map((clock) => {
35 | if (clock.id === updatedClock.id) return updatedClock;
36 | return clock;
37 | });
38 | setClocks(updatedClocks);
39 | };
40 |
41 | const deleteClock = (id) => {
42 | const updatedClocks = clocks.filter((clock) => clock.id !== id);
43 | setClocks(updatedClocks);
44 | };
45 |
46 | return (
47 |
48 |
53 |
59 |
60 | );
61 | }
62 |
63 | export default App;
64 |
--------------------------------------------------------------------------------
/demo/track-zone/src/components/clock-list/clock-list-item.jsx:
--------------------------------------------------------------------------------
1 | import { formatDistance, addSeconds } from 'date-fns';
2 | import { useState, useEffect } from 'react';
3 | import useClock from '../../hooks/useClock';
4 | import useTimer from '../../hooks/useTimer';
5 | import ClockActions from '../shared/clock-actions';
6 | import ClockDisplay from '../shared/clock-display';
7 |
8 | const ClockListItem = ({ clock, localClock, updateClock, deleteClock }) => {
9 | const { date } = useClock(clock.timezone, clock.offset);
10 | const timer = useTimer(date);
11 |
12 | if (!date || !timer) return null;
13 |
14 | return (
15 |
16 |
22 |
{formatDistance(localClock, timer)}
23 |
28 |
29 | );
30 | };
31 |
32 | export default ClockListItem;
33 |
--------------------------------------------------------------------------------
/demo/track-zone/src/components/clock-list/index.jsx:
--------------------------------------------------------------------------------
1 | import ClockListItem from './clock-list-item';
2 |
3 | const ClockList = ({ clocks, updateClock, deleteClock, localClock }) => {
4 | return (
5 |
6 |
Other Clocks
7 |
8 | {clocks.length === 0 ? (
9 |
There is no clock, please create one.
10 | ) : (
11 |
12 | {clocks.map((clock) => (
13 |
20 | ))}
21 |
22 | )}
23 |
24 | );
25 | };
26 |
27 | export default ClockList;
28 |
--------------------------------------------------------------------------------
/demo/track-zone/src/components/local-clock/index.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react';
2 | import useClock from '../../hooks/useClock';
3 | import useTimer from '../../hooks/useTimer';
4 | import ClockActions from '../shared/clock-actions';
5 | import ClockDisplay from '../shared/clock-display';
6 |
7 | const LocalClock = ({ clock, updateClock, createClock }) => {
8 | const { date, timezone, offset } = useClock(clock.timezone, clock.offset);
9 | const timer = useTimer(date);
10 |
11 | useEffect(() => {
12 | updateClock({
13 | date,
14 | timezone,
15 | offset,
16 | });
17 | }, [date]);
18 |
19 | return (
20 |
21 | {timer && (
22 |
28 | )}
29 |
35 |
36 | );
37 | };
38 |
39 | export default LocalClock;
40 |
--------------------------------------------------------------------------------
/demo/track-zone/src/components/shared/clock-display/index.jsx:
--------------------------------------------------------------------------------
1 | import { format } from 'date-fns';
2 | import classes from './index.module.css';
3 | const ClockDisplay = ({ date, title, timezone, offset }) => {
4 | const offsetHr = offset / 60;
5 | return (
6 |
7 |
Title: {title}
8 |
{format(date, "yyyy-MM-dd hh:mm:ss aaaaa'm'")}
9 |
10 | {timezone}
11 | {offsetHr > 0
12 | ? `+${Math.abs(offsetHr)}`
13 | : `-${Math.abs(offsetHr)}`}
14 |
15 |
16 | );
17 | };
18 |
19 | export default ClockDisplay;
20 |
--------------------------------------------------------------------------------
/demo/track-zone/src/components/shared/clock-display/index.module.css:
--------------------------------------------------------------------------------
1 | .card {
2 | background-color: #ddd;
3 | border-radius: 5px;
4 | border: 1px solid #999;
5 | padding: 10px;
6 | margin-bottom: 10px;
7 | }
8 |
9 | .card h1 {
10 | font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
11 | font-size: 1.2rem;
12 | margin-bottom: 0.5rem;
13 | color: #212121;
14 | }
15 |
--------------------------------------------------------------------------------
/demo/track-zone/src/constants/timezone.js:
--------------------------------------------------------------------------------
1 | export const TIMEZONE_OFFSET = {
2 | PST: -7 * 60,
3 | EST: -4 * 60,
4 | EDT: -4 * 60,
5 | BST: 1 * 60,
6 | MST: -6 * 60,
7 | };
8 |
--------------------------------------------------------------------------------
/demo/track-zone/src/hooks/useClock.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from 'react';
2 | import { addMinutes } from 'date-fns';
3 | import { TIMEZONE_OFFSET } from '../constants/timezone';
4 |
5 | const useClock = (timezone, offset) => {
6 | const [localDate, setLocalDate] = useState(null);
7 | const [localOffset, setLocalOffset] = useState(0);
8 | const [localTimezone, setLocalTimezone] = useState('');
9 | const [utc, setUTC] = useState(null);
10 |
11 | useEffect(() => {
12 | let d = new Date();
13 | const lo = d.getTimezoneOffset();
14 | d = addMinutes(d, lo);
15 | setUTC(d);
16 | setLocalOffset(lo);
17 | }, []);
18 |
19 | useEffect(() => {
20 | if (utc !== null) {
21 | if (timezone) {
22 | offset = TIMEZONE_OFFSET[timezone] ?? offset;
23 | const newUtc = addMinutes(utc, offset);
24 | setLocalDate(newUtc);
25 | } else {
26 | const newUtc = addMinutes(utc, -localOffset);
27 | const dateStrArr = newUtc.toUTCString().split(' ');
28 | setLocalDate(newUtc);
29 | setLocalTimezone(dateStrArr.pop());
30 | }
31 | }
32 | }, [utc, timezone, offset]);
33 |
34 | return {
35 | date: localDate,
36 | dateUTC: utc,
37 | offset: offset || -localOffset,
38 | timezone: timezone || localTimezone,
39 | };
40 | };
41 |
42 | export default useClock;
43 |
--------------------------------------------------------------------------------
/demo/track-zone/src/hooks/useEvents.jsx:
--------------------------------------------------------------------------------
1 | import shortid from 'shortid';
2 | import { useState } from 'react';
3 |
4 | const useEvents = () => {
5 | const [state, setState] = useState({});
6 |
7 | const getEventsByClockId = (clockId) => {
8 | return Object.keys(state).filter((item) => item.startsWith(clockId));
9 | };
10 |
11 | const getEvents = (isArray = false) => {
12 | if (!isArray) return state;
13 | return Object.values(state);
14 | };
15 |
16 | const addEvent = (event) => {
17 | event.id = shortid.generate();
18 | const { id, clockId } = event;
19 | setState((prev) => ({
20 | ...prev,
21 | [`${clockId}|${id}`]: event,
22 | }));
23 | return event;
24 | };
25 |
26 | const deleteEvent = (id) => {
27 | const events = { ...state };
28 | delete events[id];
29 | setState(events);
30 | };
31 |
32 | const deleteEventByClock = (clockId) => {
33 | const events = Object.keys(state).filter(
34 | (item) => !item.startsWith(clockId)
35 | );
36 |
37 | setState(events);
38 | };
39 |
40 | const updateEvent = (updatedEvent, id) => {
41 | const events = { ...state };
42 | events[id] = {
43 | ...events[id],
44 | ...updateEvent,
45 | };
46 | setState(events);
47 | };
48 |
49 | return {
50 | events: state,
51 | getEventsByClockId,
52 | getEvents,
53 | addEvent,
54 | deleteEvent,
55 | deleteEventByClock,
56 | updateEvent,
57 | };
58 | };
59 |
60 | export default useEvents;
61 |
--------------------------------------------------------------------------------
/demo/track-zone/src/hooks/useTimer.jsx:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from 'react';
2 | import { addSeconds } from 'date-fns';
3 |
4 | const useTimer = (date) => {
5 | const [timer, setTimer] = useState(date);
6 |
7 | useEffect(() => {
8 | setTimer(date);
9 | }, [date]);
10 |
11 | let timerId = null;
12 | useEffect(() => {
13 | if (!timer || timerId !== null) return;
14 |
15 | timerId = setInterval(() => {
16 | setTimer(addSeconds(timer, 1));
17 | }, 1000);
18 |
19 | return () => {
20 | clearInterval(timerId);
21 | };
22 | }, [timer]);
23 |
24 | return timer;
25 | };
26 |
27 | export default useTimer;
28 |
--------------------------------------------------------------------------------
/demo/track-zone/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
4 | 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
5 | 'Helvetica Neue', sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
15 | * {
16 | margin: 0;
17 | padding: 0;
18 | box-sizing: border-box;
19 | }
20 |
--------------------------------------------------------------------------------
/demo/track-zone/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 |
10 | )
11 |
--------------------------------------------------------------------------------
/demo/track-zone/src/utils/timezone.js:
--------------------------------------------------------------------------------
1 | import { TIMEZONE_OFFSET } from '../constants/timezone';
2 |
3 | export const getOffset = (start = -11.5, ending = 12) => {
4 | const offsets = [];
5 | for (let i = start; i <= ending; i += 0.5) {
6 | offsets.push(i);
7 | }
8 | return offsets;
9 | };
10 |
11 | export const getTimezone = () => {
12 | return ['UTC', 'GMT', ...Object.keys(TIMEZONE_OFFSET)];
13 | };
14 |
--------------------------------------------------------------------------------
/demo/track-zone/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()]
7 | })
8 |
--------------------------------------------------------------------------------
/examples/README.md:
--------------------------------------------------------------------------------
1 | # Create and Showcase Examples
2 |
3 | Feel free to create examples & components. You can showcase your work directly here. For example, you have designed a card component or a cute nice alert box. You can share your code here with other learners. They can take motivation from your code and design. To get your example accepted, you have to follow the instructions below.
4 |
5 | **Instructions:**
6 |
7 | - Create a directory for your example project. When naming your directory, use lowercase letters and give it a meaningful name.
8 | - Your directory must contain a `README.md` file describing your project, requirements, necessary screenshots, and other resources.
9 | - Must follow a good directory structure.
10 |
--------------------------------------------------------------------------------
/examples/icon-box/REDME.md:
--------------------------------------------------------------------------------
1 | # Dependency
2 | In this simple icon-box example has only one dependency which is fontawesome cdn (https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer)
3 |
4 | # Exposer
5 | This card template is not 100% responsive. It's created just for practice purpose and keep here for beginner developer so that they can learn at least something from this.
6 |
7 | Thank you :)
--------------------------------------------------------------------------------
/examples/icon-box/icon-box-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/examples/icon-box/icon-box-output.png
--------------------------------------------------------------------------------
/examples/icon-box/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | background-color: rgb(228, 221, 221);
4 | padding: 0;
5 | font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
6 | }
7 | p{
8 | font-size: 18px;
9 | letter-spacing:0.05ch;
10 | }
11 | h2{
12 | font-size: 26px;
13 | }
14 |
15 | section.icon-box{
16 | height: 600px;
17 | width: 80%;
18 | margin: auto;
19 | margin-top: 10%;
20 | }
21 |
22 | .icon-box .wrapper{
23 | display: flex;
24 | }
25 |
26 | .icon-box .wrapper .box{
27 | margin: 10px 20px;
28 | padding: 35px 15px;
29 | text-align: center;
30 | background-color: black;
31 | color: #CFC5C3;
32 | border-radius: 10px;
33 | box-shadow: 0 16px 16px -8px gray;
34 | }
35 |
36 | .box:hover{
37 | transition: .4s;
38 | transform: rotateY(180deg);
39 | }
40 |
41 | .box:hover .description{
42 | transform: rotateY(180deg);
43 | }
44 |
45 | .box:hover .title{
46 | transform: rotateY(180deg);
47 | }
48 |
49 | .box:hover i{
50 | transform: rotateY(180deg);
51 | }
52 |
53 | .box i{
54 | font-size: 25px;
55 | }
56 |
57 | .facebook i{
58 | color: #4267B2;
59 | }
60 |
61 | .instagram i{
62 | color: #833AB4;
63 | }
64 | .youtube i{
65 | color: #FF0000;
66 | }
67 |
--------------------------------------------------------------------------------
/projects/README.md:
--------------------------------------------------------------------------------
1 | # Share Your Dummy Projects
2 |
3 | Projects that you have created when you were a learner or if you are a learner share your recent projects that can inspire other peoples to learn and build that awesome projects by themselves.
4 |
5 | To get your project accepted, you have to follow the instructions below.
6 |
7 | **Instructions:**
8 |
9 | - Create a directory for your project. When naming your directory, use lowercase letters and give it a meaningful name.
10 | - Your directory must contain a `README.md` file describing your project, requirements, necessary screenshots, and other resources.
11 | - Must follow a good directory structure.
12 | - Provide a valid `.gitignore` file.
13 | - Make sure anyone can run your project from their local machine. Provide necessary documentations to run locally.
14 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/controller/admin-attendance.js:
--------------------------------------------------------------------------------
1 | const { addMinutes, isAfter } = require('date-fns');
2 | const AdminAttendance = require('../models/AdminAttendance');
3 | const error = require('../utils/error');
4 |
5 | const getEnable = async (_req, res, next) => {
6 | try {
7 | const running = await AdminAttendance.findOne({ status: 'RUNNING' });
8 | if (running) {
9 | throw error('Already Running', 400);
10 | }
11 |
12 | const attendance = new AdminAttendance({});
13 | await attendance.save();
14 | return res.status(201).json({ message: 'Success', attendance });
15 | } catch (e) {
16 | next(e);
17 | }
18 | };
19 |
20 | const getStatus = async (_req, res, next) => {
21 | try {
22 | const running = await AdminAttendance.findOne({ status: 'RUNNING' });
23 | if (!running) {
24 | throw error('Not Running', 400);
25 | }
26 |
27 | const started = addMinutes(
28 | new Date(running.createdAt),
29 | running.timeLimit
30 | );
31 | if (isAfter(new Date(), started)) {
32 | running.status = 'COMPLETED';
33 | await running.save();
34 | }
35 |
36 | return res.status(200).json(running);
37 | } catch (e) {
38 | next(e);
39 | }
40 | };
41 |
42 | const getDisable = async (_req, res, next) => {
43 | try {
44 | const running = await AdminAttendance.findOne({ status: 'RUNNING' });
45 | if (!running) {
46 | throw error('Not Running', 400);
47 | }
48 |
49 | running.status = 'COMPLETED';
50 | await running.save();
51 |
52 | return res.status(200).json(running);
53 | } catch (e) {
54 | next(e);
55 | }
56 | };
57 |
58 | module.exports = {
59 | getEnable,
60 | getDisable,
61 | getStatus,
62 | };
63 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/controller/auth.js:
--------------------------------------------------------------------------------
1 | const { loginService, registerService } = require('../service/auth');
2 |
3 | /**
4 | * Request Input Sources:
5 | - req Body
6 | - req Param
7 | - req Query
8 | - req Header
9 | - req Cookies
10 | */
11 |
12 | const registerController = async (req, res, next) => {
13 | const { name, email, password } = req.body;
14 |
15 | // validation
16 | if (!name || !email || !password) {
17 | return res.status(400).json({ message: 'Invalid Data' });
18 | }
19 | try {
20 | const user = await registerService({ name, email, password });
21 | return res
22 | .status(201)
23 | .json({ message: 'User Created Successfully', user });
24 | } catch (e) {
25 | next(e);
26 | }
27 | };
28 |
29 | const loginController = async (req, res, next) => {
30 | const { email, password } = req.body;
31 | try {
32 | const token = await loginService({ email, password });
33 | return res.status(200).json({ message: 'Login Successful', token });
34 | } catch (e) {
35 | next(e);
36 | }
37 | };
38 |
39 | module.exports = {
40 | loginController,
41 | registerController,
42 | };
43 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/db.js:
--------------------------------------------------------------------------------
1 | const mongoose = require('mongoose');
2 |
3 | function connectDB(connectionStr) {
4 | return mongoose.connect(connectionStr);
5 | }
6 |
7 | module.exports = connectDB;
8 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/middleware/authenticate.js:
--------------------------------------------------------------------------------
1 | const jwt = require('jsonwebtoken');
2 | const User = require('../models/User');
3 |
4 | async function authenticate(req, res, next) {
5 | try {
6 | let token = req.headers.authorization;
7 | if (!token) {
8 | return res.status(401).json({ message: 'Unauthorized' });
9 | }
10 |
11 | token = token.split(' ')[1];
12 | const decoded = jwt.verify(token, 'secret-key');
13 |
14 | const user = await User.findById(decoded._id);
15 | if (!user) {
16 | return res.status(401).json({ message: 'Unauthorized' });
17 | }
18 |
19 | req.user = user;
20 | next();
21 | } catch (e) {
22 | return res.status(400).json({ message: 'Invalid token' });
23 | }
24 | }
25 |
26 | module.exports = authenticate;
27 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/models/AdminAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const adminAttendanceSchema = new Schema(
4 | {
5 | timeLimit: {
6 | type: Number,
7 | required: true,
8 | max: 30,
9 | min: 1,
10 | default: 5,
11 | },
12 | status: {
13 | type: String,
14 | required: true,
15 | enum: ['RUNNING', 'COMPLETED'],
16 | default: 'RUNNING',
17 | },
18 | },
19 | { timestamps: true }
20 | );
21 |
22 | const AdminAttendance = model('AdminAttendance', adminAttendanceSchema);
23 | module.exports = AdminAttendance;
24 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/models/Profile.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const profileSchema = new Schema({
4 | firstName: String,
5 | lastName: String,
6 | phone: String,
7 | avatar: String,
8 | user: {
9 | type: Schema.Types.ObjectId,
10 | ref: 'User',
11 | },
12 | });
13 |
14 | const Profile = model('Profile', profileSchema);
15 | module.exports = Profile;
16 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/models/StudentAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const studentAttendanceSchema = new Schema(
4 | {
5 | user: {
6 | type: Schema.Types.ObjectId,
7 | ref: 'User',
8 | required: true,
9 | },
10 | adminAttendance: {
11 | type: Schema.Types.ObjectId,
12 | ref: 'AdminAttendance',
13 | required: true,
14 | },
15 | },
16 | { timestamps: true }
17 | );
18 |
19 | const StudentAttendance = model('StudentAttendance', studentAttendanceSchema);
20 | module.exports = StudentAttendance;
21 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/models/User.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const userSchema = new Schema({
4 | name: {
5 | type: String,
6 | required: true,
7 | minlength: 3,
8 | maxlength: 30,
9 | },
10 | email: {
11 | type: String,
12 | required: true,
13 | validate: {
14 | validator: function (v) {
15 | return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
16 | },
17 | message: (prop) => `Invalid email: ${prop.value}`,
18 | },
19 | },
20 | password: {
21 | type: String,
22 | minlength: [6, 'password is too short'],
23 | required: true,
24 | },
25 | roles: {
26 | type: [String],
27 | required: true,
28 | default: ['STUDENT'],
29 | },
30 | accountStatus: {
31 | type: String,
32 | enum: ['PENDING', 'ACTIVE', 'REJECTED'],
33 | default: 'PENDING',
34 | required: true,
35 | },
36 | });
37 |
38 | const User = model('User', userSchema);
39 | module.exports = User;
40 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "nodemon server.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "bcryptjs": "^2.4.3",
15 | "date-fns": "^2.28.0",
16 | "express": "^4.17.3",
17 | "jsonwebtoken": "^8.5.1",
18 | "mongoose": "^6.2.4"
19 | },
20 | "devDependencies": {
21 | "nodemon": "^2.0.15"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/routes/admin-attendance.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const {
3 | getDisable,
4 | getEnable,
5 | getStatus,
6 | } = require('../controller/admin-attendance');
7 |
8 | router.get('/enable', getEnable);
9 | router.get('/disable', getDisable);
10 | router.get('/status', getStatus);
11 |
12 | module.exports = router;
13 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/routes/auth.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const { registerController, loginController } = require('../controller/auth');
3 |
4 | router.post('/register', registerController);
5 | router.post('/login', loginController);
6 |
7 | module.exports = router;
8 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/routes/index.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const authRoutes = require('./auth');
3 | const userRoutes = require('./users');
4 | const adminAttendanceRoutes = require('./admin-attendance');
5 | const studentAttendanceRoutes = require('./student-attendance');
6 | const authenticate = require('../middleware/authenticate');
7 |
8 | router.use('/api/v1/auth', authRoutes);
9 | router.use('/api/v1/users', authenticate, userRoutes);
10 | router.use('/api/v1/admin/attendance', authenticate, adminAttendanceRoutes);
11 | router.use('/api/v1/student/attendance', authenticate, studentAttendanceRoutes);
12 |
13 | module.exports = router;
14 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/routes/student-attendance.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const {
3 | getAttendance,
4 | getAttendanceStatus,
5 | } = require('../controller/student-attendance');
6 |
7 | router.get('/status', getAttendanceStatus);
8 | router.get('/:id', getAttendance);
9 |
10 | module.exports = router;
11 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/routes/users.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const userController = require('../controller/users');
3 |
4 | /**
5 | * Get user by id or email
6 | */
7 | router.get('/:userId', userController.getUserByID);
8 |
9 | /**
10 | * Update user by id
11 | * @method PUT
12 | */
13 | router.put('/:userId', userController.putUserById);
14 |
15 | /**
16 | * Update user by id
17 | * @method PATCH
18 | */
19 | router.patch('/:userId', userController.patchUserById);
20 |
21 | /**
22 | * Delete user by id
23 | */
24 | router.delete('/:userId', userController.deleteUserById);
25 |
26 | /**
27 | * Get all users, include
28 | * - filter
29 | * - sort
30 | * - pagination
31 | * - select properties
32 | * @route /api/v1/users?sort=["by","name"]
33 | * @method GET
34 | * @visibility Private
35 | */
36 | router.get('/', userController.getUsers);
37 |
38 | /**
39 | * create a new user
40 | */
41 | router.post('/', userController.postUser);
42 |
43 | module.exports = router;
44 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const connectDB = require('./db');
3 | const authenticate = require('./middleware/authenticate');
4 | const routes = require('./routes');
5 |
6 | const app = express();
7 | app.use(express.json());
8 | app.use(routes);
9 |
10 | app.get('/private', authenticate, async (req, res) => {
11 | console.log('I am the user', req.user);
12 | return res.status(200).json({ message: 'I am a private route' });
13 | });
14 |
15 | app.get('/public', authenticate, (req, res) => {
16 | return res.status(200).json({ message: 'I am a public route' });
17 | });
18 |
19 | app.get('/', (_, res) => {
20 | const obj = {
21 | name: 'Ayman',
22 | email: 'ayman@example.com',
23 | };
24 | res.json(obj);
25 | });
26 |
27 | app.use((err, req, res, next) => {
28 | console.log(err);
29 | const message = err.message ? err.message : 'Server Error Occurred';
30 | const status = err.status ? err.status : 500;
31 |
32 | res.status(status).json({
33 | message,
34 | });
35 | });
36 |
37 | connectDB('mongodb://localhost:27017/attendance-db')
38 | .then(() => {
39 | console.log('Database Connected');
40 | app.listen(4000, () => {
41 | console.log('I am listening on port 4000');
42 | });
43 | })
44 | .catch((e) => console.log(e));
45 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/service/auth.js:
--------------------------------------------------------------------------------
1 | const bcrypt = require('bcryptjs');
2 | const jwt = require('jsonwebtoken');
3 | const { findUserByProperty, createNewUser } = require('./user');
4 | const error = require('../utils/error');
5 |
6 | const registerService = async ({
7 | name,
8 | email,
9 | password,
10 | roles,
11 | accountStatus,
12 | }) => {
13 | let user = await findUserByProperty('email', email);
14 | if (user) throw error('User already exist', 400);
15 |
16 | const salt = await bcrypt.genSalt(10);
17 | const hash = await bcrypt.hash(password, salt);
18 |
19 | return createNewUser({ name, email, password: hash, roles, accountStatus });
20 | };
21 |
22 | const loginService = async ({ email, password }) => {
23 | const user = await findUserByProperty('email', email);
24 | if (!user) throw error('Invalid Credential', 400);
25 |
26 | const isMatch = await bcrypt.compare(password, user.password);
27 | if (!isMatch) throw error('Invalid Credential', 400);
28 |
29 | const payload = {
30 | _id: user._id,
31 | name: user.name,
32 | email: user.email,
33 | roles: user.roles,
34 | accountStatus: user.accountStatus,
35 | };
36 | return jwt.sign(payload, 'secret-key', { expiresIn: '2h' });
37 | };
38 |
39 | module.exports = {
40 | registerService,
41 | loginService,
42 | };
43 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/service/user.js:
--------------------------------------------------------------------------------
1 | const User = require('../models/User');
2 | const error = require('../utils/error');
3 |
4 | const findUsers = () => {
5 | return User.find();
6 | };
7 |
8 | const findUserByProperty = (key, value) => {
9 | if (key === '_id') {
10 | return User.findById(value);
11 | }
12 | return User.findOne({ [key]: value });
13 | };
14 |
15 | const createNewUser = ({ name, email, password, roles, accountStatus }) => {
16 | const user = new User({
17 | name,
18 | email,
19 | password,
20 | roles: roles ? roles : ['STUDENT'],
21 | accountStatus: accountStatus ? accountStatus : 'PENDING',
22 | });
23 | return user.save();
24 | };
25 |
26 | const updateUser = async (id, data) => {
27 | const user = await findUserByProperty('email', data.email);
28 | if (user) {
29 | throw error('Email already in use', 400);
30 | }
31 | return User.findByIdAndUpdate(id, { ...data }, { new: true });
32 | };
33 |
34 | module.exports = {
35 | findUserByProperty,
36 | createNewUser,
37 | findUsers,
38 | updateUser,
39 | };
40 |
--------------------------------------------------------------------------------
/projects/attendance-system/server/utils/error.js:
--------------------------------------------------------------------------------
1 | function error(msg = 'Something Went Wrong', status = 500) {
2 | const e = new Error(msg);
3 | e.status = status;
4 | return e;
5 | }
6 |
7 | module.exports = error;
8 |
--------------------------------------------------------------------------------
/projects/raffle-draw/app/app.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config('../.env');
2 | const express = require('express');
3 | const { errorHandler, notFoundHandler } = require('./error');
4 |
5 | const app = express();
6 |
7 | app.use(require('./middleware'));
8 | app.use(require('./routes'));
9 |
10 | app.use(notFoundHandler);
11 |
12 | app.use(errorHandler);
13 |
14 | module.exports = app;
15 |
--------------------------------------------------------------------------------
/projects/raffle-draw/app/error.js:
--------------------------------------------------------------------------------
1 | const notFoundHandler = (_req, _res, next) => {
2 | const error = new Error('Resource not found');
3 | error.status = 404;
4 | next(error);
5 | };
6 |
7 | const errorHandler = (error, _req, res, _next) => {
8 | if (error.status) {
9 | res.status(error.status).json({
10 | message: error.message,
11 | });
12 | }
13 |
14 | res.status(500).json({ message: 'Something went wrong' });
15 | };
16 |
17 | module.exports = {
18 | notFoundHandler,
19 | errorHandler,
20 | };
21 |
--------------------------------------------------------------------------------
/projects/raffle-draw/app/middleware.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const morgan = require('morgan');
3 | const cors = require('cors');
4 |
5 | const middleware = [morgan('dev'), cors(), express.json()];
6 |
7 | module.exports = middleware;
8 |
--------------------------------------------------------------------------------
/projects/raffle-draw/app/routes.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 |
3 | router.use('/api/v1/tickets', require('../routes/ticket'));
4 |
5 | router.get('/health', (_req, res) => {
6 | res.status(200).json({ message: 'Success' });
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/projects/raffle-draw/default.env:
--------------------------------------------------------------------------------
1 | PORT = 4444
--------------------------------------------------------------------------------
/projects/raffle-draw/models/Ticket.js:
--------------------------------------------------------------------------------
1 | const shortid = require('shortid');
2 |
3 | class Ticket {
4 | /**
5 | * constructor function
6 | * @param {string} username
7 | * @param {number} price
8 | */
9 | constructor(username, price) {
10 | this.id = shortid.generate();
11 | this.username = username;
12 | this.price = price;
13 | this.createdAt = new Date();
14 | this.updatedAt = new Date();
15 | }
16 | }
17 |
18 | module.exports = Ticket;
19 |
--------------------------------------------------------------------------------
/projects/raffle-draw/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lecture-15",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "devDependencies": {
7 | "nodemon": "^2.0.16"
8 | },
9 | "dependencies": {
10 | "cors": "^2.8.5",
11 | "dotenv": "^16.0.1",
12 | "express": "^4.18.1",
13 | "morgan": "^1.10.0",
14 | "shortid": "^2.2.16"
15 | },
16 | "scripts": {
17 | "start": "nodemon server.js"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/projects/raffle-draw/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Hello NodeJS
8 |
9 |
10 | I am from public directory
11 |
12 |
13 |
--------------------------------------------------------------------------------
/projects/raffle-draw/requirements.md:
--------------------------------------------------------------------------------
1 | #### Lottery API
2 |
3 | - sell lottery ticket
4 | - update lottery ticket
5 | - delete lottery ticket
6 | - get all tickets
7 | - get ticket by id
8 | - bulk buy (user can buy multiple tickets at a time)
9 | - raffle draw
10 |
11 | #### Ticket
12 |
13 | - number (unique)
14 | - username
15 | - price
16 | - timestamp
17 |
18 | #### Routes
19 |
20 | - /tickets/t/:ticketId GET - find single ticket
21 | - /tickets/t/:ticketId PATCH - update ticket by id
22 | - /tickets/t/:ticketId DELETE - delete ticket by id
23 | - /tickets/u/:username GET - find tickets for a given user
24 | - /tickets/u/:username PATCH - update tickets for a given user
25 | - /tickets/u/:username DELETE - delete all tickets for a given user
26 | - /tickets/sell - create tickets
27 | - /tickets/bulk - bulk sell ticket
28 | - /tickets/draw
29 | - /tickets/ - find all tickets
30 |
--------------------------------------------------------------------------------
/projects/raffle-draw/server.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config();
2 | const http = require('http');
3 | const app = require('./app/app');
4 |
5 | const server = http.createServer(app);
6 |
7 | const PORT = process.env.PORT || 8000;
8 |
9 | server.listen(PORT, () => {
10 | console.log(`Server is listening on PORT ${PORT}`);
11 | });
12 |
--------------------------------------------------------------------------------
/projects/raffle-draw/test/test.js:
--------------------------------------------------------------------------------
1 | const myDB = require('../db/db');
2 | myDB.create('user 1', 10);
3 | myDB.create('user 2', 10);
4 | myDB.create('user 3', 10);
5 | myDB.create('user 4', 10);
6 | myDB.create('user 5', 10);
7 | const bulk = myDB.bulkCreate('test', 10, 5);
8 | console.log('Bulk', bulk);
9 | const tickets = myDB.find();
10 | console.log('All Tickets', tickets);
11 | const winners = myDB.draw(3);
12 | console.log('Winners', winners);
13 |
--------------------------------------------------------------------------------
/references/README.md:
--------------------------------------------------------------------------------
1 | # Add Necessary References
2 |
3 | Feel free to update this `README.md` file to add additional resources like youtube videos, youtube playlists, articles, books, and other references.
4 |
5 | ## Youtube Videos
6 |
7 | - `CLI` [Command Line Interface For Beginners](https://youtu.be/xF6t9h8iD6I)
8 |
9 | **Youtube Playlists:**
10 |
11 | - `Git` [Git Bangla Tutorial](https://www.youtube.com/playlist?list=PL_XxuZqN0xVDDw5eyzuRDXBzgdnW7UpDF)
12 | - `Development` [Development Essentials - Must Learn](https://www.youtube.com/playlist?list=PL_XxuZqN0xVAebtxbmfZUaq69AS3ST4RZ)
13 | - `JavaScript` [JavaScript All You Need to Know](https://www.youtube.com/playlist?list=PL_XxuZqN0xVAu_dWUVFbscqZdTzE8t6Z1)
14 | - `JavaScript` [Make Fun of JavaScript Array](https://www.youtube.com/playlist?list=PL_XxuZqN0xVDr08QgQHljCecWtA4jBLnS)
15 | - `React JS` [Understand React JS Core Features](https://www.youtube.com/watch?v=sCKGvYTSdKM&list=PL_XxuZqN0xVBANld2gDEE6_0G886zavUs)
16 |
17 | **Articles:**
18 |
19 | **Books:**
20 |
21 | - `FullStack` [FullStack Development - Connecting The Dots](https://www.rokomari.com/book/211527/fullstack-development)
22 | - `Algorithms` [Introduction to Algorithms](https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844)
23 |
24 | **Others:**
25 |
--------------------------------------------------------------------------------
/resources/lecture-0/README.md:
--------------------------------------------------------------------------------
1 | # 0. Full-stack Army - Welcome | Decision-Making Video
2 |
3 | - **Road to a full stack developer**
4 |
5 | 
6 |
--------------------------------------------------------------------------------
/resources/lecture-0/lecture0-diagram.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-0/lecture0-diagram.jpg
--------------------------------------------------------------------------------
/resources/lecture-01/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 1 - Application Requirements & Landscape | Development Big Picture
2 |
3 | - [Problem Solvers Caffe - PS Caffe](ps-caffe/README.md)
4 | - [SDLC](sdlc/README.md)
5 | - [Choose Necessary Technology](technology/README.md)
6 | - [Class Overview](../../class-overview/Lecture-01/README.md)
7 |
--------------------------------------------------------------------------------
/resources/lecture-01/sdlc/README.md:
--------------------------------------------------------------------------------
1 | # SDLC Models
2 |
3 | ### Waterfall Model (Use when requirements do not change frequently)
4 |
5 | 
6 |
7 | ### Agile Model (Use when requirements change frequently)
8 |
9 | 
10 |
--------------------------------------------------------------------------------
/resources/lecture-02/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 2 - We Need Freedom, We have to Stop Technology War
2 |
3 | **Today’s Agenda:**
4 |
5 | - We need freedom, we need to stop technology war
6 | - Why do we need programming language?
7 | - Why different programming languages for client & server?
8 | - Understand programming paradigms.
9 | - Programming is always same, but the language varies.
10 |
11 | **Important Links:**
12 |
13 | - [Programming paradigm - Wikipedia](https://en.wikipedia.org/wiki/Programming_paradigm)
14 | - [List of programming languages by type - Wikipedia](https://en.wikipedia.org/wiki/List_of_programming_languages_by_type)
15 | - [Imperative programming - Wikipedia](https://en.wikipedia.org/wiki/Imperative_programming)
16 | - [Declarative programming - Wikipedia](https://en.wikipedia.org/wiki/Declarative_programming)
17 | - [Functional programming - Wikipedia](https://en.wikipedia.org/wiki/Functional_programming)
18 | - [Object-oriented programming - Wikipedia](https://en.wikipedia.org/wiki/Object-oriented_programming)
19 |
20 | **Class Overview**
21 |
22 | - [Lecture - 02](../../class-overview/Lecture-02/README.md)
23 |
--------------------------------------------------------------------------------
/resources/lecture-03/Programming Language Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-03/Programming Language Landscape.png
--------------------------------------------------------------------------------
/resources/lecture-03/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 3 - Programming Language Foundation - A Bigger Landscape
2 |
3 | - [Programming Language Landscape](./Programming%20Language%20Landscape.png)
4 | - Visualize Programming Syntax e.g. [Scratch](https://scratch.mit.edu/)
5 |
6 | ## When we use function?
7 |
8 | If requirements change frequently, we use function. You can see [this code](./app.js) for a quick understanding.
9 |
10 | ### Important Links
11 |
12 | - [GeeksForGeeks](https://www.geeksforgeeks.org/)
13 | - [Scratch](https://scratch.mit.edu/)
14 | - [Scratch Tutorial Playlist](https://youtube.com/playlist?list=PLym69wpbTIIEkUnqkOznZfQU6lRxebpO3)
15 | - [Class Overview](../../class-overview/Lecture-03/README.md
16 | - [Understanding the origin of fundamental concepts] (https://www.tutorialspoint.com/computer_programming/index.htm)
17 |
18 | ### Today's Task
19 |
20 | - Do a research to find the origins of the fundamentals.
21 |
--------------------------------------------------------------------------------
/resources/lecture-03/app.js:
--------------------------------------------------------------------------------
1 | /* let a = 10 + 20 - 1;
2 | let b = 20 + 30 - 1;
3 | let c = 40 + 50 - 1;
4 | let d = 10 + 20 - 1;
5 | let e = 20 + 30 - 1;
6 | let f = 40 + 50 - 1; */
7 |
8 | let a = myFunction(10, 20);
9 | let b = myFunction(20, 30);
10 | let c = myFunction(40, 50);
11 | let d = myFunction(10, 20);
12 | let e = myFunction(20, 30);
13 | let f = myFunction(40, 50);
14 |
15 | function myFunction(a, b) {
16 | // return a + b - 1;
17 | // return a + b;
18 | return a ** a + b ** b;
19 | }
20 |
21 | /**
22 | * If we have data, make a variable for it
23 | */
24 |
--------------------------------------------------------------------------------
/resources/lecture-05/img/1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/1.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/10.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/10.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/11.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/11.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/2.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/3.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/4.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/5.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/6.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/6.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/7.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/7.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/8.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/8.jpeg
--------------------------------------------------------------------------------
/resources/lecture-05/img/9.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-05/img/9.jpeg
--------------------------------------------------------------------------------
/resources/lecture-07/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 7 - QNA 1 - Don't Miss The Last Part
2 |
3 | ## Important Links
4 |
5 | - **For Development Essentials**
6 | - [Development Essentials - Must Learn](https://youtube.com/playlist?list=PL_XxuZqN0xVAebtxbmfZUaq69AS3ST4RZ)
7 | - **For Problem Solving**
8 | - [Leetcode](https://leetcode.com/)
9 | - [GeeksForGeeks](https://www.geeksforgeeks.org/)
10 | - [San Foundry](https://www.sanfoundry.com/)
11 | - [Hackerrank](https://www.hackerrank.com/)
12 | - **For Digital Electronics and Discrete Mathematics**
13 | - [Neso Academy](https://www.youtube.com/c/nesoacademy)
14 |
15 | ### Book list
16 |
17 | - **Must Read**
18 | - [Computer Science Distilled (For non CSE person)](./images/computer-science-distilled.jpg)
19 | - [Elements of Programming Interviews](./images/elements-of-programming-interviews.jpg)
20 | - [Introduction to Algorithms](./images/introduction-to-algorithms.jpg)
21 | - **For JavaScript**
22 | - [You Don't Know JS Series](./images/you-dont-know-js.jpg)
23 | - [Javascript: The Good Parts](./images/js-the-good-parts.jpg)
24 | - [Node.js 8 The Right Way](./images/nodejs-8-the-right-way.jpg)
25 | - [JavaScript: The Definitive Guide](./images/js-the-definitive-guide.jpg)
26 | - [JavaScript Cookbook](./images/js-cookbook.jpg)
27 |
--------------------------------------------------------------------------------
/resources/lecture-07/images/computer-science-distilled.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/computer-science-distilled.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/elements-of-programming-interviews.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/elements-of-programming-interviews.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/head-first-js-programming.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/head-first-js-programming.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/introduction-to-algorithms.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/introduction-to-algorithms.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/js-cookbook.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/js-cookbook.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/js-the-definitive-guide.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/js-the-definitive-guide.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/js-the-good-parts.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/js-the-good-parts.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/nodejs-8-the-right-way.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/nodejs-8-the-right-way.jpg
--------------------------------------------------------------------------------
/resources/lecture-07/images/you-dont-know-js.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-07/images/you-dont-know-js.jpg
--------------------------------------------------------------------------------
/resources/lecture-10/event-loop.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-10/event-loop.gif
--------------------------------------------------------------------------------
/resources/lecture-12/visualize-our-model.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/resources/lecture-12/visualize-our-model.jpg
--------------------------------------------------------------------------------
/resources/lecture-13/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 13 - Create Models, Write Pseudo Code and Adda
2 |
3 | ## Pseudo code
4 |
5 | ### Authentication
6 |
7 | **Registration Process:**
8 |
9 | ```txt
10 | Start
11 | name = input()
12 | email = input()
13 | password = input()
14 | if name && email && password is invalid:
15 | return 400 error
16 |
17 | user = find user with email
18 | if user found:
19 | return 400 error
20 |
21 | hash = hash password
22 | user = save name, email, hash to user model
23 | return 201
24 | End
25 | ```
26 |
27 | **Login Process:**
28 |
29 | ```txt
30 | Start
31 | email = input()
32 | password = input()
33 |
34 | user = find user with email
35 | if user not found:
36 | return 400 error
37 |
38 | if password not equal to user hash:
39 | return 400 error
40 |
41 | token = generate token using user
42 | return token
43 | End
44 | ```
45 |
46 | ---
47 |
48 | **Progress:**
49 | Follow [this link](https://thirsty-camelotia-a8e.notion.site/Attendance-System-8b5ccfe9b2384e84b904d6a85013170b) to check the progress
50 |
51 | **Source Code**
52 | [Click Here](../../src/lecture-13/)
53 |
54 | **Class Overview:**
55 | [Lecture 13](../../class-overview/Lecture-13/README.md)
56 |
--------------------------------------------------------------------------------
/resources/lecture-14/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 14 - Backend 1 | Course planning and discussion
2 |
3 | ## Curriculum:
4 |
5 | - ExpressJS
6 | - MongoDB
7 | - PostgreSQL
8 | - REST API
9 | - GraphQL
10 | - Application Building Process
11 | - Architecture
12 | - Cloud
13 | - Documentation
14 | - Testing
15 | - Unit Testing
16 | - Acceptance Testing
17 | - Caching
18 | - Email and SMS
19 | - Event Driven Development
20 | - Distributed Login
21 | - Serverless
22 | - No code low code
23 |
24 | ### Task
25 |
26 | - What is Backend Development? What is the responsibilities of Backend developer? Make a research paper about backend journey.
27 |
--------------------------------------------------------------------------------
/resources/lecture-17/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 17 - [Backend 4] Raffle Draw Project
2 |
3 | We will make a lottery app in this class. The details are given below:
4 |
5 | ## Lottery API
6 |
7 | - sell lottery ticket
8 | - update lottery ticket
9 | - delete lottery ticket
10 | - get all tickets
11 | - get ticket by id
12 | - bulk buy (user can buy multiple tickets at a time)
13 | - raffle draw
14 |
15 | ### Ticket
16 |
17 | - number (unique)
18 | - username
19 | - price
20 | - timestamp
21 |
22 | #### Routes
23 |
24 | - /tickets/t/:ticketId GET - find single ticket
25 | - /tickets/t/:ticketId PATCH - update ticket by id
26 | - /tickets/t/:ticketId DELETE - delete ticket by id
27 | - /tickets/u/:username GET - find tickets for a given user
28 | - /tickets/u/:username PATCH - update tickets for a given user
29 | - /tickets/u/:username DELETE - delete all tickets for a given user
30 | - /tickets/sell - create tickets
31 | - /tickets/bulk - bulk sell ticket
32 | - /tickets/draw
33 | - /tickets/ - find all tickets
34 |
35 | #### References
36 |
37 | - [Source Code](../../projects/raffle-draw/)
38 | - [Class Overview](../../class-overview/Lecture-17/README.md)
39 |
40 | #### Tasks
41 |
42 | - Make this app on your own way
43 | - Go to this [link](https://www.mongodb.com/docs/manual/crud/) and study Insert documents, Query documents, Update documents and Delete documents
44 |
--------------------------------------------------------------------------------
/resources/lecture-18/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 18 - [Backend 5] Understand The Concepts of Database
2 |
3 | ## Database Paradigms
4 |
5 | 1. Key Value Database
6 | - [Redis](https://redis.io/)
7 | - [MEMcached](https://www.memcached.org/)
8 | - [Amazon DynamoDB](https://aws.amazon.com/dynamodb/)
9 | 2. Wide-Column Database
10 | - [Cassandra](https://cassandra.apache.org/_/index.html)
11 | - [Apache Hbase](https://hbase.apache.org/)
12 | 3. Document Oriented Database
13 | - [MongoDB](https://mongodb.com/)
14 | - [Firebase](https://firebase.google.com/docs/firestore/)
15 | 4. The Relational Database
16 | - [MySQL](https://www.mysql.com/)
17 | - [PostgreSQL](https://www.postgresql.org/)
18 | - [Microsoft SQL](https://docs.microsoft.com/en-us/sql/)
19 | 5. Graph Database
20 | - [Neo4J](https://neo4j.com/)
21 | 6. A Full Text Search Engine
22 | - [Algolia](https://www.algolia.com/)
23 | - [Elastic Search](https://www.elastic.co/elasticsearch/)
24 | 7. Multi Model Database
25 | - [Fauna DB](https://fauna.com/)
26 |
27 | ### References
28 |
29 | - [7 Database Paradigms](https://tudip.com/blog-post/7-database-paradigms/)
30 | - [Class Overview](../../class-overview/Lecture-18/README.md)
31 |
--------------------------------------------------------------------------------
/resources/lecture-19/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 19 - [Backend 6] Adda with Random Topics | You can Skip
2 |
3 | This video was part of our backend BootCamp. This lecture was given after the Stack Learner's youtube channel got hacked. This is just an adda that may motivate you but you can skip it.
4 |
--------------------------------------------------------------------------------
/resources/lecture-20/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 20 - [Backend 7] Start Working with Mongoose
2 |
3 | This video was part of our backend BootCamp. In this video, we discussed Mongoose the best ORM for MongoDB.
4 |
5 | ## References
6 |
7 | - [MongooseJs](https://mongoosejs.com/)
8 | - [Source Code](../../src/mongo-demo/)
9 | - [Class Overview](../../class-overview/Lecture-20/README.md)
10 |
11 | ## Tasks
12 |
13 | - Study and practice Schemas, SchemaTypes, Connections, Models, Documents, Subdocuments, Queries and Validation from [MongooseJs Docs](https://mongoosejs.com/docs/)
14 |
--------------------------------------------------------------------------------
/resources/lecture-22/README.md:
--------------------------------------------------------------------------------
1 | # Lecture 22 - Authentication System from Pseudo Code to Real Code
2 |
3 | ## Pseudo Code
4 |
5 | ### Authentication
6 |
7 | **Registration Process:**
8 |
9 | ```txt
10 | Start
11 | name = input()
12 | email = input()
13 | password = input()
14 | if name && email && password is invalid:
15 | return 400 error
16 |
17 | user = find user with email
18 | if user found:
19 | return 400 error
20 |
21 | hash = hash password
22 | user = save name, email, hash to user model
23 | return 201
24 | End
25 | ```
26 |
27 | **Login Process:**
28 |
29 | ```txt
30 | Start
31 | email = input()
32 | password = input()
33 |
34 | user = find user with email
35 | if user not found:
36 | return 400 error
37 |
38 | if password not equal to user hash:
39 | return 400 error
40 |
41 | token = generate token using user
42 | return token
43 | End
44 | ```
45 |
46 | **Reset Password:**
47 |
48 | ```txt
49 | Start
50 | new-password = Input()
51 | old-password = Input()
52 | TODO
53 | I
54 | if old-password not equal to user.hash password:
55 | return 400 error
56 | else hashNewPassword = hash new-password
57 | save hashNewPassword
58 | return 201
59 | End
60 | ```
61 |
62 | ---
63 |
64 | **Progress:**
65 | Follow [this link](https://thirsty-camelotia-a8e.notion.site/Attendance-System-8b5ccfe9b2384e84b904d6a85013170b) to check the progress
66 |
67 | **Source Code**
68 | [Click Here](../../src/attendance-system/)
69 |
--------------------------------------------------------------------------------
/src/README.md:
--------------------------------------------------------------------------------
1 | # Full Stack Army - Source Codes
2 |
3 | In this directory, you will find all the necessary source codes that came with this course.
4 |
5 | - [Lecture 4 - Programming Fundamentals using JavaScript](./lecture-04/)
6 | - [Lecture 5 - Array Operations - Imperative vs Declarative](./lecture-05/)
7 | - [Lecture 8 - Understand JavaScript Functions | Function as a value](./lecture-08/app.js)
8 | - [Lecture 9 - Functional Programming in JavaScript](./lecture-09/app.js)
9 | - [Lecture 10 - Asynchronous Programming in JavaScript](./lecture-10/app.js)
10 | - [Lecture 11 - Async Iterator & Generator in JavaScript | Project Requirements](./lecture-11/app.js)
11 | - [Lecture 13 - Create Models, Write Pseudo Code and Adda](./lecture-13/)
12 | - [Lecture 15 - Backend 2 | Introduction to Backend Development](./lecture-15)
13 | - [Lecture 16 - Backend 3 | Understand Express Middleware](./lecture-16/)
14 | - [Lecture 17 - Backend 4 | Raffle Draw Project](./raffle-draw/)
15 | - [Lecture 20 - Backend 7 | Start Working with Mongoose](./mongo-demo/)
16 | - [Lecture 23 - Implement JWT and Refactor The Project Structure](./lecture-23/)
17 | - [Lecture 24 - Implement User CRUD Operations](./lecture-24/)
18 | - [Lecture 26 - Implement Attendance System Main Functionalities](./lecture-26/)
19 | - [Lecture 29 - Frontend 2 - Understand React in A Different Way](./lecture-29/)
20 |
--------------------------------------------------------------------------------
/src/attendance-system/server/db.js:
--------------------------------------------------------------------------------
1 | const mongoose = require('mongoose');
2 |
3 | function connectDB(connectionStr) {
4 | return mongoose.connect(connectionStr);
5 | }
6 |
7 | module.exports = connectDB;
8 |
--------------------------------------------------------------------------------
/src/attendance-system/server/models/AdminAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const adminAttendanceSchema = new Schema({
4 | timeLimit: Number,
5 | status: String,
6 | createdAt: Date,
7 | });
8 |
9 | const AdminAttendance = model('AdminAttendance', adminAttendanceSchema);
10 |
11 | module.exports = AdminAttendance;
12 |
--------------------------------------------------------------------------------
/src/attendance-system/server/models/Profile.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const profileSchema = new Schema({
4 | firstName: String,
5 | lastName: String,
6 | phone: String,
7 | avatar: String,
8 | user: {
9 | type: Schema.Types.ObjectId,
10 | ref: 'User',
11 | },
12 | });
13 |
14 | const Profile = model('Profile', profileSchema);
15 |
16 | module.exports = Profile;
17 |
--------------------------------------------------------------------------------
/src/attendance-system/server/models/StudentAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const studentAttendanceSchema = new Schema({
4 | createdAt: Date,
5 | user: {
6 | type: Schema.Types.ObjectId,
7 | ref: 'User',
8 | },
9 | adminAttendance: {
10 | type: Schema.Types.ObjectId,
11 | ref: 'AdminAttendance',
12 | },
13 | });
14 |
15 | const StudentAttendance = model('StudentAttendance', studentAttendanceSchema);
16 |
17 | module.exports = StudentAttendance;
18 |
--------------------------------------------------------------------------------
/src/attendance-system/server/models/User.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const userSchema = new Schema({
4 | name: {
5 | type: String,
6 | required: true,
7 | minlength: 3,
8 | maxlength: 10,
9 | },
10 | email: {
11 | type: String,
12 | required: true,
13 | validate: {
14 | validator: function (v) {
15 | return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
16 | },
17 | message: (prop) => `Invalid Email: ${prop.value}`,
18 | },
19 | },
20 | password: {
21 | type: String,
22 | minlength: [6, 'Password is too short'],
23 | required: true,
24 | },
25 | roles: {
26 | type: [String],
27 | required: true,
28 | default: ['STUDENT'],
29 | },
30 | accountStatus: {
31 | type: String,
32 | enum: ['PENDING', 'ACTIVE', 'REJECTED'],
33 | default: 'PENDING',
34 | required: true,
35 | },
36 | });
37 |
38 | const User = model('User', userSchema);
39 |
40 | module.exports = User;
41 |
--------------------------------------------------------------------------------
/src/attendance-system/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "nodemon server.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "bcryptjs": "^2.4.3",
15 | "express": "^4.18.1",
16 | "mongoose": "^6.3.3"
17 | },
18 | "devDependencies": {
19 | "nodemon": "^2.0.16"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/lecture-04/condition.js:
--------------------------------------------------------------------------------
1 | // Scenario 1 - One Branch
2 |
3 | if (studyBasic) {
4 | }
5 | if (studyAdvanced) {
6 | }
7 | if (teacherSpeaks) {
8 | }
9 | if (!teacherSpeaks) {
10 | shout();
11 | }
12 |
13 | // Scenario 2 - Two Branch
14 | // If else condition
15 |
16 | if (toss === head) {
17 | win();
18 | } else {
19 | lose();
20 | }
21 |
22 | // Scenario 3 - Multiple Branch
23 | if (1 > 0) {
24 | big();
25 | } else if (1 < 0) {
26 | small();
27 | } else {
28 | same();
29 | }
30 |
--------------------------------------------------------------------------------
/src/lecture-04/function.js:
--------------------------------------------------------------------------------
1 | const student1 = {
2 | firstName: 'Maruf',
3 | lastName: 'Sarker',
4 | email: 'maruf@example.com',
5 | age: 27,
6 | attend: true
7 | }
8 | const student2 = {
9 | firstName: 'Asif',
10 | lastName: 'Sarker',
11 | email: 'asif@example.com',
12 | age: 27,
13 | attend: true
14 | }
15 | const student3 = {
16 | firstName: 'Lisan',
17 | lastName: 'Sarker',
18 | email: 'lisan@example.com',
19 | age: 27,
20 | attend: true
21 | }
22 |
23 | const allStudents = [student1, student2, student3]
24 |
25 | allStudents.forEach(item => {
26 | console.log('Fullname: ' + item.firstName + " " + item.lastName)
27 | })
28 |
29 |
30 | // function with error handling
31 | function nameOfTheFunction(name){
32 | if(!name){
33 | console.log('Please provide your name');
34 | }else{
35 | console.log("Hello", name)
36 | }
37 | }
38 |
39 | nameOfTheFunction("Maruf")
40 | nameOfTheFunction("Sakib")
41 | nameOfTheFunction()
42 |
43 |
44 | // generate random number
45 | const generateRandomNumber = (min,max) => {
46 | return Math.floor(Math.random()*(max-min+1)+min);
47 | }
48 |
49 | console.log(generateRandomNumber(5, 10))
--------------------------------------------------------------------------------
/src/lecture-04/loop.js:
--------------------------------------------------------------------------------
1 | console.log("Shakar Hossain");
2 | console.log("Shakar Hossain");
3 | console.log("Shakar Hossain");
4 | console.log("Shakar Hossain");
5 | console.log("Shakar Hossain");
6 | console.log("Shakar Hossain");
7 | console.log("Shakar Hossain");
8 | console.log("Shakar Hossain");
9 | console.log("Shakar Hossain");
10 | console.log("Shakar Hossain");
11 | console.log("Shakar Hossain");
12 |
13 | // repeat 100 console.log("Shakar Hossain")
14 |
15 | for (let i = 1; i <= 100; i++) {
16 | // its a new js file
17 | // we can write any valid js code here
18 | // every code written inside this block will execute multiple times
19 | console.log(i, "Shakar Hossain");
20 | }
21 |
22 | // There are total three types of loop available in js
23 | // 1. For (When we know the range)
24 | // 2. While (When we don't know the range)
25 | // 3. Do While *
26 |
27 | // While loop
28 | while (true) {
29 | let num = Math.ceil(Math.random() * 100);
30 | console.log("Shakar Hossain");
31 | if (num === 99) {
32 | break;
33 | }
34 | }
35 |
36 | // Do While Loop
37 | do {
38 | console.log("I love my country");
39 | } while (false);
40 |
--------------------------------------------------------------------------------
/src/lecture-04/operatorNotes.txt:
--------------------------------------------------------------------------------
1 | operator: mathematical representation
2 |
3 | add()
4 |
5 | mod()
6 |
7 | lessThan() val1 < val2
--------------------------------------------------------------------------------
/src/lecture-04/variables/dynamicVariable.js:
--------------------------------------------------------------------------------
1 | const names = ["Abu Rayhan", "Shaker Hossian", "Akib Ahmed", "Alvi Chowdhuri"];
2 |
3 | let index = -1;
4 | let name = names[++index];
5 |
6 | setInterval(() => {
7 | name = names[index++];
8 | console.log(name, name.length);
9 |
10 | if (index === names.length) {
11 | index = 0;
12 | }
13 | }, 1000);
14 |
--------------------------------------------------------------------------------
/src/lecture-04/variables/staticVariable.js:
--------------------------------------------------------------------------------
1 | const names = ["Abu Rayhan", "Shaker Hossian", "Akib Ahmed", "Alvi Chowdhuri"];
2 |
3 | let index = -1;
4 | let name = names[++index];
5 |
6 | setInterval(() => {
7 | name = names[index++];
8 | console.log("Abu Rayhan", "Abu Rayhan".length);
9 |
10 | if (index === names.length) {
11 | index = 0;
12 | }
13 | }, 1000);
14 |
--------------------------------------------------------------------------------
/src/lecture-05/Array Traverse/declarativeWay.js:
--------------------------------------------------------------------------------
1 | const numbers = [1, 2, 3, 4, 5];
2 |
3 | // sum of array elements
4 | sum = 0;
5 | numbers.forEach((element) => {
6 | sum += element;
7 | });
8 | console.log(sum);
9 |
10 |
11 | const cb = () => {
12 | console.log('Hello')
13 | }
14 | numbers.forEach(cb)
15 | // Hello
16 | // Hello
17 | // Hello
18 | // Hello
19 | // Hello
20 |
21 |
22 | numbers.forEach(function (value, index, arr) {
23 | // console.log(arguments)
24 | console.log(value, index, arr)
25 | })
26 | // [Arguments] { '0': 1, '1': 0, '2': [ 1, 2, 3, 4, 5 ] }
27 | // [Arguments] { '0': 2, '1': 1, '2': [ 1, 2, 3, 4, 5 ] }
28 | // [Arguments] { '0': 3, '1': 2, '2': [ 1, 2, 3, 4, 5 ] }
29 | // [Arguments] { '0': 4, '1': 3, '2': [ 1, 2, 3, 4, 5 ] }
30 | // [Arguments] { '0': 5, '1': 4, '2': [ 1, 2, 3, 4, 5 ] }
31 |
32 |
33 | numbers.forEach(function (value, _, __) {
34 | if(value % 2 === 0){
35 | console.log(value)
36 | }
37 | })
38 |
39 | sum = 0;
40 | numbers.forEach(function (v) {
41 | sum += v
42 | })
43 |
44 | console.log(sum)
45 |
--------------------------------------------------------------------------------
/src/lecture-05/Array Traverse/imperativeWay.js:
--------------------------------------------------------------------------------
1 | const numbers = [1, 2, 3, 4, 5];
2 |
3 | let sum = 0;
4 | for (let i = 0; i < numbers.length; i++) {
5 | sum += numbers[i];
6 | }
7 |
--------------------------------------------------------------------------------
/src/lecture-05/arr.js:
--------------------------------------------------------------------------------
1 | const arr = [1, 2, 3, null, false, 4, 5, "", "test", 6, 7];
2 |
3 | let count = 0;
4 | for (let i = 0; i < arr.length; i++) {
5 | for (let j = i; j < arr.length - 1; j++) {
6 | if (!arr[j] || typeof arr[j] !== "number") {
7 | arr[j] = arr[j + 1];
8 | arr[j + 1] = undefined;
9 | }
10 | }
11 | if (arr[i] === undefined) {
12 | count++;
13 | }
14 | }
15 | arr.length -= count;
16 | console.log(arr);
17 |
18 | // explanation
19 | // arr = [1, false, true, '', 2, 3]
20 | // i = 1, j = 3
21 | // 1, true, '', 2, 3, undefined
22 | // i = true, j = 3
23 | // 1, '', 2, 3, undefined, undefined
24 | // i = '', j = 3
25 | // 1, 2, 3, undefined, undefined, undefined
26 |
27 | // [1, 2, 3]
28 |
29 |
30 | // shortcut
31 | const filteredArray = arr.filter((v) => typeof v === 'number')
32 |
33 | console.log(filteredArray);
34 |
35 |
36 | // using new array
37 | const newArr = []
38 | for(let i = 0; i < arr.length; i++){
39 | if(typeof arr[i] === 'number'){
40 | newArr.push(arr[i])
41 | }
42 | }
43 | console.log(newArr);
44 |
45 |
46 | // calculate fibonnacci number
47 | function fib(n){
48 | if(n == 0 || n == 1) return n;
49 | return fib(n - 1) + fib(n - 2)
50 | }
51 |
52 | console.log(fib(10));
--------------------------------------------------------------------------------
/src/lecture-05/delete.js:
--------------------------------------------------------------------------------
1 | const arr = [
2 | {
3 | id: 1,
4 | value: 10,
5 | },
6 | {
7 | id: 2,
8 | value: 20,
9 | },
10 | {
11 | id: 3,
12 | value: 30,
13 | },
14 | {
15 | id: 4,
16 | value: 40,
17 | },
18 | {
19 | id: 5,
20 | value: 50,
21 | },
22 | ];
23 |
24 |
25 | // splice ==> mutable
26 | // const index = arr.findIndex(item => {
27 | // item.id === 4
28 | // })
29 | // const arr1 = arr.splice(index, 1)
30 | // console.log(arr);
31 |
32 |
33 | // filter ==> immutable
34 | const arr2 = arr.filter(item => {
35 | return item.id !== 4
36 | })
37 | console.log(arr);
38 | console.log(arr2);
--------------------------------------------------------------------------------
/src/lecture-05/task.md:
--------------------------------------------------------------------------------
1 | - [Make Fun Of Javascript Array](https://youtube.com/playlist?list=PL_XxuZqN0xVDr08QgQHljCecWtA4jBLnS)
--------------------------------------------------------------------------------
/src/lecture-05/update.js:
--------------------------------------------------------------------------------
1 | const arr = [
2 | {
3 | id: 1,
4 | value: 10,
5 | },
6 | {
7 | id: 2,
8 | value: 20,
9 | },
10 | {
11 | id: 3,
12 | value: 30,
13 | },
14 | {
15 | id: 4,
16 | value: 40,
17 | },
18 | {
19 | id: 5,
20 | value: 50,
21 | },
22 | ];
23 |
24 | // arr.findIndex ==> not mutable
25 | // const index = arr.findIndex(v => {
26 | // return v.id === 4;
27 | // })
28 |
29 | // console.log(index);
30 | // console.log(arr);
31 | // arr[index].value = 100
32 | // console.log(arr);
33 |
34 |
35 |
36 | // arr.find ==> mutable
37 | const obj = arr.find((v) => {
38 | return v.id === 4;
39 | });
40 | obj.value = 100;
41 | console.log(obj);
42 | console.log(arr);
43 |
44 |
45 |
46 | const obj2 = arr[2]
47 | obj2.value = 300
48 | console.log(obj);
49 | console.log(arr);
--------------------------------------------------------------------------------
/src/lecture-10/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lecture-10",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "app.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "axios": "^0.26.1"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/lecture-10/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 | axios@^0.26.1:
6 | version "0.26.1"
7 | resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9"
8 | integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==
9 | dependencies:
10 | follow-redirects "^1.14.8"
11 |
12 | follow-redirects@^1.14.8:
13 | version "1.14.9"
14 | resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
15 | integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==
16 |
--------------------------------------------------------------------------------
/src/lecture-11/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lecture-11",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "app.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "axios": "^0.27.2"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/lecture-13/attendance-system/server/models/AdminAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const adminAttendanceSchema = new Schema({
4 | timeLimit: Number,
5 | status: String,
6 | createdAt: Date,
7 | });
8 |
9 | const AdminAttendance = model('AdminAttendance', adminAttendanceSchema);
10 |
11 | module.exports = AdminAttendance;
12 |
--------------------------------------------------------------------------------
/src/lecture-13/attendance-system/server/models/Profile.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const profileSchema = new Schema({
4 | firstName: String,
5 | lastName: String,
6 | phone: String,
7 | avatar: String,
8 | user: {
9 | type: Schema.Types.ObjectId,
10 | ref: 'User',
11 | },
12 | });
13 |
14 | const Profile = model('Profile', profileSchema);
15 |
16 | module.exports = Profile;
17 |
--------------------------------------------------------------------------------
/src/lecture-13/attendance-system/server/models/StudentAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const studentAttendanceSchema = new Schema({
4 | createdAt: Date,
5 | user: {
6 | type: Schema.Types.ObjectId,
7 | ref: 'User',
8 | },
9 | adminAttendance: {
10 | type: Schema.Types.ObjectId,
11 | ref: 'AdminAttendance',
12 | },
13 | });
14 |
15 | const StudentAttendance = model('StudentAttendance', studentAttendanceSchema);
16 |
17 | module.exports = StudentAttendance;
18 |
--------------------------------------------------------------------------------
/src/lecture-13/attendance-system/server/models/User.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const userSchema = new Schema({
4 | name: String,
5 | email: String,
6 | password: String,
7 | roles: [String],
8 | accountStatus: String,
9 | });
10 |
11 | const User = model('User', userSchema);
12 |
13 | module.exports = User;
14 |
--------------------------------------------------------------------------------
/src/lecture-13/attendance-system/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "nodemon server.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "express": "^4.18.1",
15 | "mongoose": "^6.3.3"
16 | },
17 | "devDependencies": {
18 | "nodemon": "^2.0.16"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/lecture-13/attendance-system/server/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const app = express();
3 |
4 | app.get('/', (req, res) => {
5 | const obj = {
6 | name: 'Ayman',
7 | email: 'ayman@example.com',
8 | };
9 | res.json(obj);
10 | });
11 |
12 | app.listen(4000, () => {
13 | console.log("I'm listening on port 4000");
14 | });
15 |
--------------------------------------------------------------------------------
/src/lecture-15/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lecture-15",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "devDependencies": {
7 | "nodemon": "^2.0.16"
8 | },
9 | "dependencies": {
10 | "express": "^4.18.1"
11 | },
12 | "scripts": {
13 | "start": "nodemon server.js"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/lecture-16/app/app.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config('../.env');
2 | const express = require('express');
3 | const { errorHandler, notFoundHandler } = require('./error');
4 |
5 | const app = express();
6 |
7 | app.use(require('./middleware'));
8 | app.use(require('./routes'));
9 |
10 | app.use(notFoundHandler);
11 |
12 | app.use(errorHandler);
13 |
14 | module.exports = app;
15 |
--------------------------------------------------------------------------------
/src/lecture-16/app/error.js:
--------------------------------------------------------------------------------
1 | const notFoundHandler = (_req, _res, next) => {
2 | const error = new Error('Resource not found');
3 | error.status = 404;
4 | next(error);
5 | };
6 |
7 | const errorHandler = (error, _req, res, _next) => {
8 | if (error.status) {
9 | res.status(error.status).json({
10 | message: error.message,
11 | });
12 | }
13 |
14 | res.status(500).json({ message: 'Something went wrong' });
15 | };
16 |
17 | module.exports = {
18 | notFoundHandler,
19 | errorHandler,
20 | };
21 |
--------------------------------------------------------------------------------
/src/lecture-16/app/middleware.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const morgan = require('morgan');
3 | const cors = require('cors');
4 |
5 | const middleware = [morgan('dev'), cors(), express.json()];
6 |
7 | module.exports = middleware;
8 |
--------------------------------------------------------------------------------
/src/lecture-16/app/routes.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 |
3 | router.get('/health', (_req, res) => {
4 | res.status(200).json({ message: 'Success' });
5 | });
6 |
7 | module.exports = router;
8 |
--------------------------------------------------------------------------------
/src/lecture-16/default.env:
--------------------------------------------------------------------------------
1 | PORT = 4444
--------------------------------------------------------------------------------
/src/lecture-16/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lecture-16",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "devDependencies": {
7 | "nodemon": "^2.0.18"
8 | },
9 | "dependencies": {
10 | "cors": "^2.8.5",
11 | "dotenv": "^16.0.1",
12 | "express": "^4.18.1",
13 | "morgan": "^1.10.0"
14 | },
15 | "scripts": {
16 | "start": "nodemon server.js"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/lecture-16/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Hello NodeJS
8 |
9 |
10 | I am from public directory
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/lecture-16/server.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config();
2 | const http = require('http');
3 | const app = require('./app/app');
4 |
5 | const server = http.createServer(app);
6 |
7 | const PORT = process.env.PORT || 8000;
8 |
9 | server.listen(PORT, () => {
10 | console.log(`Server is listening on PORT ${PORT}`);
11 | });
12 |
--------------------------------------------------------------------------------
/src/lecture-22/attendance-system/server/db.js:
--------------------------------------------------------------------------------
1 | const mongoose = require('mongoose');
2 |
3 | function connectDB(connectionStr) {
4 | return mongoose.connect(connectionStr);
5 | }
6 |
7 | module.exports = connectDB;
8 |
--------------------------------------------------------------------------------
/src/lecture-22/attendance-system/server/models/AdminAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const adminAttendanceSchema = new Schema({
4 | timeLimit: Number,
5 | status: String,
6 | createdAt: Date,
7 | });
8 |
9 | const AdminAttendance = model('AdminAttendance', adminAttendanceSchema);
10 |
11 | module.exports = AdminAttendance;
12 |
--------------------------------------------------------------------------------
/src/lecture-22/attendance-system/server/models/Profile.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const profileSchema = new Schema({
4 | firstName: String,
5 | lastName: String,
6 | phone: String,
7 | avatar: String,
8 | user: {
9 | type: Schema.Types.ObjectId,
10 | ref: 'User',
11 | },
12 | });
13 |
14 | const Profile = model('Profile', profileSchema);
15 |
16 | module.exports = Profile;
17 |
--------------------------------------------------------------------------------
/src/lecture-22/attendance-system/server/models/StudentAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const studentAttendanceSchema = new Schema({
4 | createdAt: Date,
5 | user: {
6 | type: Schema.Types.ObjectId,
7 | ref: 'User',
8 | },
9 | adminAttendance: {
10 | type: Schema.Types.ObjectId,
11 | ref: 'AdminAttendance',
12 | },
13 | });
14 |
15 | const StudentAttendance = model('StudentAttendance', studentAttendanceSchema);
16 |
17 | module.exports = StudentAttendance;
18 |
--------------------------------------------------------------------------------
/src/lecture-22/attendance-system/server/models/User.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const userSchema = new Schema({
4 | name: {
5 | type: String,
6 | required: true,
7 | minlength: 3,
8 | maxlength: 10,
9 | },
10 | email: {
11 | type: String,
12 | required: true,
13 | validate: {
14 | validator: function (v) {
15 | return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
16 | },
17 | message: (prop) => `Invalid Email: ${prop.value}`,
18 | },
19 | },
20 | password: {
21 | type: String,
22 | minlength: [6, 'Password is too short'],
23 | required: true,
24 | },
25 | roles: {
26 | type: [String],
27 | required: true,
28 | default: ['STUDENT'],
29 | },
30 | accountStatus: {
31 | type: String,
32 | enum: ['PENDING', 'ACTIVE', 'REJECTED'],
33 | default: 'PENDING',
34 | required: true,
35 | },
36 | });
37 |
38 | const User = model('User', userSchema);
39 |
40 | module.exports = User;
41 |
--------------------------------------------------------------------------------
/src/lecture-22/attendance-system/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "nodemon server.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "bcryptjs": "^2.4.3",
15 | "express": "^4.18.1",
16 | "mongoose": "^6.3.3"
17 | },
18 | "devDependencies": {
19 | "nodemon": "^2.0.16"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/lecture-22/attendance-system/server/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/controller/auth.js:
--------------------------------------------------------------------------------
1 | const { registerService, loginService } = require('../service/auth');
2 |
3 | const registerController = async (req, res, next) => {
4 | const { name, email, password } = req.body;
5 | if (!name || !email || !password) {
6 | return res.status(400).json({ message: 'Invalid Data' });
7 | }
8 | try {
9 | const user = await registerService({ name, email, password });
10 | return res.status(201).json({ message: 'User Created Successfully', user });
11 | } catch (error) {
12 | next(error);
13 | }
14 | };
15 |
16 | const loginController = async (req, res, next) => {
17 | const { email, password } = req.body;
18 | try {
19 | const token = await loginService({ email, password });
20 | return res.status(200).json({ message: 'Login Successful', token });
21 | } catch (e) {
22 | next(e);
23 | }
24 | };
25 |
26 | module.exports = { registerController, loginController };
27 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/db.js:
--------------------------------------------------------------------------------
1 | const mongoose = require('mongoose');
2 |
3 | function connectDB(connectionStr) {
4 | return mongoose.connect(connectionStr);
5 | }
6 |
7 | module.exports = connectDB;
8 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/middleware/authenticate.js:
--------------------------------------------------------------------------------
1 | const jwt = require('jsonwebtoken');
2 | const User = require('../models/User');
3 |
4 | async function authenticate(req, res, next) {
5 | try {
6 | let token = req.headers.authorization;
7 | if (!token) {
8 | return res.status(401).json({ message: 'Unauthorized' });
9 | }
10 |
11 | token = token.split(' ')[1];
12 | const decoded = jwt.verify(token, 'secret-key');
13 |
14 | const user = await User.findById(decoded._id);
15 | if (!user) {
16 | return res.status(401).json({ message: 'Unauthorized' });
17 | }
18 |
19 | req.user = user;
20 | next();
21 | } catch (e) {
22 | return res.status(400).json({ message: 'Invalid token' });
23 | }
24 | }
25 |
26 | module.exports = authenticate;
27 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/models/AdminAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const adminAttendanceSchema = new Schema({
4 | timeLimit: Number,
5 | status: String,
6 | createdAt: Date,
7 | });
8 |
9 | const AdminAttendance = model('AdminAttendance', adminAttendanceSchema);
10 |
11 | module.exports = AdminAttendance;
12 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/models/Profile.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const profileSchema = new Schema({
4 | firstName: String,
5 | lastName: String,
6 | phone: String,
7 | avatar: String,
8 | user: {
9 | type: Schema.Types.ObjectId,
10 | ref: 'User',
11 | },
12 | });
13 |
14 | const Profile = model('Profile', profileSchema);
15 |
16 | module.exports = Profile;
17 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/models/StudentAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const studentAttendanceSchema = new Schema({
4 | createdAt: Date,
5 | user: {
6 | type: Schema.Types.ObjectId,
7 | ref: 'User',
8 | },
9 | adminAttendance: {
10 | type: Schema.Types.ObjectId,
11 | ref: 'AdminAttendance',
12 | },
13 | });
14 |
15 | const StudentAttendance = model('StudentAttendance', studentAttendanceSchema);
16 |
17 | module.exports = StudentAttendance;
18 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/models/User.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const userSchema = new Schema({
4 | name: {
5 | type: String,
6 | required: true,
7 | minlength: 3,
8 | maxlength: 10,
9 | },
10 | email: {
11 | type: String,
12 | required: true,
13 | validate: {
14 | validator: function (v) {
15 | return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
16 | },
17 | message: (prop) => `Invalid Email: ${prop.value}`,
18 | },
19 | },
20 | password: {
21 | type: String,
22 | minlength: [6, 'Password is too short'],
23 | required: true,
24 | },
25 | roles: {
26 | type: [String],
27 | required: true,
28 | default: ['STUDENT'],
29 | },
30 | accountStatus: {
31 | type: String,
32 | enum: ['PENDING', 'ACTIVE', 'REJECTED'],
33 | default: 'PENDING',
34 | required: true,
35 | },
36 | });
37 |
38 | const User = model('User', userSchema);
39 |
40 | module.exports = User;
41 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "nodemon server.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "bcryptjs": "^2.4.3",
15 | "express": "^4.18.1",
16 | "jsonwebtoken": "^8.5.1",
17 | "mongoose": "^6.3.3"
18 | },
19 | "devDependencies": {
20 | "nodemon": "^2.0.16"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/routes/auth.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const { registerController, loginController } = require('../controller/auth');
3 |
4 | router.post('/register', registerController);
5 |
6 | router.post('/login', loginController);
7 |
8 | module.exports = router;
9 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/routes/index.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const authRoutes = require('./auth');
3 |
4 | router.use('/api/v1/auth', authRoutes);
5 |
6 | module.exports = router;
7 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const connectDB = require('./db');
3 | const authenticate = require('./middleware/authenticate');
4 | const routes = require('./routes');
5 |
6 | const app = express();
7 |
8 | app.use(express.json());
9 |
10 | app.use(routes);
11 |
12 | app.get('/private', authenticate, async (req, res) => {
13 | console.log('I am authenticated', req.user);
14 | return res.status(200).json({ message: 'I am a private route' });
15 | });
16 |
17 | app.get('/public', (req, res) => {
18 | return res.status(200).json({ message: 'I am a public route' });
19 | });
20 |
21 | app.get('/', (_req, res) => {
22 | const obj = {
23 | name: 'Ayman',
24 | email: 'ayman@example.com',
25 | };
26 | res.json(obj);
27 | });
28 |
29 | app.use((err, _req, res, _next) => {
30 | console.log(err);
31 | const message = err.message ? err.message : 'Server Error Occurred';
32 | const status = err.status ? err.status : 500;
33 |
34 | res.status(status).json({
35 | message,
36 | });
37 | });
38 |
39 | connectDB('mongodb://localhost:27017/attendance-db')
40 | .then(() => {
41 | console.log('Database Connected');
42 | app.listen(4000, () => {
43 | console.log("I'm listening on port 4000");
44 | });
45 | })
46 | .catch((e) => console.log(e));
47 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/service/auth.js:
--------------------------------------------------------------------------------
1 | const bcrypt = require('bcryptjs');
2 | const jwt = require('jsonwebtoken');
3 | const error = require('../utils/error');
4 | const { findUserByProperty, createNewUser } = require('./user');
5 |
6 | const registerService = async ({ name, email, password }) => {
7 | let user = await findUserByProperty('email', email);
8 | if (user) {
9 | throw error('User already exists', 400);
10 | }
11 |
12 | const salt = await bcrypt.genSalt(10);
13 | const hash = await bcrypt.hash(password, salt);
14 | return createNewUser({ name, email, password: hash });
15 | };
16 |
17 | const loginService = async ({ email, password }) => {
18 | const user = await findUserByProperty('email', email);
19 |
20 | if (!user) {
21 | throw error('Invalid Credential', 400);
22 | }
23 |
24 | const isMatch = await bcrypt.compare(password, user.password);
25 | if (!isMatch) {
26 | throw error('Invalid Credential', 400);
27 | }
28 |
29 | const payload = {
30 | _id: user._id,
31 | name: user.name,
32 | email: user.email,
33 | roles: user.roles,
34 | accountStatus: user.accountStatus,
35 | };
36 |
37 | return jwt.sign(payload, 'secret-key', { expiresIn: '2h' });
38 | };
39 |
40 | module.exports = { registerService, loginService };
41 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/service/user.js:
--------------------------------------------------------------------------------
1 | const User = require('../models/User');
2 |
3 | const findUserByProperty = (key, value) => {
4 | if (key === '_id') {
5 | return User.findById(value);
6 | }
7 | return User.findOne({ [key]: value });
8 | };
9 |
10 | const createNewUser = ({ name, email, password }) => {
11 | const user = new User({ name, email, password });
12 | return user.save();
13 | };
14 |
15 | module.exports = {
16 | findUserByProperty,
17 | createNewUser,
18 | };
19 |
--------------------------------------------------------------------------------
/src/lecture-23/attendance-system/server/utils/error.js:
--------------------------------------------------------------------------------
1 | function error(msg = 'Something Went Wrong', status = 500) {
2 | const e = new Error(msg);
3 | e.status = status;
4 | return e;
5 | }
6 |
7 | module.exports = error;
8 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/controller/auth.js:
--------------------------------------------------------------------------------
1 | const { registerService, loginService } = require('../service/auth');
2 |
3 | const registerController = async (req, res, next) => {
4 | const { name, email, password } = req.body;
5 | if (!name || !email || !password) {
6 | return res.status(400).json({ message: 'Invalid Data' });
7 | }
8 | try {
9 | const user = await registerService({ name, email, password });
10 | return res.status(201).json({ message: 'User Created Successfully', user });
11 | } catch (error) {
12 | next(error);
13 | }
14 | };
15 |
16 | const loginController = async (req, res, next) => {
17 | const { email, password } = req.body;
18 | try {
19 | const token = await loginService({ email, password });
20 | return res.status(200).json({ message: 'Login Successful', token });
21 | } catch (e) {
22 | next(e);
23 | }
24 | };
25 |
26 | module.exports = { registerController, loginController };
27 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/db.js:
--------------------------------------------------------------------------------
1 | const mongoose = require('mongoose');
2 |
3 | function connectDB(connectionStr) {
4 | return mongoose.connect(connectionStr);
5 | }
6 |
7 | module.exports = connectDB;
8 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/middleware/authenticate.js:
--------------------------------------------------------------------------------
1 | const jwt = require('jsonwebtoken');
2 | const User = require('../models/User');
3 |
4 | async function authenticate(req, res, next) {
5 | try {
6 | let token = req.headers.authorization;
7 | if (!token) {
8 | return res.status(401).json({ message: 'Unauthorized' });
9 | }
10 |
11 | token = token.split(' ')[1];
12 | const decoded = jwt.verify(token, 'secret-key');
13 |
14 | const user = await User.findById(decoded._id);
15 | if (!user) {
16 | return res.status(401).json({ message: 'Unauthorized' });
17 | }
18 |
19 | req.user = user;
20 | next();
21 | } catch (e) {
22 | return res.status(400).json({ message: 'Invalid token' });
23 | }
24 | }
25 |
26 | module.exports = authenticate;
27 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/models/AdminAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const adminAttendanceSchema = new Schema({
4 | timeLimit: Number,
5 | status: String,
6 | createdAt: Date,
7 | });
8 |
9 | const AdminAttendance = model('AdminAttendance', adminAttendanceSchema);
10 |
11 | module.exports = AdminAttendance;
12 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/models/Profile.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const profileSchema = new Schema({
4 | firstName: String,
5 | lastName: String,
6 | phone: String,
7 | avatar: String,
8 | user: {
9 | type: Schema.Types.ObjectId,
10 | ref: 'User',
11 | },
12 | });
13 |
14 | const Profile = model('Profile', profileSchema);
15 |
16 | module.exports = Profile;
17 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/models/StudentAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const studentAttendanceSchema = new Schema({
4 | createdAt: Date,
5 | user: {
6 | type: Schema.Types.ObjectId,
7 | ref: 'User',
8 | },
9 | adminAttendance: {
10 | type: Schema.Types.ObjectId,
11 | ref: 'AdminAttendance',
12 | },
13 | });
14 |
15 | const StudentAttendance = model('StudentAttendance', studentAttendanceSchema);
16 |
17 | module.exports = StudentAttendance;
18 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/models/User.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const userSchema = new Schema({
4 | name: {
5 | type: String,
6 | required: true,
7 | minlength: 3,
8 | maxlength: 10,
9 | },
10 | email: {
11 | type: String,
12 | required: true,
13 | validate: {
14 | validator: function (v) {
15 | return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
16 | },
17 | message: (prop) => `Invalid Email: ${prop.value}`,
18 | },
19 | },
20 | password: {
21 | type: String,
22 | minlength: [6, 'Password is too short'],
23 | required: true,
24 | },
25 | roles: {
26 | type: [String],
27 | required: true,
28 | default: ['STUDENT'],
29 | },
30 | accountStatus: {
31 | type: String,
32 | enum: ['PENDING', 'ACTIVE', 'REJECTED'],
33 | default: 'PENDING',
34 | required: true,
35 | },
36 | });
37 |
38 | const User = model('User', userSchema);
39 |
40 | module.exports = User;
41 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "nodemon server.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "bcryptjs": "^2.4.3",
15 | "express": "^4.18.1",
16 | "jsonwebtoken": "^8.5.1",
17 | "mongoose": "^6.3.3"
18 | },
19 | "devDependencies": {
20 | "nodemon": "^2.0.16"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/routes/auth.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const { registerController, loginController } = require('../controller/auth');
3 |
4 | router.post('/register', registerController);
5 |
6 | router.post('/login', loginController);
7 |
8 | module.exports = router;
9 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/routes/index.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const authenticate = require('../middleware/authenticate');
3 | const authRoutes = require('./auth');
4 | const usersRoutes = require('./users');
5 |
6 | router.use('/api/v1/auth', authRoutes);
7 | router.use('/api/v1/users', authenticate, usersRoutes);
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/routes/users.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const usersController = require('../controller/users');
3 |
4 | /**
5 | * Get user by id or email
6 | */
7 |
8 | router.get('/:userId', usersController.getUserById);
9 |
10 | /**
11 | * update user by id
12 | * @method PUT
13 | */
14 |
15 | router.put('/:userId', usersController.putUserById);
16 |
17 | /**
18 | * update user by id
19 | * @method PATCH
20 | */
21 |
22 | router.patch('/:userId', usersController.patchUserById);
23 |
24 | /**
25 | * Delete user by id
26 | */
27 |
28 | router.delete('/:userId', usersController.deleteUserById);
29 |
30 | /**
31 | * Get all users, include
32 | * - filter
33 | * - sort
34 | * - pagination
35 | * - select properties
36 | * @method Get
37 | * @route api/v1/users?sort["by","name"]
38 | * @visibility private
39 | */
40 |
41 | router.get('/', usersController.getUsers);
42 |
43 | /**
44 | * Create new user
45 | */
46 |
47 | router.post('/', usersController.postUser);
48 |
49 | module.exports = router;
50 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const connectDB = require('./db');
3 | const authenticate = require('./middleware/authenticate');
4 | const routes = require('./routes');
5 |
6 | const app = express();
7 |
8 | app.use(express.json());
9 |
10 | app.use(routes);
11 |
12 | app.get('/private', authenticate, async (req, res) => {
13 | console.log('I am authenticated', req.user);
14 | return res.status(200).json({ message: 'I am a private route' });
15 | });
16 |
17 | app.get('/public', (req, res) => {
18 | return res.status(200).json({ message: 'I am a public route' });
19 | });
20 |
21 | app.get('/', (_req, res) => {
22 | const obj = {
23 | name: 'Ayman',
24 | email: 'ayman@example.com',
25 | };
26 | res.json(obj);
27 | });
28 |
29 | app.use((err, _req, res, _next) => {
30 | console.log(err);
31 | const message = err.message ? err.message : 'Server Error Occurred';
32 | const status = err.status ? err.status : 500;
33 |
34 | res.status(status).json({
35 | message,
36 | });
37 | });
38 |
39 | connectDB('mongodb://localhost:27017/attendance-db')
40 | .then(() => {
41 | console.log('Database Connected');
42 | app.listen(4000, () => {
43 | console.log("I'm listening on port 4000");
44 | });
45 | })
46 | .catch((e) => console.log(e));
47 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/service/auth.js:
--------------------------------------------------------------------------------
1 | const bcrypt = require('bcryptjs');
2 | const jwt = require('jsonwebtoken');
3 | const error = require('../utils/error');
4 | const { findUserByProperty, createNewUser } = require('./user');
5 |
6 | const registerService = async ({
7 | name,
8 | email,
9 | password,
10 | roles,
11 | accountStatus,
12 | }) => {
13 | let user = await findUserByProperty('email', email);
14 | if (user) {
15 | throw error('User already exists', 400);
16 | }
17 |
18 | const salt = await bcrypt.genSalt(10);
19 | const hash = await bcrypt.hash(password, salt);
20 | return createNewUser({ name, email, password: hash, roles, accountStatus });
21 | };
22 |
23 | const loginService = async ({ email, password }) => {
24 | const user = await findUserByProperty('email', email);
25 |
26 | if (!user) {
27 | throw error('Invalid Credential', 400);
28 | }
29 |
30 | const isMatch = await bcrypt.compare(password, user.password);
31 | if (!isMatch) {
32 | throw error('Invalid Credential', 400);
33 | }
34 |
35 | const payload = {
36 | _id: user._id,
37 | name: user.name,
38 | email: user.email,
39 | roles: user.roles,
40 | accountStatus: user.accountStatus,
41 | };
42 |
43 | return jwt.sign(payload, 'secret-key', { expiresIn: '2h' });
44 | };
45 |
46 | module.exports = { registerService, loginService };
47 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/service/user.js:
--------------------------------------------------------------------------------
1 | const User = require('../models/User');
2 | const error = require('../utils/error');
3 |
4 | const findUsers = () => {
5 | return User.find();
6 | };
7 |
8 | const findUserByProperty = (key, value) => {
9 | if (key === '_id') {
10 | return User.findById(value);
11 | }
12 | return User.findOne({ [key]: value });
13 | };
14 |
15 | const createNewUser = ({ name, email, password, roles, accountStatus }) => {
16 | const user = new User({
17 | name,
18 | email,
19 | password,
20 | roles: roles ? roles : 'STUDENT',
21 | accountStatus: accountStatus ? accountStatus : 'PENDING',
22 | });
23 | return user.save();
24 | };
25 |
26 | const updateUser = async (id, data) => {
27 | const user = await findUserByProperty('email', data.email);
28 |
29 | if (user) {
30 | throw error('Email already in use', 400);
31 | }
32 |
33 | return User.findByIdAndUpdate(id, { ...data }, { new: true });
34 | };
35 |
36 | module.exports = {
37 | findUserByProperty,
38 | createNewUser,
39 | findUsers,
40 | updateUser,
41 | };
42 |
--------------------------------------------------------------------------------
/src/lecture-24/attendance-system/server/utils/error.js:
--------------------------------------------------------------------------------
1 | function error(msg = 'Something Went Wrong', status = 500) {
2 | const e = new Error(msg);
3 | e.status = status;
4 | return e;
5 | }
6 |
7 | module.exports = error;
8 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/controller/admin-attendance.js:
--------------------------------------------------------------------------------
1 | const AdminAttendance = require('../models/AdminAttendance');
2 | const { addMinutes, isAfter } = require('date-fns');
3 | const error = require('../utils/error');
4 |
5 | const getEnable = async (_req, res, next) => {
6 | try {
7 | const running = await AdminAttendance.findOne({ status: 'RUNNING' });
8 |
9 | if (running) {
10 | throw error('Already Running', 400);
11 | }
12 | const attendance = new AdminAttendance();
13 | await attendance.save();
14 | return res.status(201).json({ message: 'Success', attendance });
15 | } catch (e) {
16 | next(e);
17 | }
18 | };
19 |
20 | const getStatus = async (_req, res, next) => {
21 | try {
22 | const running = await AdminAttendance.findOne({ status: 'RUNNING' });
23 |
24 | if (!running) {
25 | throw error('Not Running', 400);
26 | }
27 |
28 | const started = addMinutes(new Date(running.createdAt), running.timeLimit);
29 |
30 | if (isAfter(new Date(), started)) {
31 | running.status = 'COMPLETED';
32 | await running.save();
33 | }
34 |
35 | return res.status(200).json(running);
36 | } catch (e) {
37 | next(e);
38 | }
39 | };
40 |
41 | const getDisable = async (_req, res, next) => {
42 | try {
43 | const running = await AdminAttendance.findOne({ status: 'RUNNING' });
44 |
45 | if (!running) {
46 | throw error('Not Running', 400);
47 | }
48 |
49 | running.status = 'COMPLETED';
50 | await running.save();
51 |
52 | return res.status(200).json(running);
53 | } catch (e) {
54 | next(e);
55 | }
56 | };
57 |
58 | module.exports = {
59 | getEnable,
60 | getStatus,
61 | getDisable,
62 | };
63 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/controller/auth.js:
--------------------------------------------------------------------------------
1 | const { registerService, loginService } = require('../service/auth');
2 |
3 | const registerController = async (req, res, next) => {
4 | const { name, email, password } = req.body;
5 | if (!name || !email || !password) {
6 | return res.status(400).json({ message: 'Invalid Data' });
7 | }
8 | try {
9 | const user = await registerService({ name, email, password });
10 | return res.status(201).json({ message: 'User Created Successfully', user });
11 | } catch (error) {
12 | next(error);
13 | }
14 | };
15 |
16 | const loginController = async (req, res, next) => {
17 | const { email, password } = req.body;
18 | try {
19 | const token = await loginService({ email, password });
20 | return res.status(200).json({ message: 'Login Successful', token });
21 | } catch (e) {
22 | next(e);
23 | }
24 | };
25 |
26 | module.exports = { registerController, loginController };
27 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/db.js:
--------------------------------------------------------------------------------
1 | const mongoose = require('mongoose');
2 |
3 | function connectDB(connectionStr) {
4 | return mongoose.connect(connectionStr);
5 | }
6 |
7 | module.exports = connectDB;
8 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/middleware/authenticate.js:
--------------------------------------------------------------------------------
1 | const jwt = require('jsonwebtoken');
2 | const User = require('../models/User');
3 |
4 | async function authenticate(req, res, next) {
5 | try {
6 | let token = req.headers.authorization;
7 | if (!token) {
8 | return res.status(401).json({ message: 'Unauthorized' });
9 | }
10 |
11 | token = token.split(' ')[1];
12 | const decoded = jwt.verify(token, 'secret-key');
13 |
14 | const user = await User.findById(decoded._id);
15 | if (!user) {
16 | return res.status(401).json({ message: 'Unauthorized' });
17 | }
18 |
19 | req.user = user;
20 | next();
21 | } catch (e) {
22 | return res.status(400).json({ message: 'Invalid token' });
23 | }
24 | }
25 |
26 | module.exports = authenticate;
27 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/models/AdminAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const adminAttendanceSchema = new Schema(
4 | {
5 | timeLimit: {
6 | type: Number,
7 | required: true,
8 | max: 30,
9 | min: 5,
10 | default: 5,
11 | },
12 | status: {
13 | type: String,
14 | required: true,
15 | enum: ['RUNNING', 'COMPLETED'],
16 | default: 'RUNNING',
17 | },
18 | },
19 | { timestamps: true }
20 | );
21 |
22 | const AdminAttendance = model('AdminAttendance', adminAttendanceSchema);
23 |
24 | module.exports = AdminAttendance;
25 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/models/Profile.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const profileSchema = new Schema({
4 | firstName: String,
5 | lastName: String,
6 | phone: String,
7 | avatar: String,
8 | user: {
9 | type: Schema.Types.ObjectId,
10 | ref: 'User',
11 | },
12 | });
13 |
14 | const Profile = model('Profile', profileSchema);
15 |
16 | module.exports = Profile;
17 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/models/StudentAttendance.js:
--------------------------------------------------------------------------------
1 | const { Schema, model } = require('mongoose');
2 |
3 | const studentAttendanceSchema = new Schema(
4 | {
5 | user: {
6 | type: Schema.Types.ObjectId,
7 | ref: 'User',
8 | required: true,
9 | },
10 | adminAttendance: {
11 | type: Schema.Types.ObjectId,
12 | ref: 'AdminAttendance',
13 | required: true,
14 | },
15 | },
16 | { timestamps: true }
17 | );
18 |
19 | const StudentAttendance = model('StudentAttendance', studentAttendanceSchema);
20 |
21 | module.exports = StudentAttendance;
22 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/models/User.js:
--------------------------------------------------------------------------------
1 | const { model, Schema } = require('mongoose');
2 |
3 | const userSchema = new Schema({
4 | name: {
5 | type: String,
6 | required: true,
7 | minlength: 3,
8 | maxlength: 10,
9 | },
10 | email: {
11 | type: String,
12 | required: true,
13 | validate: {
14 | validator: function (v) {
15 | return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
16 | },
17 | message: (prop) => `Invalid Email: ${prop.value}`,
18 | },
19 | },
20 | password: {
21 | type: String,
22 | minlength: [6, 'Password is too short'],
23 | required: true,
24 | },
25 | roles: {
26 | type: [String],
27 | required: true,
28 | default: ['STUDENT'],
29 | },
30 | accountStatus: {
31 | type: String,
32 | enum: ['PENDING', 'ACTIVE', 'REJECTED'],
33 | default: 'PENDING',
34 | required: true,
35 | },
36 | });
37 |
38 | const User = model('User', userSchema);
39 |
40 | module.exports = User;
41 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "nodemon server.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "bcryptjs": "^2.4.3",
15 | "date-fns": "^2.28.0",
16 | "express": "^4.18.1",
17 | "jsonwebtoken": "^8.5.1",
18 | "mongoose": "^6.3.3"
19 | },
20 | "devDependencies": {
21 | "nodemon": "^2.0.16"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/routes/admin-attendance.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const {
3 | getEnable,
4 | getDisable,
5 | getStatus,
6 | } = require('../controller/admin-attendance');
7 |
8 | router.get('/enable', getEnable);
9 | router.get('/disable', getDisable);
10 | router.get('/status', getStatus);
11 |
12 | module.exports = router;
13 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/routes/auth.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const { registerController, loginController } = require('../controller/auth');
3 |
4 | router.post('/register', registerController);
5 |
6 | router.post('/login', loginController);
7 |
8 | module.exports = router;
9 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/routes/index.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const authenticate = require('../middleware/authenticate');
3 | const authRoutes = require('./auth');
4 | const usersRoutes = require('./users');
5 | const adminAttendanceRoutes = require('./admin-attendance');
6 | const studentAttendanceRoutes = require('./student-attendance');
7 |
8 | router.use('/api/v1/auth', authRoutes);
9 | router.use('/api/v1/users', authenticate, usersRoutes);
10 | router.use('/api/v1/admin/attendance', authenticate, adminAttendanceRoutes);
11 | router.use('/api/v1/student/attendance', authenticate, studentAttendanceRoutes);
12 |
13 | module.exports = router;
14 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/routes/student-attendance.js:
--------------------------------------------------------------------------------
1 | const {
2 | getAttendance,
3 | getAttendanceStatus,
4 | } = require('../controller/student-attendance');
5 |
6 | const router = require('express').Router();
7 |
8 | router.get('/status', getAttendanceStatus);
9 | router.get('/:id', getAttendance);
10 |
11 | module.exports = router;
12 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/routes/users.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 | const usersController = require('../controller/users');
3 |
4 | /**
5 | * Get user by id or email
6 | */
7 |
8 | router.get('/:userId', usersController.getUserById);
9 |
10 | /**
11 | * update user by id
12 | * @method PUT
13 | */
14 |
15 | router.put('/:userId', usersController.putUserById);
16 |
17 | /**
18 | * update user by id
19 | * @method PATCH
20 | */
21 |
22 | router.patch('/:userId', usersController.patchUserById);
23 |
24 | /**
25 | * Delete user by id
26 | */
27 |
28 | router.delete('/:userId', usersController.deleteUserById);
29 |
30 | /**
31 | * Get all users, include
32 | * - filter
33 | * - sort
34 | * - pagination
35 | * - select properties
36 | * @method Get
37 | * @route api/v1/users?sort["by","name"]
38 | * @visibility private
39 | */
40 |
41 | router.get('/', usersController.getUsers);
42 |
43 | /**
44 | * Create new user
45 | */
46 |
47 | router.post('/', usersController.postUser);
48 |
49 | module.exports = router;
50 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const connectDB = require('./db');
3 | const authenticate = require('./middleware/authenticate');
4 | const routes = require('./routes');
5 |
6 | const app = express();
7 |
8 | app.use(express.json());
9 |
10 | app.use(routes);
11 |
12 | app.get('/private', authenticate, async (req, res) => {
13 | console.log('I am authenticated', req.user);
14 | return res.status(200).json({ message: 'I am a private route' });
15 | });
16 |
17 | app.get('/public', (req, res) => {
18 | return res.status(200).json({ message: 'I am a public route' });
19 | });
20 |
21 | app.get('/', (_req, res) => {
22 | const obj = {
23 | name: 'Ayman',
24 | email: 'ayman@example.com',
25 | };
26 | res.json(obj);
27 | });
28 |
29 | app.use((err, _req, res, _next) => {
30 | console.log(err);
31 | const message = err.message ? err.message : 'Server Error Occurred';
32 | const status = err.status ? err.status : 500;
33 |
34 | res.status(status).json({
35 | message,
36 | });
37 | });
38 |
39 | connectDB('mongodb://localhost:27017/attendance-db')
40 | .then(() => {
41 | console.log('Database Connected');
42 | app.listen(4000, () => {
43 | console.log("I'm listening on port 4000");
44 | });
45 | })
46 | .catch((e) => console.log(e));
47 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/service/auth.js:
--------------------------------------------------------------------------------
1 | const bcrypt = require('bcryptjs');
2 | const jwt = require('jsonwebtoken');
3 | const error = require('../utils/error');
4 | const { findUserByProperty, createNewUser } = require('./user');
5 |
6 | const registerService = async ({
7 | name,
8 | email,
9 | password,
10 | roles,
11 | accountStatus,
12 | }) => {
13 | let user = await findUserByProperty('email', email);
14 | if (user) {
15 | throw error('User already exists', 400);
16 | }
17 |
18 | const salt = await bcrypt.genSalt(10);
19 | const hash = await bcrypt.hash(password, salt);
20 | return createNewUser({ name, email, password: hash, roles, accountStatus });
21 | };
22 |
23 | const loginService = async ({ email, password }) => {
24 | const user = await findUserByProperty('email', email);
25 |
26 | if (!user) {
27 | throw error('Invalid Credential', 400);
28 | }
29 |
30 | const isMatch = await bcrypt.compare(password, user.password);
31 | if (!isMatch) {
32 | throw error('Invalid Credential', 400);
33 | }
34 |
35 | const payload = {
36 | _id: user._id,
37 | name: user.name,
38 | email: user.email,
39 | roles: user.roles,
40 | accountStatus: user.accountStatus,
41 | };
42 |
43 | return jwt.sign(payload, 'secret-key', { expiresIn: '2h' });
44 | };
45 |
46 | module.exports = { registerService, loginService };
47 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/service/user.js:
--------------------------------------------------------------------------------
1 | const User = require('../models/User');
2 | const error = require('../utils/error');
3 |
4 | const findUsers = () => {
5 | return User.find();
6 | };
7 |
8 | const findUserByProperty = (key, value) => {
9 | if (key === '_id') {
10 | return User.findById(value);
11 | }
12 | return User.findOne({ [key]: value });
13 | };
14 |
15 | const createNewUser = ({ name, email, password, roles, accountStatus }) => {
16 | const user = new User({
17 | name,
18 | email,
19 | password,
20 | roles: roles ? roles : 'STUDENT',
21 | accountStatus: accountStatus ? accountStatus : 'PENDING',
22 | });
23 | return user.save();
24 | };
25 |
26 | const updateUser = async (id, data) => {
27 | const user = await findUserByProperty('email', data.email);
28 |
29 | if (user) {
30 | throw error('Email already in use', 400);
31 | }
32 |
33 | return User.findByIdAndUpdate(id, { ...data }, { new: true });
34 | };
35 |
36 | module.exports = {
37 | findUserByProperty,
38 | createNewUser,
39 | findUsers,
40 | updateUser,
41 | };
42 |
--------------------------------------------------------------------------------
/src/lecture-26/attendance-system/server/utils/error.js:
--------------------------------------------------------------------------------
1 | function error(msg = 'Something Went Wrong', status = 500) {
2 | const e = new Error(msg);
3 | e.status = status;
4 | return e;
5 | }
6 |
7 | module.exports = error;
8 |
--------------------------------------------------------------------------------
/src/lecture-29/app.js:
--------------------------------------------------------------------------------
1 | window.onload = function () {
2 | main();
3 | };
4 |
5 | function main() {
6 | const app = Container([
7 | Text('h1', 'Hello World'),
8 | Text('p', 'This is a simple paragraph'),
9 | Container([Text('h3', 'WOW'), Text('h3', 'NICE')], {
10 | display: 'flex',
11 | gap: '2rem',
12 | }),
13 | ]);
14 | document.getElementById('root').appendChild(app);
15 | }
16 |
17 | function Container(children, style = {}) {
18 | const div = document.createElement('div');
19 | Object.keys(style).map((key) => {
20 | div.style[key] = style[key];
21 | });
22 | children.forEach((child) => div.appendChild(child));
23 |
24 | return div;
25 | }
26 |
27 | function Text(tag, value) {
28 | const text = document.createElement(tag);
29 | text.innerText = value;
30 | return text;
31 | }
32 |
--------------------------------------------------------------------------------
/src/lecture-29/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Modern App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "first-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.14.1",
7 | "@testing-library/react": "^13.0.0",
8 | "@testing-library/user-event": "^13.2.1",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.0"
13 | },
14 | "scripts": {
15 | "start": "react-scripts start",
16 | "build": "react-scripts build",
17 | "test": "react-scripts test",
18 | "eject": "react-scripts eject"
19 | },
20 | "eslintConfig": {
21 | "extends": [
22 | "react-app",
23 | "react-app/jest"
24 | ]
25 | },
26 | "browserslist": {
27 | "production": [
28 | ">0.2%",
29 | "not dead",
30 | "not op_mini all"
31 | ],
32 | "development": [
33 | "last 1 chrome version",
34 | "last 1 firefox version",
35 | "last 1 safari version"
36 | ]
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/src/lecture-29/react-app/first-app/public/favicon.ico
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/src/lecture-29/react-app/first-app/public/logo192.png
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adityackr/full-stack-army/e2bbb8ff27c5e7f95cd52699b1f95c90d01cfecb/src/lecture-29/react-app/first-app/public/logo512.png
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/src/App.jsx:
--------------------------------------------------------------------------------
1 | function Button({ text }) {
2 | return ;
3 | }
4 |
5 | function Title() {
6 | return Hello React
;
7 | }
8 |
9 | function Body() {
10 | return React is really awesome
;
11 | }
12 |
13 | function App() {
14 | return (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | );
23 | }
24 |
25 | export default App;
26 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/src/index.js:
--------------------------------------------------------------------------------
1 | import ReactDOM from 'react-dom/client';
2 | import App from './App';
3 | import './index.css';
4 | import reportWebVitals from './reportWebVitals';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render();
8 |
9 | // If you want to start measuring performance in your app, pass a function
10 | // to log results (for example: reportWebVitals(console.log))
11 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
12 | reportWebVitals();
13 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/src/lecture-29/react-app/first-app/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/src/mongo-demo/index.js:
--------------------------------------------------------------------------------
1 | const mongoose = require('mongoose');
2 |
3 | const personSchema = new mongoose.Schema({
4 | firstName: {
5 | type: String,
6 | required: true,
7 | minlength: [3, 'Minimum 3 chars'],
8 | maxlength: [20, 'Maximum 20 chars'],
9 | },
10 | lastName: {
11 | type: String,
12 | required: true,
13 | minlength: [3, 'Minimum 3 chars'],
14 | maxlength: [20, 'Maximum 20 chars'],
15 | },
16 | email: {
17 | type: String,
18 | required: true,
19 | validate: {
20 | validator: function (v) {
21 | return v.endsWith('.com');
22 | },
23 | message: 'Invalid email formats',
24 | },
25 | },
26 | age: Number,
27 | bio: String,
28 | single: Boolean,
29 | });
30 |
31 | const Person = mongoose.model('Person', personSchema);
32 |
33 | mongoose
34 | .connect('mongodb://localhost:27017/mongo-demo')
35 | .then(async () => {
36 | console.log('Database connected');
37 | const person = new Person({
38 | firstName: 'Aditya',
39 | lastName: 'Chakraborty',
40 | email: 'aditya@example.com',
41 | age: 30,
42 | bio: 'Backend Developer',
43 | single: true,
44 | });
45 | await person.save();
46 | console.log('Person created');
47 | console.log(person);
48 | // const people = await Person.find({ lastName: 'Chakraborty' });
49 | // console.log(people);
50 | // const person = new Person({ firstName: '11' });
51 | // await person.save();
52 | })
53 | .catch((e) => {
54 | console.log(e);
55 | })
56 | .finally(() => {
57 | mongoose.connection.close();
58 | });
59 |
--------------------------------------------------------------------------------
/src/mongo-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mongo-demo",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "dependencies": {
7 | "mongoose": "^6.3.5"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/raffle-draw/app/app.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config('../.env');
2 | const express = require('express');
3 | const { errorHandler, notFoundHandler } = require('./error');
4 |
5 | const app = express();
6 |
7 | app.use(require('./middleware'));
8 | app.use(require('./routes'));
9 |
10 | app.use(notFoundHandler);
11 |
12 | app.use(errorHandler);
13 |
14 | module.exports = app;
15 |
--------------------------------------------------------------------------------
/src/raffle-draw/app/error.js:
--------------------------------------------------------------------------------
1 | const notFoundHandler = (_req, _res, next) => {
2 | const error = new Error('Resource not found');
3 | error.status = 404;
4 | next(error);
5 | };
6 |
7 | const errorHandler = (error, _req, res, _next) => {
8 | if (error.status) {
9 | res.status(error.status).json({
10 | message: error.message,
11 | });
12 | }
13 |
14 | res.status(500).json({ message: 'Something went wrong' });
15 | };
16 |
17 | module.exports = {
18 | notFoundHandler,
19 | errorHandler,
20 | };
21 |
--------------------------------------------------------------------------------
/src/raffle-draw/app/middleware.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const morgan = require('morgan');
3 | const cors = require('cors');
4 |
5 | const middleware = [morgan('dev'), cors(), express.json()];
6 |
7 | module.exports = middleware;
8 |
--------------------------------------------------------------------------------
/src/raffle-draw/app/routes.js:
--------------------------------------------------------------------------------
1 | const router = require('express').Router();
2 |
3 | router.use('/api/v1/tickets', require('../routes/ticket'));
4 |
5 | router.get('/health', (_req, res) => {
6 | res.status(200).json({ message: 'Success' });
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/src/raffle-draw/default.env:
--------------------------------------------------------------------------------
1 | PORT = 4444
--------------------------------------------------------------------------------
/src/raffle-draw/models/Ticket.js:
--------------------------------------------------------------------------------
1 | const shortid = require('shortid');
2 |
3 | class Ticket {
4 | /**
5 | * constructor function
6 | * @param {string} username
7 | * @param {number} price
8 | */
9 | constructor(username, price) {
10 | this.id = shortid.generate();
11 | this.username = username;
12 | this.price = price;
13 | this.createdAt = new Date();
14 | this.updatedAt = new Date();
15 | }
16 | }
17 |
18 | module.exports = Ticket;
19 |
--------------------------------------------------------------------------------
/src/raffle-draw/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lecture-15",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "devDependencies": {
7 | "nodemon": "^2.0.16"
8 | },
9 | "dependencies": {
10 | "cors": "^2.8.5",
11 | "dotenv": "^16.0.1",
12 | "express": "^4.18.1",
13 | "morgan": "^1.10.0",
14 | "shortid": "^2.2.16"
15 | },
16 | "scripts": {
17 | "start": "nodemon server.js"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/raffle-draw/requirements.md:
--------------------------------------------------------------------------------
1 | #### Lottery API
2 |
3 | - sell lottery ticket
4 | - update lottery ticket
5 | - delete lottery ticket
6 | - get all tickets
7 | - get ticket by id
8 | - bulk buy (user can buy multiple tickets at a time)
9 | - raffle draw
10 |
11 | #### Ticket
12 |
13 | - number (unique)
14 | - username
15 | - price
16 | - timestamp
17 |
18 | #### Routes
19 |
20 | - /tickets/t/:ticketId GET - find single ticket
21 | - /tickets/t/:ticketId PATCH - update ticket by id
22 | - /tickets/t/:ticketId DELETE - delete ticket by id
23 | - /tickets/u/:username GET - find tickets for a given user
24 | - /tickets/u/:username PATCH - update tickets for a given user
25 | - /tickets/u/:username DELETE - delete all tickets for a given user
26 | - /tickets/sell - create tickets
27 | - /tickets/bulk - bulk sell ticket
28 | - /tickets/draw
29 | - /tickets/ - find all tickets
30 |
--------------------------------------------------------------------------------
/src/raffle-draw/server.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config();
2 | const http = require('http');
3 | const app = require('./app/app');
4 |
5 | const server = http.createServer(app);
6 |
7 | const PORT = process.env.PORT || 8000;
8 |
9 | server.listen(PORT, () => {
10 | console.log(`Server is listening on PORT ${PORT}`);
11 | });
12 |
--------------------------------------------------------------------------------
/src/raffle-draw/test/test.js:
--------------------------------------------------------------------------------
1 | const myDB = require('../db/db');
2 | myDB.create('user 1', 10);
3 | myDB.create('user 2', 10);
4 | myDB.create('user 3', 10);
5 | myDB.create('user 4', 10);
6 | myDB.create('user 5', 10);
7 | const bulk = myDB.bulkCreate('test', 10, 5);
8 | console.log('Bulk', bulk);
9 | const tickets = myDB.find();
10 | console.log('All Tickets', tickets);
11 | const winners = myDB.draw(3);
12 | console.log('Winners', winners);
13 |
--------------------------------------------------------------------------------
/timestamp/Class - 7.md:
--------------------------------------------------------------------------------
1 | 0:00 - Class Start
2 | 3:40 - Discussion Part
3 | 16:03 - API Discussion
4 | 16:54 - Vertical Scaling
5 | 19:00 - Horizontal Scaling
6 | 31:47 - Course Journey
7 | 34:26 - Time Management & Class tips
8 | 41:25 - Problem Solving Discussion
9 | 1:07:17 - Recommended Books & Channel
10 | 1:25:09 - What is Template Engine
11 | 1:35:44 - What is Headless CMS
12 | 1:40:57 - Understanding Path
13 | 2:06:18 - Elasticsearch
14 | 2:08:14 - Project Management Tips
15 | 2:18:57 - Class Feedback
16 |
--------------------------------------------------------------------------------
/timestamp/Class - 8.md:
--------------------------------------------------------------------------------
1 | 0:00 - Class Start
2 | 1:55 - Class Topic
3 | 5:38 - What is Function and Why Function
4 | 9:26 - Discussion of Function
5 | 13:42 - Structure of The Function
6 | 31:10 - Discussion Part
7 | 39:21 - Actual Function Declaration
8 | 46:24 - Make Function Dynamic
9 | 49:06 - Argument and Parameter
10 | 1:17:24 - Function Return Concept
11 | 1:27:52 - Discussion About Return
12 | 1:32:38 - Concept Summary
13 | 1:34:16 - Functional Programming
14 | 1:36:47 - Benefits of Functional Programming
15 | 1:41:08 - Prove Function is a Value
16 | 1:50:32 - Meta Programming
17 | 2:05:50 - Discussion Part
18 | 2:09:40 - Dynamic Function Making
19 | 2:16:47 - What is Run Time
20 | 2:19:42 - Discussion Part
21 |
--------------------------------------------------------------------------------
/timestamp/Class - 9.md:
--------------------------------------------------------------------------------
1 | 0:00 - Class Start
2 | 9:00 - What is Functional Programming
3 | 13:28 - Function Expression
4 | 17:30 - Function Definition vs Function Expression
5 | 28:09 - Pure Function
6 | 37:15 - Side Effects
7 | 41:25 - Higher Order Function
8 | 59:30 - Discussion Part
9 | 1:14:09 - Lexical Scoping
10 | 1:41:05 - Scoping
11 | 1:58:53 - Execution Context
12 | 2:33:20 - Hoisting
13 | 2:42:00 - Planning For Lodash Making
14 | 2:47:24 - IIFE
15 | 2:54:41 - Discussion Part
--------------------------------------------------------------------------------
/timestamp/Class 10.md:
--------------------------------------------------------------------------------
1 | 0:00 - Class Start
2 | 8:37 - Asynchronous JavaScript
3 | 45:16 - Callback hell
4 | 58:30 - Promise
5 | 1:38:52 - Async Await
6 | 1:48:41 - Real Example
7 | 2:00:38 - Error Handling
8 | 2:08:16 - Discussion Part
--------------------------------------------------------------------------------
/timestamp/class - 0.md:
--------------------------------------------------------------------------------
1 | 0:00 – Intro
2 | 1:55 – Why Full-Stack Army
3 | 3:10 – What You Get and What You Don't Get
4 | 5:10 – Class Routine
5 | 5:50 – How to Contribute
6 | 7:40 – Discussion Part
7 | 1:35:20 – Full-Stack Developer Life Cycle
8 | 1:36:50 – Why JavaScript Most Popular
9 | 1:38:15 – Front-End & Back-End Misconception
10 | 1:40:10 – Misconception of Path
11 | 1:55:10 – Advanced Development
12 | 1:59:50 – Front-End Learning Time
13 | 2:00:35 – Advance Backend Discussion
14 | 2:06:46 – Database Discussion
15 | 2:09:06 – System Design
16 | 2:10:29 – Basic Networking
17 | 2:10:49 – Linux & Operating System
18 | 2:13:30 – DevOps & Clouds
19 | 2:22:06 – Overview
20 | 2:28:06 – Why This Journey
21 | 2:34:13 – Timeframes
22 | 2:38:07 - Discussion Part
23 |
--------------------------------------------------------------------------------
/timestamp/class - 1.md:
--------------------------------------------------------------------------------
1 | 11:41 - SRS
2 |
3 | 15:12 - functional vs nonfunctional requirements
4 |
5 | 34:46 - project manage with waterfall & agile
6 |
7 | 44:43 - agile
8 |
9 | 52:38 - choose technology
10 |
11 | 1:31:22 - decision for ps caffe
12 |
13 | 1:50:47 - data driven explain
14 |
15 | 2:04:43 - if requirements change continiously
--------------------------------------------------------------------------------
/timestamp/class - 4.md:
--------------------------------------------------------------------------------
1 | 0:00 - intro
2 | 2:40 - Discussion
3 | 15:00 - Variables
4 | 35:00 - Operators
5 | 37:50 - Conditions
6 | 49:47 - Loop
7 | 54:15 - for loop
8 | 1:01:23 - while loop
9 | 1:05:33 - do while loop
10 | 1:08:01 - loop review
11 | 1:08:49 - type of for loop
12 | 1:10:28 - Array
13 | 1:23:42 - why we use array
14 | 1:28:06 - use array or use object
15 | 1:33:35 - mixed array and its disadvantage
16 | 1:36:30 - CRUD
17 | 1:38:20 - Object
18 | 1:39:25 - Array Problem
19 | 1:42:25 - Why we use Object
20 | 1:51:40 - Function
21 | 1:52:10 - difference between loop and function
22 | 1:55:39 - when use Function
23 | 1:57:17 - working with function
24 | 2:12:46 - Future plan
25 | 2:14:14 - Expression vs Statements
26 | 2:23:16 - class break time
27 | 2:28:12 - Discussion
28 | 2:47:31 - Everything comes from object
29 |
--------------------------------------------------------------------------------
/timestamp/class - 5.md:
--------------------------------------------------------------------------------
1 | 0:00 - join time
2 | 8:15 - Array Traverse
3 | 12:00 - callback function
4 | 15:00 - forEach function
5 | 32:00 - Solve a Array Problem
6 | 1:27:00 - Question and Answer
7 | 1:30:00 - calculate fibonnacci number
8 | 1:37:00 - Update
9 | 1:49:30 - Delete
10 | 1:56:00 - Break
11 | 2:08:00 - Object
12 | 2:34:00 - Notation
13 | 2:43:00 - Task
14 |
--------------------------------------------------------------------------------