├── .gitignore
├── COHORT03
├── WEEK21
│ ├── README.md
│ ├── chat-app
│ │ ├── .gitignore
│ │ ├── .npmrc
│ │ ├── .vscode
│ │ │ └── settings.json
│ │ ├── README.md
│ │ ├── apps
│ │ │ ├── docs
│ │ │ │ ├── .gitignore
│ │ │ │ ├── README.md
│ │ │ │ ├── app
│ │ │ │ │ ├── favicon.ico
│ │ │ │ │ ├── fonts
│ │ │ │ │ │ ├── GeistMonoVF.woff
│ │ │ │ │ │ └── GeistVF.woff
│ │ │ │ │ ├── globals.css
│ │ │ │ │ ├── layout.tsx
│ │ │ │ │ ├── page.module.css
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── eslint.config.js
│ │ │ │ ├── next.config.js
│ │ │ │ ├── package.json
│ │ │ │ ├── public
│ │ │ │ │ ├── file-text.svg
│ │ │ │ │ ├── globe.svg
│ │ │ │ │ ├── next.svg
│ │ │ │ │ ├── turborepo-dark.svg
│ │ │ │ │ ├── turborepo-light.svg
│ │ │ │ │ ├── vercel.svg
│ │ │ │ │ └── window.svg
│ │ │ │ └── tsconfig.json
│ │ │ └── web
│ │ │ │ ├── .gitignore
│ │ │ │ ├── README.md
│ │ │ │ ├── app
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── fonts
│ │ │ │ │ ├── GeistMonoVF.woff
│ │ │ │ │ └── GeistVF.woff
│ │ │ │ ├── globals.css
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── page.module.css
│ │ │ │ └── page.tsx
│ │ │ │ ├── eslint.config.js
│ │ │ │ ├── next.config.js
│ │ │ │ ├── package.json
│ │ │ │ ├── public
│ │ │ │ ├── file-text.svg
│ │ │ │ ├── globe.svg
│ │ │ │ ├── next.svg
│ │ │ │ ├── turborepo-dark.svg
│ │ │ │ ├── turborepo-light.svg
│ │ │ │ ├── vercel.svg
│ │ │ │ └── window.svg
│ │ │ │ └── tsconfig.json
│ │ ├── package.json
│ │ ├── packages
│ │ │ ├── eslint-config
│ │ │ │ ├── README.md
│ │ │ │ ├── base.js
│ │ │ │ ├── next.js
│ │ │ │ ├── package.json
│ │ │ │ └── react-internal.js
│ │ │ ├── typescript-config
│ │ │ │ ├── base.json
│ │ │ │ ├── nextjs.json
│ │ │ │ ├── package.json
│ │ │ │ └── react-library.json
│ │ │ └── ui
│ │ │ │ ├── eslint.config.mjs
│ │ │ │ ├── package.json
│ │ │ │ ├── src
│ │ │ │ ├── button.tsx
│ │ │ │ ├── card.tsx
│ │ │ │ └── code.tsx
│ │ │ │ ├── tsconfig.json
│ │ │ │ └── turbo
│ │ │ │ └── generators
│ │ │ │ ├── config.ts
│ │ │ │ └── templates
│ │ │ │ └── component.hbs
│ │ ├── pnpm-lock.yaml
│ │ ├── pnpm-workspace.yaml
│ │ └── turbo.json
│ └── sc
│ │ ├── Screenshot 2025-03-25 at 4.53.42 PM.png
│ │ ├── Screenshot 2025-03-25 at 4.56.43 PM.png
│ │ ├── Screenshot 2025-03-25 at 5.02.26 PM.png
│ │ ├── Screenshot 2025-03-26 at 11.12.53 PM.png
│ │ ├── Screenshot 2025-03-26 at 11.22.37 PM.png
│ │ └── Screenshot 2025-03-26 at 7.07.56 PM.png
└── WEEK22
│ ├── README.md
│ ├── draw-app
│ ├── .gitignore
│ ├── .npmrc
│ ├── .vscode
│ │ └── settings.json
│ ├── README.md
│ ├── apps
│ │ ├── http-backend
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ │ ├── index.ts
│ │ │ │ └── middleware.ts
│ │ │ └── tsconfig.json
│ │ ├── web
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── app
│ │ │ │ ├── config.ts
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── fonts
│ │ │ │ │ ├── GeistMonoVF.woff
│ │ │ │ │ └── GeistVF.woff
│ │ │ │ ├── globals.css
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── page.module.css
│ │ │ │ ├── page.tsx
│ │ │ │ └── room
│ │ │ │ │ └── [slug]
│ │ │ │ │ └── page.tsx
│ │ │ ├── components
│ │ │ │ ├── ChatRoom.tsx
│ │ │ │ └── ChatRoomClient.tsx
│ │ │ ├── eslint.config.js
│ │ │ ├── hooks
│ │ │ │ └── useSocket.ts
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ ├── public
│ │ │ │ ├── file-text.svg
│ │ │ │ ├── globe.svg
│ │ │ │ ├── next.svg
│ │ │ │ ├── turborepo-dark.svg
│ │ │ │ ├── turborepo-light.svg
│ │ │ │ ├── vercel.svg
│ │ │ │ └── window.svg
│ │ │ └── tsconfig.json
│ │ └── ws-backend
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ └── index.ts
│ │ │ └── tsconfig.json
│ ├── package.json
│ ├── packages
│ │ ├── backend-common
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ │ └── index.ts
│ │ │ └── tsconfig.json
│ │ ├── common
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ │ └── types.ts
│ │ │ └── tsconfig.json
│ │ ├── db
│ │ │ ├── .gitignore
│ │ │ ├── package.json
│ │ │ ├── prisma
│ │ │ │ ├── migrations
│ │ │ │ │ ├── 20250112150913_init_schema
│ │ │ │ │ │ └── migration.sql
│ │ │ │ │ ├── 20250112153819_made_photo_optional
│ │ │ │ │ │ └── migration.sql
│ │ │ │ │ ├── 20250112155013_email_unique
│ │ │ │ │ │ └── migration.sql
│ │ │ │ │ └── migration_lock.toml
│ │ │ │ └── schema.prisma
│ │ │ ├── src
│ │ │ │ └── index.ts
│ │ │ └── tsconfig.json
│ │ ├── eslint-config
│ │ │ ├── README.md
│ │ │ ├── base.js
│ │ │ ├── next.js
│ │ │ ├── package.json
│ │ │ └── react-internal.js
│ │ ├── typescript-config
│ │ │ ├── base.json
│ │ │ ├── nextjs.json
│ │ │ ├── package.json
│ │ │ └── react-library.json
│ │ └── ui
│ │ │ ├── eslint.config.js
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ ├── button.tsx
│ │ │ ├── card.tsx
│ │ │ └── code.tsx
│ │ │ ├── tsconfig.json
│ │ │ └── turbo
│ │ │ └── generators
│ │ │ ├── config.ts
│ │ │ └── templates
│ │ │ └── component.hbs
│ ├── pnpm-lock.yaml
│ ├── pnpm-workspace.yaml
│ └── turbo.json
│ └── sc
│ ├── 1.png
│ ├── 10.png
│ ├── 11.png
│ ├── 12.png
│ ├── 13.png
│ ├── 14.png
│ ├── 15.png
│ ├── 16.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ └── 9.png
├── README.md
├── WEEK01
├── LC01.pdf
├── LC02.pdf
├── RC02
│ ├── level-1
│ │ ├── 01-String.js
│ │ ├── 02-Number.js
│ │ └── 03-Array.js
│ └── level-2
│ │ ├── 01-Class.js
│ │ ├── 02-Date.js
│ │ ├── 03-JSON.js
│ │ ├── 04-Math.js
│ │ └── O5-Object.js
├── RC03.pdf
├── RC04.pdf
├── README.md
└── assignments
│ └── RC02
│ ├── README.md
│ ├── easy
│ ├── anagram.js
│ ├── expenditure-analysis.js
│ └── findLargestElement.js
│ ├── hard
│ ├── calculator.js
│ └── todo-list.js
│ ├── medium
│ ├── countVowels.js
│ ├── palindrome.js
│ └── times.js
│ ├── package-lock.json
│ ├── package.json
│ └── tests
│ ├── anagram.test.js
│ ├── calculator.test.js
│ ├── countVowels.test.js
│ ├── expenditure-analysis.test.js
│ ├── findLargestElement.test.js
│ ├── palindrome.test.js
│ └── todo-list.test.js
├── WEEK02
├── 2.1.pdf
├── 2.2.pdf
├── 2.5.pdf
├── README.md
└── assignments
│ ├── 01-async-js
│ ├── .gitignore
│ ├── README.md
│ ├── easy
│ │ ├── 1-counter.js
│ │ ├── 1-counter.md
│ │ ├── 2-counter.js
│ │ ├── 2-counter.md
│ │ ├── 3-read-from-file.js
│ │ ├── 3-read-from-file.md
│ │ ├── 4-write-to-file.js
│ │ ├── 4-write-to-file.md
│ │ └── file.txt
│ ├── hard (promises)
│ │ ├── 1-promisify-setTimeout.js
│ │ ├── 2-sleep-completely.js
│ │ ├── 3-promise-all.js
│ │ └── 4-promise-chain.js
│ ├── medium
│ │ ├── 1-file-cleaner.js
│ │ ├── 1-file-cleaner.md
│ │ ├── 2-clock.js
│ │ ├── 2-clock.md
│ │ └── file.txt
│ ├── package-lock.json
│ ├── package.json
│ └── tests
│ │ ├── 1-promisify-setTimeout.test.js
│ │ ├── 2-sleep-completely.test.js
│ │ ├── 3-promise-all.test.js
│ │ └── 4-promise-chain.test.js
│ └── 02-nodejs
│ ├── .gitignore
│ ├── README.md
│ ├── fileServer.js
│ ├── files
│ └── a.txt
│ ├── package-lock.json
│ ├── package.json
│ ├── solutions
│ ├── fileServer.solution.js
│ ├── todoServer.solution.file.js
│ └── todoServer.solution.js
│ ├── tests
│ ├── fileServer.test.js
│ └── todoServer.test.js
│ ├── todoServer.js
│ └── todos.json
├── WEEK03
├── 3.1.pdf
├── 3.2.pdf
├── README.md
└── assignments
│ ├── 01-middlewares
│ ├── .gitignore
│ ├── 01-requestcount.js
│ ├── 02-ratelimitter.js
│ ├── 03-errorcount.js
│ ├── coverage
│ │ ├── clover.xml
│ │ ├── coverage-final.json
│ │ ├── lcov-report
│ │ │ ├── 01-requestcount.js.html
│ │ │ ├── 02-ratelimitter.js.html
│ │ │ ├── 03-errorcount.js.html
│ │ │ ├── base.css
│ │ │ ├── block-navigation.js
│ │ │ ├── favicon.png
│ │ │ ├── index.html
│ │ │ ├── prettify.css
│ │ │ ├── prettify.js
│ │ │ ├── sort-arrow-sprite.png
│ │ │ └── sorter.js
│ │ └── lcov.info
│ ├── index.js
│ ├── jest.config.ts
│ ├── package-lock.json
│ ├── package.json
│ ├── tests
│ │ ├── 01-requestcount.spec.js
│ │ ├── 02-ratelimitter.spec.js
│ │ └── 03-errorcount.spec.js
│ └── tsconfig.json
│ ├── 02-jwt
│ ├── .gitignore
│ ├── index.js
│ ├── package-lock.json
│ ├── package.json
│ ├── rough.js
│ ├── tests
│ │ └── index.spec.js
│ └── tsconfig.json
│ ├── 03-mongo
│ ├── .gitignore
│ ├── README.md
│ ├── db
│ │ └── index.js
│ ├── index.js
│ ├── middleware
│ │ ├── admin.js
│ │ └── user.js
│ ├── package-lock.json
│ ├── package.json
│ ├── routes
│ │ ├── admin.js
│ │ └── user.js
│ └── solution
│ │ └── index.js
│ ├── 04-mongo-with-jwt-auth
│ ├── .gitignore
│ ├── README.md
│ ├── db
│ │ └── index.js
│ ├── index.js
│ ├── middleware
│ │ ├── admin.js
│ │ ├── error-handler.js
│ │ └── user.js
│ ├── package-lock.json
│ ├── package.json
│ ├── rough.js
│ ├── routes
│ │ ├── admin.js
│ │ └── user.js
│ └── solution
│ │ └── index.js
│ ├── README.md
│ └── solutions
│ ├── 01-requestcount.js
│ ├── 02-ratelimitter.js
│ ├── 02.js
│ └── 03-errorcount.js
├── WEEK04
├── 4.1.pdf
├── 4.2.pdf
├── README.md
└── assignments
│ ├── README.md
│ ├── index.html
│ └── react-basics
│ └── README.md
├── WEEK05
├── 5.1.pdf
└── README.md
├── WEEK06
├── 6.1.pdf
├── 6.2.pdf
├── 6.3.pdf
├── README.md
└── assignments
│ ├── 1-use-memo
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── components
│ │ │ ├── Assignment1.jsx
│ │ │ ├── Assignment2.jsx
│ │ │ └── Assignment3.jsx
│ │ ├── index.css
│ │ └── main.jsx
│ └── vite.config.js
│ ├── 2-use-callback
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── components
│ │ │ ├── Assignment1.jsx
│ │ │ └── Assignment2.jsx
│ │ ├── index.css
│ │ └── main.jsx
│ ├── vite.config.js
│ └── yarn.lock
│ ├── 3-use-ref
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── components
│ │ │ ├── Assignment1.jsx
│ │ │ └── Assignment2.jsx
│ │ ├── index.css
│ │ └── main.jsx
│ ├── vite.config.js
│ └── yarn.lock
│ ├── README.md
│ └── solutions
│ ├── 1
│ └── components
│ │ ├── Assignment1.jsx
│ │ ├── Assignment2.jsx
│ │ └── Assignment3.jsx
│ ├── 2
│ └── components
│ │ ├── Assignment1.jsx
│ │ └── Assignment2.jsx
│ └── 3
│ └── components
│ ├── Assignment1.jsx
│ └── Assignment2.jsx
├── WEEK07
├── 7.1.pdf
├── 7.2.pdf
├── 7.4-master
│ ├── 7.4-async-queries
│ │ ├── .eslintrc.cjs
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── public
│ │ │ └── vite.svg
│ │ ├── src
│ │ │ ├── App.css
│ │ │ ├── App.jsx
│ │ │ ├── App2.jsx
│ │ │ ├── assets
│ │ │ │ └── react.svg
│ │ │ ├── atoms.js
│ │ │ ├── atoms2.js
│ │ │ ├── index.css
│ │ │ └── main.jsx
│ │ └── vite.config.js
│ ├── 7.4-easy-bits
│ │ ├── .eslintrc.cjs
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── public
│ │ │ └── vite.svg
│ │ ├── src
│ │ │ ├── App.css
│ │ │ ├── App.jsx
│ │ │ ├── App2.jsx
│ │ │ ├── assets
│ │ │ │ └── react.svg
│ │ │ ├── atoms.js
│ │ │ ├── atoms2.js
│ │ │ ├── index.css
│ │ │ └── main.jsx
│ │ └── vite.config.js
│ ├── atom-family
│ │ ├── .eslintrc.cjs
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── public
│ │ │ └── vite.svg
│ │ ├── src
│ │ │ ├── App.css
│ │ │ ├── App.jsx
│ │ │ ├── assets
│ │ │ │ └── react.svg
│ │ │ ├── atoms.ts
│ │ │ ├── index.css
│ │ │ ├── main.jsx
│ │ │ └── todos.ts
│ │ └── vite.config.js
│ ├── loadables
│ │ ├── .eslintrc.cjs
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── public
│ │ │ └── vite.svg
│ │ ├── src
│ │ │ ├── App.css
│ │ │ ├── App.jsx
│ │ │ ├── assets
│ │ │ │ └── react.svg
│ │ │ ├── atoms.ts
│ │ │ ├── index.css
│ │ │ └── main.jsx
│ │ └── vite.config.js
│ └── selector-family
│ │ ├── .eslintrc.cjs
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── public
│ │ └── vite.svg
│ │ ├── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── assets
│ │ │ └── react.svg
│ │ ├── atoms.ts
│ │ ├── index.css
│ │ └── main.jsx
│ │ └── vite.config.js
└── README.md
├── WEEK08
├── 8.1.pdf
├── README.md
└── assignments
│ └── paytm-main
│ ├── Dockerfile
│ ├── README.md
│ ├── backend
│ ├── .gitignore
│ ├── config.js
│ ├── db.js
│ ├── index.js
│ ├── middleware.js
│ ├── package-lock.json
│ ├── package.json
│ └── routes
│ │ ├── account.js
│ │ ├── index.js
│ │ └── user.js
│ └── frontend
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── public
│ └── vite.svg
│ ├── src
│ ├── App.css
│ ├── App.jsx
│ ├── assets
│ │ └── react.svg
│ ├── index.css
│ └── main.jsx
│ └── vite.config.js
├── WEEK09
├── README.md
└── rough
│ ├── package.json
│ ├── src
│ └── a.ts
│ └── tsconfig.json
├── WEEK10
├── README.md
├── assignments
│ ├── 1-postgres-simple
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── config.ts
│ │ │ ├── db
│ │ │ │ ├── __tests__
│ │ │ │ │ └── db.test.ts
│ │ │ │ ├── setup.ts
│ │ │ │ ├── todo.ts
│ │ │ │ └── user.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.json
│ │ └── yarn.lock
│ └── 2-prisma-simple
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── prisma
│ │ ├── migrations
│ │ │ ├── 20240205225711_i_nit
│ │ │ │ └── migration.sql
│ │ │ └── migration_lock.toml
│ │ └── schema.prisma
│ │ ├── src
│ │ └── db
│ │ │ ├── __tests__
│ │ │ └── db.test.ts
│ │ │ ├── setup.ts
│ │ │ ├── todo.ts
│ │ │ └── user.ts
│ │ ├── tsconfig.json
│ │ └── yarn.lock
├── class1-rough
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
└── class2-rough
│ ├── .gitignore
│ ├── package-lock.json
│ ├── package.json
│ ├── prisma
│ ├── migrations
│ │ ├── 20240212073219_initialize
│ │ │ └── migration.sql
│ │ ├── 20240212094334_initialize
│ │ │ └── migration.sql
│ │ └── migration_lock.toml
│ └── schema.prisma
│ ├── src
│ └── intex.ts
│ └── tsconfig.json
├── WEEK11
├── README.md
├── class1-rough
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .prettierrc
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── wrangler.toml
├── class1-rough2
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── wrangler.toml
└── class2-rough
│ └── Debu-AWS-pass.pem
├── WEEK12
├── README.md
├── aws-react-rough
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── assets
│ │ │ └── react.svg
│ │ ├── index.css
│ │ ├── main.tsx
│ │ └── vite-env.d.ts
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
├── monorepos
│ └── README.md
└── typescript-apis
│ ├── package.json
│ ├── pnpm-lock.yaml
│ ├── src
│ ├── Exclude.ts
│ ├── Map.ts
│ ├── Partial.ts
│ ├── Pick.ts
│ ├── Readonly.ts
│ ├── Record.ts
│ └── ZodInference.ts
│ └── tsconfig.json
├── WEEK13
├── README.md
└── medium
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── prisma
│ ├── migrations
│ │ ├── 20240307175834_init_schema
│ │ │ └── migration.sql
│ │ └── migration_lock.toml
│ └── schema.prisma
│ ├── src
│ ├── index.ts
│ └── routes
│ │ ├── blog.ts
│ │ └── user.ts
│ ├── tsconfig.json
│ └── wrangler.toml
├── WEEK14
├── README.md
├── next-app
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ ├── favicon.ico
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ ├── not-found.tsx
│ │ ├── page.tsx
│ │ ├── signin
│ │ │ ├── layout.tsx
│ │ │ └── page.tsx
│ │ └── signup
│ │ │ └── page.tsx
│ ├── next.config.mjs
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── public
│ │ ├── next.svg
│ │ └── vercel.svg
│ ├── tailwind.config.ts
│ └── tsconfig.json
└── next-server
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── README.md
│ ├── actions
│ └── user.ts
│ ├── app
│ ├── api
│ │ └── user
│ │ │ └── route.ts
│ ├── favicon.ico
│ ├── globals.css
│ ├── layout.tsx
│ ├── page.tsx
│ ├── signup
│ │ └── page.tsx
│ └── user
│ │ ├── loading.tsx
│ │ └── page.tsx
│ ├── components
│ └── Signup.tsx
│ ├── db.ts
│ ├── next.config.mjs
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── prisma
│ ├── migrations
│ │ ├── 20240311115536_init
│ │ │ └── migration.sql
│ │ ├── 20240311120844_unique
│ │ │ └── migration.sql
│ │ └── migration_lock.toml
│ └── schema.prisma
│ ├── public
│ ├── next.svg
│ └── vercel.svg
│ ├── tailwind.config.ts
│ └── tsconfig.json
├── WEEK15
├── README.md
├── week-15-live-1-main
│ ├── .gitignore
│ ├── Dockerfile
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── pnpm-lock.yaml
│ ├── prisma
│ │ ├── migrations
│ │ │ ├── 20240309103132_init
│ │ │ │ └── migration.sql
│ │ │ └── migration_lock.toml
│ │ └── schema.prisma
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
└── week-15-live-2.2-main
│ ├── .dockerignore
│ ├── .gitignore
│ ├── Dockerfile
│ ├── README.md
│ ├── docker-compose.yaml
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ ├── db.ts
│ └── index.ts
│ └── tsconfig.json
├── WEEK16
├── README.md
├── next-auth
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ ├── api
│ │ │ ├── auth
│ │ │ │ └── [...nextauth]
│ │ │ │ │ └── route.ts
│ │ │ └── user
│ │ │ │ └── route.ts
│ │ ├── favicon.ico
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ ├── lib
│ │ │ ├── auth.ts
│ │ │ └── providers.tsx
│ │ ├── page.tsx
│ │ └── signin
│ │ │ └── page.tsx
│ ├── components
│ │ └── Appbar.tsx
│ ├── next.config.mjs
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── public
│ │ ├── next.svg
│ │ └── vercel.svg
│ ├── tailwind.config.ts
│ └── tsconfig.json
└── turborepo
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── .npmrc
│ ├── README.md
│ ├── apps
│ ├── backend
│ │ ├── package.json
│ │ ├── src
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── docs
│ │ ├── .eslintrc.js
│ │ ├── README.md
│ │ ├── app
│ │ │ ├── favicon.ico
│ │ │ ├── globals.css
│ │ │ ├── layout.tsx
│ │ │ ├── page.module.css
│ │ │ └── page.tsx
│ │ ├── next-env.d.ts
│ │ ├── next.config.js
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── circles.svg
│ │ │ ├── next.svg
│ │ │ ├── turborepo.svg
│ │ │ └── vercel.svg
│ │ └── tsconfig.json
│ ├── react-app
│ │ ├── .eslintrc.cjs
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── public
│ │ │ └── vite.svg
│ │ ├── src
│ │ │ ├── App.css
│ │ │ ├── App.tsx
│ │ │ ├── assets
│ │ │ │ └── react.svg
│ │ │ ├── index.css
│ │ │ ├── main.tsx
│ │ │ └── vite-env.d.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.node.json
│ │ └── vite.config.ts
│ ├── react-app2
│ │ ├── .eslintrc.cjs
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── public
│ │ │ └── vite.svg
│ │ ├── src
│ │ │ ├── App.css
│ │ │ ├── App.tsx
│ │ │ ├── assets
│ │ │ │ └── react.svg
│ │ │ ├── index.css
│ │ │ ├── main.tsx
│ │ │ └── vite-env.d.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.node.json
│ │ └── vite.config.ts
│ └── web
│ │ ├── .eslintrc.js
│ │ ├── README.md
│ │ ├── app
│ │ ├── favicon.ico
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ ├── page.module.css
│ │ └── page.tsx
│ │ ├── next-env.d.ts
│ │ ├── next.config.js
│ │ ├── package.json
│ │ ├── public
│ │ ├── circles.svg
│ │ ├── next.svg
│ │ ├── turborepo.svg
│ │ └── vercel.svg
│ │ └── tsconfig.json
│ ├── package-lock.json
│ ├── package.json
│ ├── packages
│ ├── common
│ │ ├── index.ts
│ │ ├── package.json
│ │ └── tsconfig.json
│ ├── eslint-config
│ │ ├── README.md
│ │ ├── library.js
│ │ ├── next.js
│ │ ├── package.json
│ │ └── react-internal.js
│ ├── typescript-config
│ │ ├── base.json
│ │ ├── nextjs.json
│ │ ├── package.json
│ │ └── react-library.json
│ └── ui
│ │ ├── .eslintrc.js
│ │ ├── package.json
│ │ ├── src
│ │ ├── Inputbox.tsx
│ │ ├── button.tsx
│ │ ├── card.tsx
│ │ └── code.tsx
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lint.json
│ │ └── turbo
│ │ └── generators
│ │ ├── config.ts
│ │ └── templates
│ │ └── component.hbs
│ ├── tsconfig.json
│ └── turbo.json
├── WEEK17
└── README.md
├── WEEK18
└── README.md
├── WEEK19
├── README.md
├── express-server-redis
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── middlewares-in-next
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ ├── api
│ │ │ └── route.ts
│ │ ├── favicon.ico
│ │ ├── fonts
│ │ │ ├── GeistMonoVF.woff
│ │ │ └── GeistVF.woff
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── middleware.ts
│ ├── next.config.ts
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.mjs
│ ├── public
│ │ ├── file.svg
│ │ ├── globe.svg
│ │ ├── next.svg
│ │ ├── vercel.svg
│ │ └── window.svg
│ ├── tailwind.config.ts
│ └── tsconfig.json
├── worker-redis
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── ws-nextjs
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ ├── favicon.ico
│ │ ├── fonts
│ │ │ ├── GeistMonoVF.woff
│ │ │ └── GeistVF.woff
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── next.config.ts
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.mjs
│ ├── public
│ │ ├── file.svg
│ │ ├── globe.svg
│ │ ├── next.svg
│ │ ├── vercel.svg
│ │ └── window.svg
│ ├── tailwind.config.ts
│ └── tsconfig.json
└── ws-nodejs
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ └── index.ts
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── WEEK21
├── README.md
├── attacker
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── pubsub
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ ├── PubSubManager.ts
│ │ └── index.ts
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── react-captcha
│ ├── .gitignore
│ ├── README.md
│ ├── eslint.config.js
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── assets
│ │ │ └── react.svg
│ │ ├── index.css
│ │ ├── main.tsx
│ │ └── vite-env.d.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
├── server
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
└── singleton-state
│ ├── package.json
│ ├── src
│ ├── GameManager.ts
│ ├── index.ts
│ └── logger.ts
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
└── WEEK22
├── README.md
└── cluster-nodejs
├── index.js
├── index.ts
├── package-lock.json
├── package.json
├── tsconfig.json
└── tsconfig.tsbuildinfo
/.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 | .env
12 | dist
13 | dist-ssr
14 | *.local
15 |
16 | # Editor directories and files
17 | .vscode/*
18 | !.vscode/extensions.json
19 | .idea
20 | .DS_Store
21 | *.suo
22 | *.ntvs*
23 | *.njsproj
24 | *.sln
25 | *.sw?
26 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-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 | # Local env files
9 | .env
10 | .env.local
11 | .env.development.local
12 | .env.test.local
13 | .env.production.local
14 |
15 | # Testing
16 | coverage
17 |
18 | # Turbo
19 | .turbo
20 |
21 | # Vercel
22 | .vercel
23 |
24 | # Build Outputs
25 | .next/
26 | out/
27 | build
28 | dist
29 |
30 |
31 | # Debug
32 | npm-debug.log*
33 | yarn-debug.log*
34 | yarn-error.log*
35 |
36 | # Misc
37 | .DS_Store
38 | *.pem
39 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/.npmrc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/chat-app/.npmrc
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "eslint.workingDirectories": [
3 | {
4 | "mode": "auto"
5 | }
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/.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 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # env files (can opt-in for commiting if needed)
29 | .env*
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/chat-app/apps/docs/app/favicon.ico
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/app/fonts/GeistMonoVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/chat-app/apps/docs/app/fonts/GeistMonoVF.woff
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/app/fonts/GeistVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/chat-app/apps/docs/app/fonts/GeistVF.woff
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/eslint.config.js:
--------------------------------------------------------------------------------
1 | import { nextJsConfig } from "@repo/eslint-config/next-js";
2 |
3 | /** @type {import("eslint").Linter.Config} */
4 | export default nextJsConfig;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | export default nextConfig;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/public/file-text.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/docs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/nextjs.json",
3 | "compilerOptions": {
4 | "plugins": [
5 | {
6 | "name": "next"
7 | }
8 | ]
9 | },
10 | "include": [
11 | "**/*.ts",
12 | "**/*.tsx",
13 | "next-env.d.ts",
14 | "next.config.js",
15 | ".next/types/**/*.ts"
16 | ],
17 | "exclude": [
18 | "node_modules"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/.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 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # env files (can opt-in for commiting if needed)
29 | .env*
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/chat-app/apps/web/app/favicon.ico
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/app/fonts/GeistMonoVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/chat-app/apps/web/app/fonts/GeistMonoVF.woff
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/app/fonts/GeistVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/chat-app/apps/web/app/fonts/GeistVF.woff
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/eslint.config.js:
--------------------------------------------------------------------------------
1 | import { nextJsConfig } from "@repo/eslint-config/next-js";
2 |
3 | /** @type {import("eslint").Linter.Config} */
4 | export default nextJsConfig;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | export default nextConfig;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/public/file-text.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/apps/web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/nextjs.json",
3 | "compilerOptions": {
4 | "plugins": [
5 | {
6 | "name": "next"
7 | }
8 | ]
9 | },
10 | "include": [
11 | "**/*.ts",
12 | "**/*.tsx",
13 | "next-env.d.ts",
14 | "next.config.js",
15 | ".next/types/**/*.ts"
16 | ],
17 | "exclude": [
18 | "node_modules"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chat-app",
3 | "private": true,
4 | "scripts": {
5 | "build": "turbo run build",
6 | "dev": "turbo run dev",
7 | "lint": "turbo run lint",
8 | "format": "prettier --write \"**/*.{ts,tsx,md}\"",
9 | "check-types": "turbo run check-types"
10 | },
11 | "devDependencies": {
12 | "prettier": "^3.5.3",
13 | "turbo": "^2.4.4",
14 | "typescript": "5.8.2"
15 | },
16 | "packageManager": "pnpm@9.0.0",
17 | "engines": {
18 | "node": ">=18"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/eslint-config/README.md:
--------------------------------------------------------------------------------
1 | # `@turbo/eslint-config`
2 |
3 | Collection of internal eslint configurations.
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/typescript-config/base.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "compilerOptions": {
4 | "declaration": true,
5 | "declarationMap": true,
6 | "esModuleInterop": true,
7 | "incremental": false,
8 | "isolatedModules": true,
9 | "lib": ["es2022", "DOM", "DOM.Iterable"],
10 | "module": "NodeNext",
11 | "moduleDetection": "force",
12 | "moduleResolution": "NodeNext",
13 | "noUncheckedIndexedAccess": true,
14 | "resolveJsonModule": true,
15 | "skipLibCheck": true,
16 | "strict": true,
17 | "target": "ES2022"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/typescript-config/nextjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": "./base.json",
4 | "compilerOptions": {
5 | "plugins": [{ "name": "next" }],
6 | "module": "ESNext",
7 | "moduleResolution": "Bundler",
8 | "allowJs": true,
9 | "jsx": "preserve",
10 | "noEmit": true
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/typescript-config/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/typescript-config",
3 | "version": "0.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "publishConfig": {
7 | "access": "public"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/typescript-config/react-library.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": "./base.json",
4 | "compilerOptions": {
5 | "jsx": "react-jsx"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/ui/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | import { config } from "@repo/eslint-config/react-internal";
2 |
3 | /** @type {import("eslint").Linter.Config} */
4 | export default config;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/ui/src/button.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import { ReactNode } from "react";
4 |
5 | interface ButtonProps {
6 | children: ReactNode;
7 | className?: string;
8 | appName: string;
9 | }
10 |
11 | export const Button = ({ children, className, appName }: ButtonProps) => {
12 | return (
13 |
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/ui/src/card.tsx:
--------------------------------------------------------------------------------
1 | import { type JSX } from "react";
2 |
3 | export function Card({
4 | className,
5 | title,
6 | children,
7 | href,
8 | }: {
9 | className?: string;
10 | title: string;
11 | children: React.ReactNode;
12 | href: string;
13 | }): JSX.Element {
14 | return (
15 |
21 |
22 | {title} ->
23 |
24 | {children}
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/ui/src/code.tsx:
--------------------------------------------------------------------------------
1 | import { type JSX } from "react";
2 |
3 | export function Code({
4 | children,
5 | className,
6 | }: {
7 | children: React.ReactNode;
8 | className?: string;
9 | }): JSX.Element {
10 | return {children}
;
11 | }
12 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/react-library.json",
3 | "compilerOptions": {
4 | "outDir": "dist"
5 | },
6 | "include": ["src"],
7 | "exclude": ["node_modules", "dist"]
8 | }
9 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/packages/ui/turbo/generators/templates/component.hbs:
--------------------------------------------------------------------------------
1 | export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => {
2 | return (
3 |
4 |
{{ pascalCase name }} Component
5 | {children}
6 |
7 | );
8 | };
9 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - "apps/*"
3 | - "packages/*"
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/chat-app/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "ui": "tui",
4 | "tasks": {
5 | "build": {
6 | "dependsOn": ["^build"],
7 | "inputs": ["$TURBO_DEFAULT$", ".env*"],
8 | "outputs": [".next/**", "!.next/cache/**"]
9 | },
10 | "lint": {
11 | "dependsOn": ["^lint"]
12 | },
13 | "check-types": {
14 | "dependsOn": ["^check-types"]
15 | },
16 | "dev": {
17 | "cache": false,
18 | "persistent": true
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/COHORT03/WEEK21/sc/Screenshot 2025-03-25 at 4.53.42 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/sc/Screenshot 2025-03-25 at 4.53.42 PM.png
--------------------------------------------------------------------------------
/COHORT03/WEEK21/sc/Screenshot 2025-03-25 at 4.56.43 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/sc/Screenshot 2025-03-25 at 4.56.43 PM.png
--------------------------------------------------------------------------------
/COHORT03/WEEK21/sc/Screenshot 2025-03-25 at 5.02.26 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/sc/Screenshot 2025-03-25 at 5.02.26 PM.png
--------------------------------------------------------------------------------
/COHORT03/WEEK21/sc/Screenshot 2025-03-26 at 11.12.53 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/sc/Screenshot 2025-03-26 at 11.12.53 PM.png
--------------------------------------------------------------------------------
/COHORT03/WEEK21/sc/Screenshot 2025-03-26 at 11.22.37 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/sc/Screenshot 2025-03-26 at 11.22.37 PM.png
--------------------------------------------------------------------------------
/COHORT03/WEEK21/sc/Screenshot 2025-03-26 at 7.07.56 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK21/sc/Screenshot 2025-03-26 at 7.07.56 PM.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-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 | # Local env files
9 | .env
10 | .env.local
11 | .env.development.local
12 | .env.test.local
13 | .env.production.local
14 |
15 | # Testing
16 | coverage
17 |
18 | # Turbo
19 | .turbo
20 |
21 | # Vercel
22 | .vercel
23 |
24 | # Build Outputs
25 | .next/
26 | out/
27 | build
28 | dist
29 |
30 |
31 | # Debug
32 | npm-debug.log*
33 | yarn-debug.log*
34 | yarn-error.log*
35 |
36 | # Misc
37 | .DS_Store
38 | *.pem
39 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/.npmrc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/draw-app/.npmrc
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "eslint.workingDirectories": [
3 | {
4 | "mode": "auto"
5 | }
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/http-backend/src/middleware.ts:
--------------------------------------------------------------------------------
1 | import { NextFunction, Request, Response } from "express";
2 | import jwt from "jsonwebtoken";
3 | import { JWT_SECRET } from "@repo/backend-common/config";
4 |
5 |
6 | export function middleware(req: Request, res: Response, next: NextFunction) {
7 | const token = req.headers["authorization"] ?? "";
8 |
9 | const decoded = jwt.verify(token, JWT_SECRET);
10 |
11 | if (decoded) {
12 | // @ts-ignore: TODO: Fix this
13 | req.userId = decoded.userId;
14 | next();
15 | } else {
16 | res.status(403).json({
17 | message: "Unauthorized"
18 | })
19 | }
20 | }
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/http-backend/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/base.json",
3 | "compilerOptions": {
4 | "rootDir": "./src",
5 | "outDir": "./dist"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/.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 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # env files (can opt-in for commiting if needed)
29 | .env*
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/app/config.ts:
--------------------------------------------------------------------------------
1 |
2 | export const BACKEND_URL = "http://localhost:3001";
3 | export const WS_URL = "ws://localhost:8080";
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/draw-app/apps/web/app/favicon.ico
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/app/fonts/GeistMonoVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/draw-app/apps/web/app/fonts/GeistMonoVF.woff
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/app/fonts/GeistVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/draw-app/apps/web/app/fonts/GeistVF.woff
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/app/room/[slug]/page.tsx:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import { BACKEND_URL } from "../../config";
3 | import { ChatRoom } from "../../../components/ChatRoom";
4 |
5 | async function getRoomId(slug: string) {
6 | const response = await axios.get(`${BACKEND_URL}/room/${slug}`)
7 | console.log(response.data);
8 | return response.data.room.id;
9 | }
10 |
11 | export default async function ChatRoom1({
12 | params
13 | }: {
14 | params: {
15 | slug: string
16 | }
17 | }) {
18 | const slug = (await params).slug;
19 | const roomId = await getRoomId(slug);
20 |
21 | return
22 |
23 | }
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/components/ChatRoom.tsx:
--------------------------------------------------------------------------------
1 | import axios from "axios"
2 | import { BACKEND_URL } from "../app/config"
3 | import { ChatRoomClient } from "./ChatRoomClient";
4 |
5 | async function getChats(roomId: string) {
6 | const response = await axios.get(`${BACKEND_URL}/chats/${roomId}`);
7 | return response.data.messages;
8 | }
9 |
10 | export async function ChatRoom({id}: {
11 | id: string
12 | }) {
13 | const messages = await getChats(id);
14 | return
15 | }
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/eslint.config.js:
--------------------------------------------------------------------------------
1 | import { nextJsConfig } from "@repo/eslint-config/next-js";
2 |
3 | /** @type {import("eslint").Linter.Config} */
4 | export default nextJsConfig;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | export default nextConfig;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/public/file-text.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/nextjs.json",
3 | "compilerOptions": {
4 | "plugins": [
5 | {
6 | "name": "next"
7 | }
8 | ]
9 | },
10 | "include": [
11 | "**/*.ts",
12 | "**/*.tsx",
13 | "next-env.d.ts",
14 | "next.config.js",
15 | ".next/types/**/*.ts"
16 | ],
17 | "exclude": [
18 | "node_modules"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/ws-backend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ws-backend",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "build": "tsc -b",
7 | "start": "node ./dist/index.js",
8 | "dev": "npm run build && npm run start"
9 | },
10 | "dependencies": {
11 | "@types/jsonwebtoken": "^9.0.7",
12 | "jsonwebtoken": "^9.0.2",
13 | "ws": "^8.18.0",
14 | "@repo/db": "workspace:*"
15 | },
16 | "devDependencies": {
17 | "@repo/typescript-config": "workspace:*",
18 | "@types/ws": "^8.5.13",
19 | "@repo/backend-common": "workspace:*"
20 | },
21 | "keywords": [],
22 | "author": "",
23 | "license": "ISC",
24 | "description": ""
25 | }
26 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/apps/ws-backend/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/base.json",
3 | "compilerOptions": {
4 | "rootDir": "./src",
5 | "outDir": "./dist"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "draw-app",
3 | "private": true,
4 | "scripts": {
5 | "build": "turbo build",
6 | "dev": "turbo dev",
7 | "lint": "turbo lint",
8 | "format": "prettier --write \"**/*.{ts,tsx,md}\""
9 | },
10 | "devDependencies": {
11 | "prettier": "^3.2.5",
12 | "turbo": "^2.3.3",
13 | "typescript": "5.5.4"
14 | },
15 | "packageManager": "pnpm@9.0.0",
16 | "engines": {
17 | "node": ">=18"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/backend-common/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/backend-common",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "exports": {
6 | "./config": "./src/index.ts"
7 | },
8 | "scripts": {
9 | "test": "echo \"Error: no test specified\" && exit 1"
10 | },
11 | "devDependencies": {
12 | "@repo/typescript-config": "workspace:*"
13 | },
14 | "keywords": [],
15 | "author": "",
16 | "license": "ISC",
17 | "description": "",
18 | "dependencies": {
19 | "@types/node": "^22.10.5"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/backend-common/src/index.ts:
--------------------------------------------------------------------------------
1 |
2 | export const JWT_SECRET = process.env.JWT_SECRET || "123123";
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/backend-common/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/base.json"
3 | }
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/common/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/common",
3 | "version": "1.0.0",
4 | "exports": {
5 | "./types": "./src/types.ts"
6 | },
7 | "main": "index.js",
8 | "scripts": {
9 | "test": "echo \"Error: no test specified\" && exit 1"
10 | },
11 | "devDependencies": {
12 | "@repo/typescript-config": "workspace:*"
13 | },
14 | "keywords": [],
15 | "author": "",
16 | "license": "ISC",
17 | "description": "",
18 | "dependencies": {
19 | "zod": "^3.24.1"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/common/src/types.ts:
--------------------------------------------------------------------------------
1 | import { z } from "zod";
2 |
3 | export const CreateUserSchema = z.object({
4 | username: z.string().min(3).max(20),
5 | password: z.string(),
6 | name: z.string()
7 | })
8 |
9 | export const SigninSchema = z.object({
10 | username: z.string().min(3).max(20),
11 | password: z.string(),
12 | })
13 |
14 | export const CreateRoomSchema = z.object({
15 | name: z.string().min(3).max(20),
16 | })
17 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/common/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/base.json"
3 | }
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/db/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | # Keep environment variables out of version control
3 | .env
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/db/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/db",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "exports": {
6 | "./client": "./src/index.ts"
7 | },
8 | "scripts": {
9 | "test": "echo \"Error: no test specified\" && exit 1"
10 | },
11 | "devDependencies": {
12 | "@repo/typescript-config": "workspace:*"
13 | },
14 | "keywords": [],
15 | "author": "",
16 | "license": "ISC",
17 | "description": "",
18 | "dependencies": {
19 | "@prisma/client": "6.2.1",
20 | "prisma": "^6.2.1"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/db/prisma/migrations/20250112153819_made_photo_optional/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "User" ALTER COLUMN "photo" DROP NOT NULL;
3 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/db/prisma/migrations/20250112155013_email_unique/migration.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Warnings:
3 |
4 | - A unique constraint covering the columns `[email]` on the table `User` will be added. If there are existing duplicate values, this will fail.
5 |
6 | */
7 | -- CreateIndex
8 | CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
9 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/db/prisma/migrations/migration_lock.toml:
--------------------------------------------------------------------------------
1 | # Please do not edit this file manually
2 | # It should be added in your version-control system (e.g., Git)
3 | provider = "postgresql"
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/db/src/index.ts:
--------------------------------------------------------------------------------
1 |
2 | import { PrismaClient } from "@prisma/client";
3 |
4 | export const prismaClient = new PrismaClient();
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/db/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/base.json"
3 | }
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/eslint-config/README.md:
--------------------------------------------------------------------------------
1 | # `@turbo/eslint-config`
2 |
3 | Collection of internal eslint configurations.
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/typescript-config/base.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "compilerOptions": {
4 | "declaration": true,
5 | "declarationMap": true,
6 | "esModuleInterop": true,
7 | "incremental": false,
8 | "isolatedModules": true,
9 | "lib": ["es2022", "DOM", "DOM.Iterable"],
10 | "module": "NodeNext",
11 | "moduleDetection": "force",
12 | "moduleResolution": "NodeNext",
13 | "noUncheckedIndexedAccess": true,
14 | "resolveJsonModule": true,
15 | "skipLibCheck": true,
16 | "strict": true,
17 | "target": "ES2022"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/typescript-config/nextjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": "./base.json",
4 | "compilerOptions": {
5 | "plugins": [{ "name": "next" }],
6 | "module": "ESNext",
7 | "moduleResolution": "Bundler",
8 | "allowJs": true,
9 | "jsx": "preserve",
10 | "noEmit": true
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/typescript-config/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/typescript-config",
3 | "version": "0.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "publishConfig": {
7 | "access": "public"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/typescript-config/react-library.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": "./base.json",
4 | "compilerOptions": {
5 | "jsx": "react-jsx"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/ui/eslint.config.js:
--------------------------------------------------------------------------------
1 | import { config } from "@repo/eslint-config/react-internal";
2 |
3 | /** @type {import("eslint").Linter.Config} */
4 | export default config;
5 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/ui/src/button.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import { ReactNode } from "react";
4 |
5 | interface ButtonProps {
6 | children: ReactNode;
7 | className?: string;
8 | appName: string;
9 | }
10 |
11 | export const Button = ({ children, className, appName }: ButtonProps) => {
12 | return (
13 |
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/ui/src/card.tsx:
--------------------------------------------------------------------------------
1 | import { type JSX } from "react";
2 |
3 | export function Card({
4 | className,
5 | title,
6 | children,
7 | href,
8 | }: {
9 | className?: string;
10 | title: string;
11 | children: React.ReactNode;
12 | href: string;
13 | }): JSX.Element {
14 | return (
15 |
21 |
22 | {title} ->
23 |
24 | {children}
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/ui/src/code.tsx:
--------------------------------------------------------------------------------
1 | import { type JSX } from "react";
2 |
3 | export function Code({
4 | children,
5 | className,
6 | }: {
7 | children: React.ReactNode;
8 | className?: string;
9 | }): JSX.Element {
10 | return {children}
;
11 | }
12 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/react-library.json",
3 | "compilerOptions": {
4 | "outDir": "dist"
5 | },
6 | "include": ["src"],
7 | "exclude": ["node_modules", "dist"]
8 | }
9 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/packages/ui/turbo/generators/templates/component.hbs:
--------------------------------------------------------------------------------
1 | export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => {
2 | return (
3 |
4 |
{{ pascalCase name }} Component
5 | {children}
6 |
7 | );
8 | };
9 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - "apps/*"
3 | - "packages/*"
4 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/draw-app/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "ui": "tui",
4 | "tasks": {
5 | "build": {
6 | "dependsOn": ["^build"],
7 | "inputs": ["$TURBO_DEFAULT$", ".env*"],
8 | "outputs": [".next/**", "!.next/cache/**"]
9 | },
10 | "lint": {
11 | "dependsOn": ["^lint"]
12 | },
13 | "check-types": {
14 | "dependsOn": ["^check-types"]
15 | },
16 | "dev": {
17 | "cache": false,
18 | "persistent": true
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/1.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/10.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/11.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/12.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/13.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/14.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/15.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/16.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/2.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/3.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/4.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/5.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/6.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/7.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/8.png
--------------------------------------------------------------------------------
/COHORT03/WEEK22/sc/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/COHORT03/WEEK22/sc/9.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Harkirat Singh 100xdevs Cohort 2.0
2 |
3 | ### This Repo contains -
4 | 1. All the topics covered in the live classes as well as the recorded videos.
5 | 2. All the assignments with their solutions given on the cohort.
6 | 3. All the extra links and gists shared on the cohort.
7 | 4. All the resources, pdfs, docs,stc shared on the cohort.
8 | 5. All the projects and their solutions given on the cohort.
9 |
10 | The repo is made on weekly basis as the cohort progresses.
11 | Feel free to access the repo and use it for your own learning.
--------------------------------------------------------------------------------
/WEEK01/LC01.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK01/LC01.pdf
--------------------------------------------------------------------------------
/WEEK01/LC02.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK01/LC02.pdf
--------------------------------------------------------------------------------
/WEEK01/RC02/level-1/02-Number.js:
--------------------------------------------------------------------------------
1 | function explainParseInt(value) {
2 | console.log("Original Value:", value);
3 | let result = parseInt(value);
4 | console.log("After parseInt:", result);
5 | }
6 |
7 | // Example Usage for parseInt
8 | explainParseInt("42");
9 | explainParseInt("42px");
10 | explainParseInt("3.14");
11 |
12 | function explainParseFloat(value) {
13 | console.log("Original Value:", value);
14 | let result = parseFloat(value);
15 | console.log("After parseFloat:", result);
16 | }
17 |
18 | // Example Usage for parseFloat
19 | explainParseFloat("3.14");
20 | explainParseFloat("42");
21 | explainParseFloat("42px");
22 |
--------------------------------------------------------------------------------
/WEEK01/RC02/level-2/01-Class.js:
--------------------------------------------------------------------------------
1 |
2 | class Animal {
3 | constructor(name, legCount) {
4 | this.name = name
5 | this.legCount = legCount
6 | }
7 | describe() {
8 | return `${this.name} has ${this.legCount} legs`
9 | }
10 | }
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WEEK01/RC02/level-2/03-JSON.js:
--------------------------------------------------------------------------------
1 | function jsonMethods(jsonString) {
2 | console.log("Original JSON String:", jsonString);
3 |
4 | // Parsing JSON string to JavaScript object
5 | let parsedObject = JSON.parse(jsonString);
6 | console.log("After JSON.parse():", parsedObject);
7 |
8 | // Stringifying JavaScript object to JSON string
9 | let jsonStringified = JSON.stringify(parsedObject);
10 | console.log("After JSON.stringify():", jsonStringified);
11 | }
12 |
13 | // Example Usage for JSON Methods
14 | const sampleJSONString =
15 | '{"key": "value", "number": 42, "nested": {"nestedKey": "nestedValue"}}';
16 |
17 | jsonMethods(sampleJSONString);
18 |
--------------------------------------------------------------------------------
/WEEK01/RC03.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK01/RC03.pdf
--------------------------------------------------------------------------------
/WEEK01/RC04.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK01/RC04.pdf
--------------------------------------------------------------------------------
/WEEK01/assignments/RC02/easy/findLargestElement.js:
--------------------------------------------------------------------------------
1 | /*
2 | Write a function `findLargestElement` that takes an array of numbers and returns the largest element.
3 | Example:
4 | - Input: [3, 7, 2, 9, 1]
5 | - Output: 9
6 | */
7 |
8 | function findLargestElement(numbers) {
9 | if(numbers.length == 0){
10 | return null;
11 | }
12 | let largest = numbers[0];
13 | for(let i=0;ilargest){
15 | largest=numbers[i];
16 | }
17 | }
18 | return largest;
19 | }
20 |
21 | module.exports = findLargestElement;
--------------------------------------------------------------------------------
/WEEK01/assignments/RC02/hard/todo-list.js:
--------------------------------------------------------------------------------
1 | /*
2 | Implement a class `Todo` having below methods
3 | - add(todo): adds todo to list of todos
4 | - remove(indexOfTodo): remove todo from list of todos
5 | - update(index, updatedTodo): update todo at given index
6 | - getAll: returns all todos
7 | - get(indexOfTodo): returns todo at given index
8 | - clear: deletes all todos
9 |
10 | Once you've implemented the logic, test your code by running
11 | */
12 |
13 | class Todo {
14 |
15 | }
16 |
17 | module.exports = Todo;
18 |
--------------------------------------------------------------------------------
/WEEK01/assignments/RC02/medium/countVowels.js:
--------------------------------------------------------------------------------
1 | /*
2 | Implement a function `countVowels` that takes a string as an argument and returns the number of vowels in the string.
3 | Note: Consider both uppercase and lowercase vowels ('a', 'e', 'i', 'o', 'u').
4 |
5 | Once you've implemented the logic, test your code by running
6 | */
7 |
8 | function countVowels(str) {
9 | // Your code here
10 | }
11 |
12 | module.exports = countVowels;
13 |
14 |
--------------------------------------------------------------------------------
/WEEK01/assignments/RC02/medium/palindrome.js:
--------------------------------------------------------------------------------
1 | /*
2 | Implement a function `isPalindrome` which takes a string as argument and returns true/false as its result.
3 | Note: the input string is case-insensitive which means 'Nan' is a palindrom as 'N' and 'n' are considered case-insensitive.
4 | */
5 |
6 | function isPalindrome(str) {
7 | return true;
8 | }
9 |
10 | module.exports = isPalindrome;
11 |
--------------------------------------------------------------------------------
/WEEK01/assignments/RC02/medium/times.js:
--------------------------------------------------------------------------------
1 | /*
2 | Write a function that calculates the time (in seconds) it takes for the JS code to calculate sum from 1 to n, given n as the input.
3 | Try running it for
4 | 1. Sum from 1-100
5 | 2. Sum from 1-100000
6 | 3. Sum from 1-1000000000
7 | Hint - use Date class exposed in JS
8 | There is no automated test for this one, this is more for you to understand time goes up as computation goes up
9 | */
10 |
11 | function calculateTime(n) {
12 | return 0.01;
13 | }
--------------------------------------------------------------------------------
/WEEK01/assignments/RC02/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "01",
3 | "version": "1.0.0",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "01",
9 | "version": "1.0.0",
10 | "license": "ISC"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WEEK01/assignments/RC02/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "01",
3 | "version": "1.0.0",
4 | "description": "You are provided empty JavaScript files (or having function signatures) in this directory. You have to follow the instructions given in each file and write the code in the same file to complete the assignment.",
5 | "main": "anagram.js",
6 | "directories": {
7 | "test": "tests"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC"
12 | }
13 |
--------------------------------------------------------------------------------
/WEEK02/2.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK02/2.1.pdf
--------------------------------------------------------------------------------
/WEEK02/2.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK02/2.2.pdf
--------------------------------------------------------------------------------
/WEEK02/2.5.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK02/2.5.pdf
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | solutions
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/1-counter.js:
--------------------------------------------------------------------------------
1 | let counter = 0;
2 | setInterval(() => {
3 | console.clear();
4 | console.log(counter);
5 | counter++;
6 | }, 1000);
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/1-counter.md:
--------------------------------------------------------------------------------
1 | ## Create a counter in JavaScript
2 |
3 | We have already covered this in the second lesson, but as an easy recap try to code a counter in Javascript
4 | It should go up as time goes by in intervals of 1 second
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/2-counter.js:
--------------------------------------------------------------------------------
1 | let counter=0;
2 |
3 | const timer = () => {
4 | setTimeout(() => {
5 | console.clear();
6 | console.log(counter);
7 | counter++;
8 | timer();
9 | }, 1000);
10 | }
11 |
12 | timer();
13 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/2-counter.md:
--------------------------------------------------------------------------------
1 | ## Counter without setInterval
2 |
3 | Without using setInterval, try to code a counter in Javascript. There is a hint at the bottom of the file if you get stuck.
4 |
5 | (Hint: setTimeout)
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | (Hint: setTimeout)
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/3-read-from-file.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 | let c=0;
3 |
4 | let fileText = new Promise((resolve) => {
5 | fs.readFile("file.txt", "utf-8", (err, data) => {
6 | resolve(data);
7 | });
8 | });
9 |
10 | fileText.then((data) => {
11 | console.log(data);
12 | }).then(() => {
13 | console.log("hello2");
14 | })
15 |
16 | for (let i = 0; i < 1000000000; i++) {
17 | c+=2;
18 | }
19 | console.log(c);
20 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/3-read-from-file.md:
--------------------------------------------------------------------------------
1 | ## Reading the contents of a file
2 |
3 | Write code to read contents of a file and print it to the console.
4 | You can use the fs library to as a black box, the goal is to understand async tasks.
5 | Try to do an expensive operation below the file read and see how it affects the output.
6 | Make the expensive operation more and more expensive and see how it affects the output.
7 |
8 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/4-write-to-file.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 |
3 | let writeText = new Promise((resolve) => {
4 | fs.appendFile('./file.txt', 'wow', (err,data) => {
5 | resolve(data);
6 | })
7 | });
8 |
9 | writeText.then((data)=> {
10 | console.log(data);
11 | })
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/4-write-to-file.md:
--------------------------------------------------------------------------------
1 | ## Write to a file
2 | Using the fs library again, try to write to the contents of a file.
3 | You can use the fs library to as a black box, the goal is to understand async tasks.
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/easy/file.txt:
--------------------------------------------------------------------------------
1 | wowwow
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/hard (promises)/1-promisify-setTimeout.js:
--------------------------------------------------------------------------------
1 | /*
2 | Write a function that returns a promise that resolves after n seconds have passed, where n is passed as an argument to the function.
3 | */
4 |
5 | function wait(n) {
6 | return new Promise((resolve)=> {
7 | setTimeout(() => {
8 | resolve();
9 | }, n*1000);
10 | })
11 | }
12 |
13 | module.exports = wait;
14 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/hard (promises)/2-sleep-completely.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Write a function that halts the JS thread (make it busy wait) for a given number of milliseconds.
3 | * During this time the thread should not be able to do anything else.
4 | * the function should return a promise just like before
5 | */
6 |
7 | function sleep(milliseconds) {
8 | let end = Date.now() + milliseconds;
9 | while(Date.now() < end){
10 | continue;
11 | }
12 | return Promise.resolve();
13 | }
14 |
15 | module.exports = sleep;
16 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/hard (promises)/3-promise-all.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Write 3 different functions that return promises that resolve after t1, t2, and t3 seconds respectively.
3 | * Write a function that uses the 3 functions to wait for all 3 promises to resolve using Promise.all,
4 | * Return a promise.all which return the time in milliseconds it takes to complete the entire operation.
5 | */
6 |
7 | function wait1(t) {
8 |
9 | }
10 |
11 | function wait2(t) {
12 |
13 | }
14 |
15 | function wait3(t) {
16 |
17 | }
18 |
19 | function calculateTime(t1, t2, t3) {
20 |
21 | }
22 |
23 | module.exports = calculateTime;
24 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/hard (promises)/4-promise-chain.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Write 3 different functions that return promises that resolve after t1, t2, and t3 seconds respectively.
3 | * Write a function that sequentially calls all 3 of these functions in order.
4 | * Return a promise chain which return the time in milliseconds it takes to complete the entire operation.
5 | * Compare it with the results from 3-promise-all.js
6 | */
7 |
8 | function wait1(t) {
9 |
10 | }
11 |
12 | function wait2(t) {
13 |
14 | }
15 |
16 | function wait3(t) {
17 |
18 | }
19 |
20 | function calculateTime(t1, t2, t3) {
21 |
22 | }
23 |
24 | module.exports = calculateTime;
25 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/medium/1-file-cleaner.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 |
3 | let modifyText = new Promise((resolve)=> {
4 | fs.readFile('./file.txt', 'utf-8', (err,data)=> {
5 | resolve(data);
6 | })
7 | })
8 |
9 | modifyText.then((data)=> {
10 | console.log(data);
11 | let value = data.split(' ');
12 | console.log(value);
13 | value = value.filter((e)=> e.length>0);
14 | console.log(value);
15 | fs.writeFile('./file.txt', value.join(' '), (err)=> {
16 | if (err) throw err;
17 | console.log('The file has been saved!');
18 | })
19 | })
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/medium/1-file-cleaner.md:
--------------------------------------------------------------------------------
1 | ## File cleaner
2 | Read a file, remove all the extra spaces and write it back to the same file.
3 |
4 | For example, if the file input was
5 | ```
6 | hello world my name is raman
7 | ```
8 |
9 | After the program runs, the output should be
10 |
11 | ```
12 | hello world my name is raman
13 | ```
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/medium/2-clock.js:
--------------------------------------------------------------------------------
1 |
2 | // Using 1st method
3 | setInterval(() => {
4 | console.clear();
5 | let date = new Date();
6 | console.log(
7 | date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()
8 | );
9 | }, 1000);
10 |
11 |
12 | // Using 2nd method
13 | let timer = ()=> {
14 | setTimeout(() => {
15 | console.clear();
16 | let date = new Date();
17 | console.log(date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds());
18 | timer();
19 | }, 1000);
20 | }
21 |
22 | timer();
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/medium/2-clock.md:
--------------------------------------------------------------------------------
1 | Using `1-counter.md` or `2-counter.md` from the easy section, can you create a
2 | clock that shows you the current machine time?
3 |
4 | Can you make it so that it updates every second, and shows time in the following formats -
5 |
6 | - HH:MM::SS (Eg. 13:45:23)
7 |
8 | - HH:MM::SS AM/PM (Eg 01:45:23 PM)
9 |
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/medium/file.txt:
--------------------------------------------------------------------------------
1 | hello world my name is raman
--------------------------------------------------------------------------------
/WEEK02/assignments/01-async-js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "01-async",
3 | "version": "1.0.0",
4 | "description": "This folder contains assignments related to asynchronous JavaScript.",
5 | "main": "index.js",
6 | "scripts": {
7 | "1-promisify-setTimeout": "npx jest ./tests/1-promisify-setTimeout.test.js",
8 | "2-sleep-completely": "npx jest ./tests/2-sleep-completely.test.js",
9 | "3-promise-all": "npx jest ./tests/3-promise-all.test.js",
10 | "4-promise-chain": "npx jest ./tests/4-promise-chain.test.js",
11 | "all": "npx jest ./tests/"
12 | },
13 | "keywords": [],
14 | "author": "",
15 | "license": "ISC",
16 | "dependencies": {
17 | "jest": "^29.7.0"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WEEK02/assignments/02-nodejs/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/WEEK02/assignments/02-nodejs/files/a.txt:
--------------------------------------------------------------------------------
1 | hello from a.txt
--------------------------------------------------------------------------------
/WEEK02/assignments/02-nodejs/todos.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/WEEK03/3.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK03/3.1.pdf
--------------------------------------------------------------------------------
/WEEK03/3.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK03/3.2.pdf
--------------------------------------------------------------------------------
/WEEK03/assignments/01-middlewares/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/WEEK03/assignments/01-middlewares/coverage/lcov-report/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK03/assignments/01-middlewares/coverage/lcov-report/favicon.png
--------------------------------------------------------------------------------
/WEEK03/assignments/01-middlewares/coverage/lcov-report/sort-arrow-sprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK03/assignments/01-middlewares/coverage/lcov-report/sort-arrow-sprite.png
--------------------------------------------------------------------------------
/WEEK03/assignments/01-middlewares/index.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK03/assignments/01-middlewares/index.js
--------------------------------------------------------------------------------
/WEEK03/assignments/01-middlewares/jest.config.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | clearMocks: true,
3 | collectCoverage: true,
4 | coverageDirectory: 'coverage',
5 | coverageProvider: 'v8',
6 | };
7 |
8 |
--------------------------------------------------------------------------------
/WEEK03/assignments/01-middlewares/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "01-middlewares",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "express": "^4.18.2",
14 | "jest": "^29.7.0",
15 | "supertest": "^6.3.3"
16 | },
17 | "devDependencies": {
18 | "@babel/plugin-transform-modules-commonjs": "^7.23.3",
19 | "eslint-plugin-jest": "^27.6.0",
20 | "ts-node": "^10.9.2"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WEEK03/assignments/02-jwt/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/WEEK03/assignments/02-jwt/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "02-jwt",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "jsonwebtoken": "^9.0.2",
14 | "zod": "^3.22.4"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WEEK03/assignments/02-jwt/rough.js:
--------------------------------------------------------------------------------
1 | const jwt = require('jsonwebtoken');
2 |
3 | const email = "abc@gmail.com";
4 |
5 | let token = jwt.sign({email}, "jwtsecret");
6 |
7 | console.log(token);
8 |
9 | // eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImFiY0BnbWFpbC5jb20iLCJpYXQiOjE3MDM1ODk3ODZ9.uJZdsZV2rplixf3wky7Axvg7oBnlaZVRs9pUrggmM64
10 |
11 | let decoded = jwt.verify(token, "jwtsecret");
12 | console.log(decoded);
--------------------------------------------------------------------------------
/WEEK03/assignments/03-mongo/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/WEEK03/assignments/03-mongo/middleware/admin.js:
--------------------------------------------------------------------------------
1 | // Middleware for handling auth
2 | function adminMiddleware(req, res, next) {
3 | // Implement admin auth logic
4 | // You need to check the headers and validate the admin from the admin DB. Check readme for the exact headers to be expected
5 | console.log("admin middleware active");
6 | next();
7 | }
8 |
9 | module.exports = adminMiddleware;
--------------------------------------------------------------------------------
/WEEK03/assignments/03-mongo/middleware/user.js:
--------------------------------------------------------------------------------
1 | function userMiddleware(req, res, next) {
2 | // Implement user auth logic
3 | // You need to check the headers and validate the user from the user DB. Check readme for the exact headers to be expected
4 | console.log("user middleware active");
5 | next();
6 | }
7 |
8 | module.exports = userMiddleware;
--------------------------------------------------------------------------------
/WEEK03/assignments/03-mongo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "03-mongo",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "@babel/plugin-transform-modules-commonjs": "^7.23.3",
14 | "dotenv": "^16.3.1",
15 | "express": "^4.18.2",
16 | "jest": "^29.7.0",
17 | "mongoose": "^8.0.3",
18 | "supertest": "^6.3.3",
19 | "ts-node": "^10.9.2",
20 | "zod": "^3.22.4"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WEEK03/assignments/04-mongo-with-jwt-auth/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/WEEK03/assignments/04-mongo-with-jwt-auth/middleware/error-handler.js:
--------------------------------------------------------------------------------
1 | const errorHandlerMiddleware = (err, req, res, next) => {
2 | console.log('hii');
3 | res.status(500).json({message: err.message});
4 |
5 | }
6 |
7 | module.exports = errorHandlerMiddleware;
--------------------------------------------------------------------------------
/WEEK03/assignments/04-mongo-with-jwt-auth/rough.js:
--------------------------------------------------------------------------------
1 | // const z = require("zod");
2 |
3 | // const schema = z.object({
4 |
5 | // })
6 |
7 |
8 | const express = require('express');
9 |
10 | const app = express();
11 |
12 | const PORT = 2500;
13 |
14 | app.get('/ping', (req, res) => {
15 | throw new Error("Something went wrong");
16 | })
17 |
18 | app.use((err,req, res, next) => {
19 | res.status(500).send(err.message);
20 | })
21 |
22 | app.listen(PORT, () => {
23 | console.log(`Server is running on port ${PORT}`);
24 | })
--------------------------------------------------------------------------------
/WEEK04/4.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK04/4.1.pdf
--------------------------------------------------------------------------------
/WEEK04/4.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK04/4.2.pdf
--------------------------------------------------------------------------------
/WEEK05/5.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK05/5.1.pdf
--------------------------------------------------------------------------------
/WEEK06/6.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/6.1.pdf
--------------------------------------------------------------------------------
/WEEK06/6.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/6.2.pdf
--------------------------------------------------------------------------------
/WEEK06/6.3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/6.3.pdf
--------------------------------------------------------------------------------
/WEEK06/README.md:
--------------------------------------------------------------------------------
1 | ## WEEK06
2 |
3 | ### Live Classes
4 | 6.1 -> React returns, re-rendering, key, Wrapper components ✅
5 | 6.2 -> useEffect, useCallback, useMemo
6 |
7 |
8 | ### Recorded Classes
9 | 6.3 -> Reconcilliation, state, useState, useEffect, useMemo, useCallback, useRef ✅
10 |
11 |
12 | ### Notion Notes
13 | Link - https://quickest-juniper-f9c.notion.site/Cohort-2-0-FullStack-Open-Source-6b6c2a9f1282499aba4782b88bf7e204
14 |
15 |
16 | ### Assignments
17 | [Assignments](https://github.com/100xdevs-cohort-2/assignments)
18 | 1. After 6.2 Live Class ->
19 | Topics
20 | - useMemo ✅
21 | - useCallback ✅
22 | - useRef ✅
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/.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 |
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/assignments/1-use-memo/src/App.css
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/src/App.jsx:
--------------------------------------------------------------------------------
1 | import './App.css'
2 | import { Assignment1 } from './components/Assignment1'
3 | import { Assignment2 } from './components/Assignment2'
4 | import { Assignment3 } from './components/Assignment3'
5 |
6 | function App() {
7 | return (
8 | <>
9 | {/* */}
10 | {/* */}
11 |
12 | >
13 | )
14 | }
15 |
16 | export default App
17 |
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/assignments/1-use-memo/src/index.css
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK06/assignments/1-use-memo/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 |
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/.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 |
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/assignments/2-use-callback/src/App.css
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/src/App.jsx:
--------------------------------------------------------------------------------
1 | import './App.css'
2 | import { Assignment1 } from './components/Assignment1'
3 | import { Assignment2 } from './components/Assignment2'
4 |
5 | function App() {
6 | return (
7 | <>
8 | {/* */}
9 |
10 | >
11 | )
12 | }
13 |
14 | export default App
15 |
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/assignments/2-use-callback/src/index.css
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK06/assignments/2-use-callback/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 |
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/.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 |
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/assignments/3-use-ref/src/App.css
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/src/App.jsx:
--------------------------------------------------------------------------------
1 | import './App.css'
2 | import { Assignment1 } from './components/Assignment1'
3 | import { Assignment2 } from './components/Assignment2'
4 |
5 | function App() {
6 | return (
7 | <>
8 | {/* */}
9 |
10 | >
11 | )
12 | }
13 |
14 | export default App
15 |
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK06/assignments/3-use-ref/src/index.css
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK06/assignments/3-use-ref/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 |
--------------------------------------------------------------------------------
/WEEK06/assignments/README.md:
--------------------------------------------------------------------------------
1 | ## React hook assignments
2 | You will find a bunch of folders this week, each with some set of assignments for a specific hook
3 | Go to the folder (for example 1-use-memo) and comment out the Assignment component you are working on (Assignment1/Assignment2...) and try to solve it
4 | There are no tests, but solution videos will be provided
--------------------------------------------------------------------------------
/WEEK07/7.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK07/7.1.pdf
--------------------------------------------------------------------------------
/WEEK07/7.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK07/7.2.pdf
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/.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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK07/7.4-master/7.4-async-queries/src/App.css
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK07/7.4-master/7.4-async-queries/src/index.css
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | // import App from './App.jsx'
4 | import "./index.css";
5 | import App2 from "./App2.jsx";
6 | import { RecoilRoot } from "recoil";
7 |
8 | ReactDOM.createRoot(document.getElementById("root")).render(
9 |
10 |
11 |
12 | );
13 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-async-queries/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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/.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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK07/7.4-master/7.4-easy-bits/src/App.css
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK07/7.4-master/7.4-easy-bits/src/index.css
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | // import App from './App.jsx'
4 | // import './index.css'
5 | import App2 from "./App2.jsx";
6 | import { RecoilRoot } from "recoil";
7 |
8 | ReactDOM.createRoot(document.getElementById("root")).render(
9 |
10 | {/* */}
11 |
12 |
13 |
14 |
15 |
16 | );
17 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/7.4-easy-bits/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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/.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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/src/App.jsx:
--------------------------------------------------------------------------------
1 |
2 | import './App.css'
3 | import { RecoilRoot, useRecoilState } from 'recoil';
4 | import { todosAtomFamily } from './atoms';
5 |
6 | function App() {
7 | return
8 |
9 |
10 |
11 | }
12 |
13 | function Todo({id}) {
14 | const [todo, setTodo] = useRecoilState(todosAtomFamily(id));
15 |
16 | return (
17 | <>
18 | {todo.title}
19 | {todo.description}
20 |
21 | >
22 | )
23 | }
24 |
25 | export default App
26 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/src/atoms.ts:
--------------------------------------------------------------------------------
1 | import { atomFamily } from "recoil";
2 | import { TODOS } from "./todos";
3 |
4 | export const todosAtomFamily = atomFamily({
5 | key: 'todosAtomFamily',
6 | default: id => {
7 | return TODOS.find(x => x.id === id)
8 | },
9 | });
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/src/todos.ts:
--------------------------------------------------------------------------------
1 | export const TODOS = [{
2 | id: 1,
3 | title: "Go to Gym",
4 | description: "Hit the gym from 7-9"
5 | }, {
6 | id: 2,
7 | title: "Go to eat food",
8 | description: "Eat food from from 9-11"
9 | },]
10 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/atom-family/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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/.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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/src/App.jsx:
--------------------------------------------------------------------------------
1 |
2 | import './App.css'
3 | import { RecoilRoot, useRecoilStateLoadable } from 'recoil';
4 | import { todosAtomFamily } from './atoms';
5 |
6 | function App() {
7 | return
8 |
9 |
10 |
11 | }
12 |
13 | function Todo({id}) {
14 | const [todo, setTodo] = useRecoilStateLoadable(todosAtomFamily(id));
15 | if (todo.state === "loading") {
16 | return loading
17 | }
18 |
19 | return (
20 | <>
21 | {todo.contents.title}
22 | {todo.contents.description}
23 |
24 | >
25 | )
26 | }
27 |
28 | export default App
29 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/src/atoms.ts:
--------------------------------------------------------------------------------
1 | import { atomFamily, selectorFamily } from "recoil";
2 | import axios from "axios";
3 |
4 | export const todosAtomFamily = atomFamily({
5 | key: 'todosAtomFamily',
6 | default: selectorFamily({
7 | key: "todoSelectorFamily",
8 | get: (id) => async ({get}) => {
9 | await new Promise(r => setTimeout(r, 5000));
10 | const res = await axios.get(`https://sum-server.100xdevs.com/todo?id=${id}`);
11 | return res.data.todo;
12 | },
13 | })
14 | });
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/loadables/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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/.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 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/src/App.jsx:
--------------------------------------------------------------------------------
1 |
2 | import './App.css'
3 | import { RecoilRoot, useRecoilState } from 'recoil';
4 | import { todosAtomFamily } from './atoms';
5 |
6 | function App() {
7 | return
8 |
9 |
10 |
11 | }
12 |
13 | function Todo({id}) {
14 | const [todo, setTodo] = useRecoilState(todosAtomFamily(id));
15 |
16 | return (
17 | <>
18 | {todo.title}
19 | {todo.description}
20 |
21 | >
22 | )
23 | }
24 |
25 | export default App
26 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/src/atoms.ts:
--------------------------------------------------------------------------------
1 | import { atomFamily, selectorFamily } from "recoil";
2 | import axios from "axios";
3 |
4 | export const todosAtomFamily = atomFamily({
5 | key: 'todosAtomFamily',
6 | default: selectorFamily({
7 | key: "todoSelectorFamily",
8 | get: (id) => async ({get}) => {
9 | const res = await axios.get(`https://sum-server.100xdevs.com/todo?id=${id}`);
10 | return res.data.todo;
11 | },
12 | })
13 | });
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK07/7.4-master/selector-family/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 |
--------------------------------------------------------------------------------
/WEEK08/8.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK08/8.1.pdf
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mongo:4.4.7
2 | RUN echo "rs.initiate();" > /docker-entrypoint-initdb.d/replica-init.js
3 | CMD [ "--replSet", "rs" ]
4 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## Build a basic version of PayTM
3 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/backend/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/backend/config.js:
--------------------------------------------------------------------------------
1 | JWT_SECRET= "secret"
2 | module.exports = {JWT_SECRET};
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/backend/index.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const { connectDB } = require("./db");
3 | const router = require("./routes");
4 | const app = express();
5 |
6 | require('dotenv').config();
7 |
8 | const cors = require('cors');
9 |
10 | app.use(express.json());
11 | app.use(cors());
12 | app.use("/api/v1", router);
13 |
14 | app.listen(4000, ()=> {
15 | connectDB();
16 | console.log("Server is running on port 4000");
17 | })
18 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/backend/middleware.js:
--------------------------------------------------------------------------------
1 | const { JWT_SECRET } = require("./config");
2 | const jwt = require("jsonwebtoken");
3 |
4 | const authMiddleware = (req, res, next) => {
5 | const authHeader = req.headers.authorization;
6 |
7 | if (!authHeader || !authHeader.startsWith('Bearer ')) {
8 | return res.status(403).json({});
9 | }
10 |
11 | const token = authHeader.split(' ')[1];
12 |
13 | try {
14 | const decoded = jwt.verify(token, JWT_SECRET);
15 |
16 | req.userId = decoded.userId;
17 |
18 | next();
19 | } catch (err) {
20 | return res.status(403).json({});
21 | }
22 | };
23 |
24 | module.exports = {
25 | authMiddleware
26 | }
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/backend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "backend",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "cors": "^2.8.5",
14 | "dotenv": "^16.4.1",
15 | "express": "^4.18.2",
16 | "jsonwebtoken": "^9.0.2",
17 | "mongoose": "^8.1.0",
18 | "zod": "^3.22.4"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/backend/routes/index.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const router = express.Router();
3 | const userRouter = require("./user");
4 | const accountRouter = require("./account");
5 |
6 | router.get("/ping", (req,res)=> {
7 | res.send("pong");
8 | })
9 |
10 | router.use("/user", userRouter);
11 | router.use("/account", accountRouter);
12 |
13 | module.exports = router;
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/frontend/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:react/recommended',
7 | 'plugin:react/jsx-runtime',
8 | 'plugin:react-hooks/recommended',
9 | ],
10 | ignorePatterns: ['dist', '.eslintrc.cjs'],
11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
12 | settings: { react: { version: '18.2' } },
13 | plugins: ['react-refresh'],
14 | rules: {
15 | 'react-refresh/only-export-components': [
16 | 'warn',
17 | { allowConstantExport: true },
18 | ],
19 | },
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/frontend/.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 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/frontend/README.md:
--------------------------------------------------------------------------------
1 | # React + Vite
2 |
3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4 |
5 | Currently, two official plugins are available:
6 |
7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/frontend/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/frontend/src/App.jsx:
--------------------------------------------------------------------------------
1 |
2 | function App() {
3 |
4 | return (
5 |
6 | Hello world
7 |
8 | )
9 | }
10 |
11 | export default App
12 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/frontend/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.jsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK08/assignments/paytm-main/frontend/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 |
--------------------------------------------------------------------------------
/WEEK09/rough/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rough",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC"
12 | }
13 |
--------------------------------------------------------------------------------
/WEEK10/assignments/1-postgres-simple/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/WEEK10/assignments/1-postgres-simple/jest.config.js:
--------------------------------------------------------------------------------
1 | // jest.config.js
2 | module.exports = {
3 | preset: 'ts-jest',
4 | testEnvironment: 'node',
5 | // Optionally, set up paths to match your project structure
6 | roots: ['/src'],
7 | // Transform settings if you have custom needs, but this is optional since ts-jest is preset
8 | transform: {
9 | '^.+\\.ts$': 'ts-jest',
10 | },
11 | // Module file extensions for importing
12 | moduleFileExtensions: ['ts', 'js', 'json', 'node'],
13 | };
14 |
--------------------------------------------------------------------------------
/WEEK10/assignments/1-postgres-simple/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "1-postgres-simple",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "build": "tsc -b",
8 | "start": "node dist/index.js",
9 | "test": "jest"
10 | },
11 | "keywords": [],
12 | "author": "",
13 | "license": "ISC",
14 | "dependencies": {
15 | "@types/jest": "^29.5.12",
16 | "@types/pg": "^8.11.0",
17 | "pg": "^8.11.3",
18 | "typescript": "^5.3.3"
19 | },
20 | "devDependencies": {
21 | "jest": "^29.7.0",
22 | "ts-jest": "^29.1.2"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WEEK10/assignments/1-postgres-simple/src/config.ts:
--------------------------------------------------------------------------------
1 |
2 | export const DB_URL = "postgresql://debsouryadatta:ay9sNtUug2Wn@ep-fragrant-king-a11m6ein.ap-southeast-1.aws.neon.tech/cohort-week11-assignment1?sslmode=require";
--------------------------------------------------------------------------------
/WEEK10/assignments/1-postgres-simple/src/index.ts:
--------------------------------------------------------------------------------
1 | import { Client } from 'pg'
2 | import { DB_URL } from './config';
3 |
4 | export const client = new Client({
5 | connectionString: DB_URL
6 | });
7 |
--------------------------------------------------------------------------------
/WEEK10/assignments/1-postgres-simple/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "commonjs",
5 | "strict": true,
6 | "esModuleInterop": true,
7 | "skipLibCheck": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "rootDir": "src",
10 | "outDir": "dist",
11 | },
12 | "include": ["src/**/*"]
13 | }
14 |
--------------------------------------------------------------------------------
/WEEK10/assignments/2-prisma-simple/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | # Keep environment variables out of version control
3 | .env
4 |
--------------------------------------------------------------------------------
/WEEK10/assignments/2-prisma-simple/README.md:
--------------------------------------------------------------------------------
1 | ## Prisma Assignment
2 | Same as the last assignment, but you need to use `prisma` as the ORM.
3 |
4 | ## Pre-requisites
5 | 1. Checkout `prisma/schema.prisma` and see the initial schema that has been created.
6 | 2. Replace `db.url` with your database URL.
7 | 3. Run the following commands to migrate your database -
8 | ```js
9 | npx prisma migrate dev
10 | npx prisma generate
11 | ```
12 |
13 | ## Assignment
14 | You need to fill the db/user.ts and db/todos.ts using the `prisma` client to put in the data
15 |
16 | ## Testing
17 | Run `npm run test` to run all the tests
18 |
--------------------------------------------------------------------------------
/WEEK10/assignments/2-prisma-simple/jest.config.js:
--------------------------------------------------------------------------------
1 | // jest.config.js
2 | module.exports = {
3 | preset: 'ts-jest',
4 | testEnvironment: 'node',
5 | // Optionally, set up paths to match your project structure
6 | roots: ['/src'],
7 | // Transform settings if you have custom needs, but this is optional since ts-jest is preset
8 | transform: {
9 | '^.+\\.ts$': 'ts-jest',
10 | },
11 | // Module file extensions for importing
12 | moduleFileExtensions: ['ts', 'js', 'json', 'node'],
13 | };
14 |
--------------------------------------------------------------------------------
/WEEK10/assignments/2-prisma-simple/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "2-prisma-simple",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "build": "tsc -b",
8 | "start": "node dist/index.js",
9 | "test": "jest"
10 | },
11 | "keywords": [],
12 | "author": "",
13 | "license": "ISC",
14 | "dependencies": {
15 | "@prisma/client": "5.9.1",
16 | "@types/jest": "^29.5.12",
17 | "@types/pg": "^8.11.0",
18 | "pg": "^8.11.3",
19 | "typescript": "^5.3.3"
20 | },
21 | "devDependencies": {
22 | "jest": "^29.7.0",
23 | "prisma": "5.9.1",
24 | "ts-jest": "^29.1.2"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WEEK10/assignments/2-prisma-simple/prisma/migrations/20240205225711_i_nit/migration.sql:
--------------------------------------------------------------------------------
1 | -- CreateTable
2 | CREATE TABLE "User" (
3 | "id" SERIAL NOT NULL,
4 | "username" TEXT NOT NULL,
5 | "password" TEXT NOT NULL,
6 | "name" TEXT NOT NULL,
7 |
8 | CONSTRAINT "User_pkey" PRIMARY KEY ("id")
9 | );
10 |
11 | -- CreateTable
12 | CREATE TABLE "Todo" (
13 | "id" SERIAL NOT NULL,
14 | "userId" INTEGER NOT NULL,
15 | "title" TEXT NOT NULL,
16 | "description" TEXT,
17 | "done" BOOLEAN NOT NULL DEFAULT false,
18 |
19 | CONSTRAINT "Todo_pkey" PRIMARY KEY ("id")
20 | );
21 |
22 | -- CreateIndex
23 | CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
24 |
--------------------------------------------------------------------------------
/WEEK10/assignments/2-prisma-simple/prisma/migrations/migration_lock.toml:
--------------------------------------------------------------------------------
1 | # Please do not edit this file manually
2 | # It should be added in your version-control system (i.e. Git)
3 | provider = "postgresql"
--------------------------------------------------------------------------------
/WEEK10/assignments/2-prisma-simple/src/db/setup.ts:
--------------------------------------------------------------------------------
1 | import { PrismaClient } from '@prisma/client';
2 |
3 | const prisma = new PrismaClient();
4 |
5 | export async function dropTables() {
6 | await prisma.todo.deleteMany({});
7 | await prisma.user.deleteMany({});
8 | }
9 |
10 | module.exports = { dropTables };
11 |
--------------------------------------------------------------------------------
/WEEK10/class1-rough/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "class1-rough",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "@types/pg": "^8.11.0",
14 | "pg": "^8.11.3",
15 | "typescript": "^5.3.3"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WEEK10/class2-rough/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | # Keep environment variables out of version control
3 | .env
4 |
--------------------------------------------------------------------------------
/WEEK10/class2-rough/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "class2-rough",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "devDependencies": {
13 | "@types/node": "^20.11.17",
14 | "prisma": "^5.9.1",
15 | "ts-node": "^10.9.2",
16 | "typescript": "^5.3.3"
17 | },
18 | "dependencies": {
19 | "@prisma/client": "^5.9.1"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WEEK10/class2-rough/prisma/migrations/20240212073219_initialize/migration.sql:
--------------------------------------------------------------------------------
1 | -- CreateTable
2 | CREATE TABLE "User" (
3 | "id" SERIAL NOT NULL,
4 | "username" TEXT NOT NULL,
5 | "password" TEXT NOT NULL,
6 | "firstName" TEXT NOT NULL,
7 | "lastName" TEXT NOT NULL,
8 |
9 | CONSTRAINT "User_pkey" PRIMARY KEY ("id")
10 | );
11 |
12 | -- CreateTable
13 | CREATE TABLE "Todo" (
14 | "id" SERIAL NOT NULL,
15 | "title" TEXT NOT NULL,
16 | "description" TEXT NOT NULL,
17 | "done" BOOLEAN NOT NULL,
18 | "userId" INTEGER NOT NULL,
19 |
20 | CONSTRAINT "Todo_pkey" PRIMARY KEY ("id")
21 | );
22 |
--------------------------------------------------------------------------------
/WEEK10/class2-rough/prisma/migrations/20240212094334_initialize/migration.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Warnings:
3 |
4 | - A unique constraint covering the columns `[username]` on the table `User` will be added. If there are existing duplicate values, this will fail.
5 |
6 | */
7 | -- CreateIndex
8 | CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
9 |
--------------------------------------------------------------------------------
/WEEK10/class2-rough/prisma/migrations/migration_lock.toml:
--------------------------------------------------------------------------------
1 | # Please do not edit this file manually
2 | # It should be added in your version-control system (i.e. Git)
3 | provider = "postgresql"
--------------------------------------------------------------------------------
/WEEK11/class1-rough/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = tab
6 | tab_width = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.yml]
13 | indent_style = space
14 |
--------------------------------------------------------------------------------
/WEEK11/class1-rough/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 140,
3 | "singleQuote": true,
4 | "semi": true,
5 | "useTabs": true
6 | }
7 |
--------------------------------------------------------------------------------
/WEEK11/class1-rough/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "class1-rough",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "deploy": "wrangler deploy",
7 | "dev": "wrangler dev",
8 | "start": "wrangler dev"
9 | },
10 | "devDependencies": {
11 | "@cloudflare/workers-types": "^4.20240208.0",
12 | "typescript": "^5.0.4",
13 | "wrangler": "^3.0.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WEEK11/class1-rough/src/index.ts:
--------------------------------------------------------------------------------
1 |
2 | export interface Env {
3 |
4 | }
5 |
6 | export default {
7 | async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise {
8 | console.log(request.body);
9 | console.log(request.headers);
10 | // console.log(request.query);
11 | const url = new URL(request.url)
12 | console.log("URL:", url);
13 |
14 |
15 |
16 |
17 | if (request.method === "GET") {
18 | return Response.json({
19 | message: "you sent a get request",
20 | url: url
21 | });
22 | } else {
23 | return Response.json({
24 | message: "you did not send a get request",
25 | url: url
26 | });
27 | }
28 | },
29 | };
--------------------------------------------------------------------------------
/WEEK11/class1-rough2/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | .wrangler
4 | .dev.vars
5 |
6 | # Change them to your taste:
7 | package-lock.json
8 | yarn.lock
9 | pnpm-lock.yaml
10 | bun.lockb
--------------------------------------------------------------------------------
/WEEK11/class1-rough2/README.md:
--------------------------------------------------------------------------------
1 | ```
2 | npm install
3 | npm run dev
4 | ```
5 |
6 | ```
7 | npm run deploy
8 | ```
9 |
--------------------------------------------------------------------------------
/WEEK11/class1-rough2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "dev": "wrangler dev src/index.ts",
4 | "deploy": "wrangler deploy --minify src/index.ts"
5 | },
6 | "dependencies": {
7 | "hono": "^4.0.3"
8 | },
9 | "devDependencies": {
10 | "@cloudflare/workers-types": "^4.20240208.0",
11 | "wrangler": "^3.25.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WEEK11/class1-rough2/src/index.ts:
--------------------------------------------------------------------------------
1 | import { Hono } from 'hono'
2 |
3 | const app = new Hono()
4 |
5 | app.get('/', async (c) => {
6 | const body = await c.req.json()
7 | console.log(body);
8 | console.log(c.req.header("Authorization"));
9 | console.log(c.req.query("light"));
10 |
11 | if (body) {
12 | return c.json({body: body})
13 | } else {
14 | return c.json({body: "No body"})
15 | }
16 | })
17 |
18 | export default app
--------------------------------------------------------------------------------
/WEEK11/class1-rough2/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "module": "ESNext",
5 | "moduleResolution": "Bundler",
6 | "strict": true,
7 | "lib": [
8 | "ESNext"
9 | ],
10 | "types": [
11 | "@cloudflare/workers-types"
12 | ],
13 | "jsx": "react-jsx",
14 | "jsxImportSource": "hono/jsx"
15 | },
16 | }
--------------------------------------------------------------------------------
/WEEK11/class1-rough2/wrangler.toml:
--------------------------------------------------------------------------------
1 | name = "class1-rough2"
2 | compatibility_date = "2023-12-01"
3 |
4 | # [vars]
5 | # MY_VARIABLE = "production_value"
6 |
7 | # [[kv_namespaces]]
8 | # binding = "MY_KV_NAMESPACE"
9 | # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
10 |
11 | # [[r2_buckets]]
12 | # binding = "MY_BUCKET"
13 | # bucket_name = "my-bucket"
14 |
15 | # [[d1_databases]]
16 | # binding = "DB"
17 | # database_name = "my-database"
18 | # database_id = ""
19 |
--------------------------------------------------------------------------------
/WEEK12/aws-react-rough/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:@typescript-eslint/recommended',
7 | 'plugin:react-hooks/recommended',
8 | ],
9 | ignorePatterns: ['dist', '.eslintrc.cjs'],
10 | parser: '@typescript-eslint/parser',
11 | plugins: ['react-refresh'],
12 | rules: {
13 | 'react-refresh/only-export-components': [
14 | 'warn',
15 | { allowConstantExport: true },
16 | ],
17 | },
18 | }
19 |
--------------------------------------------------------------------------------
/WEEK12/aws-react-rough/.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 |
--------------------------------------------------------------------------------
/WEEK12/aws-react-rough/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React + TS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK12/aws-react-rough/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.tsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')!).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK12/aws-react-rough/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/WEEK12/aws-react-rough/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true,
8 | "strict": true
9 | },
10 | "include": ["vite.config.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/WEEK12/aws-react-rough/vite.config.ts:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "typescript-apis",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "express": "^4.18.3",
14 | "typescript": "^5.4.2",
15 | "zod": "^3.22.4"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/src/Exclude.ts:
--------------------------------------------------------------------------------
1 | // type event = 'click' | 'scroll' | 'mousemove'
2 |
3 | // type ExcludeEvent = Exclude;
4 |
5 | // const handleEvent = (event: ExcludeEvent) => {
6 | // console.log(event);
7 | // }
8 |
9 | // handleEvent('scroll'); // This is not allowed now!
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/src/Map.ts:
--------------------------------------------------------------------------------
1 | // interface User {
2 | // name: string;
3 | // age: number;
4 | // }
5 |
6 | // const myMap = new Map();
7 |
8 | // myMap.set('user1', {name: 'John', age: 25});
9 | // myMap.set('user2', {name: 'Doe', age: 30});
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/src/Partial.ts:
--------------------------------------------------------------------------------
1 | // interface User {
2 | // id: number;
3 | // name: string;
4 | // email: string;
5 | // password: string;
6 | // age: number;
7 | // }
8 |
9 |
10 | // type userDetails = Pick;
11 |
12 | // type FinalUserDetails = Partial
13 |
14 | // const returnUserDetails = (user: userDetails)=> {
15 | // console.log(user.name);
16 | // }
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/src/Pick.ts:
--------------------------------------------------------------------------------
1 | // interface User {
2 | // id: number;
3 | // name: string;
4 | // email: string;
5 | // password: string;
6 | // age: number;
7 | // }
8 | // // interface userDetails {
9 | // // name: string;
10 | // // email: string;
11 | // // age: number;
12 | // // }
13 |
14 | // type userDetails = Pick;
15 |
16 | // const returnUserDetails = (user: userDetails)=> {
17 | // console.log(user.name);
18 | // }
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/src/Readonly.ts:
--------------------------------------------------------------------------------
1 | // interface User {
2 | // readonly id: number;
3 | // name: string;
4 | // email: string;
5 | // password: string;
6 | // age: number;
7 | // }
8 |
9 | // type userDetails = Readonly
10 |
11 | // const user: userDetails = {
12 | // id: 1,
13 | // name: 'John',
14 | // email: 'John@gmail.com',
15 | // password: 'password',
16 | // age: 25
17 | // }
18 |
19 | // user.name = 'Doe'; // This is not allowed now!
20 |
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/src/Record.ts:
--------------------------------------------------------------------------------
1 | // type userDetails2 = Record;
2 |
3 | // const user: userDetails2 = {
4 | // "name": "John",
5 | // "email": "John@gmail.com",
6 | // "age": 25,
7 | // }
8 |
9 | // // type userDetails = {
10 | // // [key: string]: string | number;
11 | // // }
12 | // console.log(user);
13 |
14 |
--------------------------------------------------------------------------------
/WEEK12/typescript-apis/src/ZodInference.ts:
--------------------------------------------------------------------------------
1 | import {z} from 'zod';
2 |
3 | export const signinSchema = z.object({
4 | email: z.string(),
5 | password: z.string(),
6 | })
7 |
8 | export const signupSchema = z.object({
9 | email: z.string(),
10 | password: z.string(),
11 | name: z.string(),
12 | age: z.number(),
13 | })
14 |
15 | export type SigninType = z.infer;
16 | export type SignupType = z.infer;
--------------------------------------------------------------------------------
/WEEK13/medium/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | .wrangler
4 | .dev.vars
5 |
6 | # Change them to your taste:
7 | package-lock.json
8 | yarn.lock
9 | pnpm-lock.yaml
10 | bun.lockb
--------------------------------------------------------------------------------
/WEEK13/medium/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "dev": "wrangler dev src/index.ts",
4 | "deploy": "wrangler deploy --minify src/index.ts"
5 | },
6 | "dependencies": {
7 | "@100xdevs/medium-common": "^1.0.0",
8 | "@prisma/client": "^5.10.2",
9 | "@prisma/extension-accelerate": "^1.0.0",
10 | "hono": "^4.0.9",
11 | "prisma": "^5.10.2"
12 | },
13 | "devDependencies": {
14 | "@cloudflare/workers-types": "^4.20240208.0",
15 | "wrangler": "^3.31.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WEEK13/medium/prisma/migrations/migration_lock.toml:
--------------------------------------------------------------------------------
1 | # Please do not edit this file manually
2 | # It should be added in your version-control system (i.e. Git)
3 | provider = "postgresql"
--------------------------------------------------------------------------------
/WEEK13/medium/src/index.ts:
--------------------------------------------------------------------------------
1 | import { Hono } from "hono";
2 | import { PrismaClient } from "@prisma/client/edge";
3 | import { withAccelerate } from "@prisma/extension-accelerate";
4 | import { decode, sign, verify } from 'hono/jwt'
5 | import { userRouter } from "./routes/user";
6 | import { blogRouter } from "./routes/blog";
7 |
8 |
9 | // Ts can't read toml files so it doesn't know the type of the DATABASE_URL
10 | export const app = new Hono<{
11 | Bindings: {
12 | DATABASE_URL: string;
13 | JWT_SECRET: string;
14 | }
15 | }>();
16 |
17 | app.route("/api/v1/user", userRouter);
18 | app.route("api/v1/blog", blogRouter);
19 |
20 |
21 | export default app;
22 |
--------------------------------------------------------------------------------
/WEEK13/medium/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "module": "ESNext",
5 | "moduleResolution": "Bundler",
6 | "strict": true,
7 | "lib": [
8 | "ESNext"
9 | ],
10 | "types": [
11 | "@cloudflare/workers-types"
12 | ],
13 | "jsx": "react-jsx",
14 | "jsxImportSource": "hono/jsx"
15 | },
16 | }
--------------------------------------------------------------------------------
/WEEK14/next-app/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/WEEK14/next-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 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/WEEK14/next-app/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK14/next-app/app/favicon.ico
--------------------------------------------------------------------------------
/WEEK14/next-app/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/WEEK14/next-app/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import type { Metadata } from 'next';
2 | import { Inter } from 'next/font/google';
3 | import './globals.css';
4 |
5 | const inter = Inter({ subsets: ['latin'] });
6 |
7 | export const metadata: Metadata = {
8 | title: 'Medium',
9 | description: 'Medium like next app',
10 | };
11 |
12 | export default function RootLayout({
13 | children,
14 | }: Readonly<{
15 | children: React.ReactNode;
16 | }>) {
17 | return (
18 |
19 |
20 | Medium
21 | {children}
22 |
23 |
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/WEEK14/next-app/app/not-found.tsx:
--------------------------------------------------------------------------------
1 | export default function NotFound() {
2 | return (
3 |
4 | Could not find the page which you are looking for🤔
5 |
6 | );
7 | }
8 |
--------------------------------------------------------------------------------
/WEEK14/next-app/app/page.tsx:
--------------------------------------------------------------------------------
1 | export default function Home() {
2 | return Hi there
;
3 | }
4 |
--------------------------------------------------------------------------------
/WEEK14/next-app/app/signin/layout.tsx:
--------------------------------------------------------------------------------
1 | import { Metadata } from 'next';
2 |
3 | export const metadata: Metadata = {
4 | title: 'Sign in',
5 | };
6 |
7 | export default function SigninLayout({
8 | children,
9 | }: Readonly<{ children: React.ReactNode }>) {
10 | return (
11 |
12 |
13 | Login now to get 20% off
14 |
15 | {children}
16 |
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/WEEK14/next-app/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | export default nextConfig;
5 |
--------------------------------------------------------------------------------
/WEEK14/next-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "next-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "react": "^18",
13 | "react-dom": "^18",
14 | "next": "14.1.1"
15 | },
16 | "devDependencies": {
17 | "typescript": "^5",
18 | "@types/node": "^20",
19 | "@types/react": "^18",
20 | "@types/react-dom": "^18",
21 | "autoprefixer": "^10.0.1",
22 | "postcss": "^8",
23 | "tailwindcss": "^3.3.0",
24 | "eslint": "^8",
25 | "eslint-config-next": "14.1.1"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WEEK14/next-app/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/WEEK14/next-app/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK14/next-app/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from 'tailwindcss';
2 |
3 | const config: Config = {
4 | content: [
5 | './pages/**/*.{js,ts,jsx,tsx,mdx}',
6 | './components/**/*.{js,ts,jsx,tsx,mdx}',
7 | './app/**/*.{js,ts,jsx,tsx,mdx}',
8 | ],
9 | theme: {
10 | extend: {
11 | backgroundImage: {
12 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
13 | 'gradient-conic':
14 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
15 | },
16 | },
17 | },
18 | plugins: [],
19 | };
20 | export default config;
21 |
--------------------------------------------------------------------------------
/WEEK14/next-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": ["dom", "dom.iterable", "esnext"],
4 | "allowJs": true,
5 | "skipLibCheck": true,
6 | "strict": true,
7 | "noEmit": true,
8 | "esModuleInterop": true,
9 | "module": "esnext",
10 | "moduleResolution": "bundler",
11 | "resolveJsonModule": true,
12 | "isolatedModules": true,
13 | "jsx": "preserve",
14 | "incremental": true,
15 | "plugins": [
16 | {
17 | "name": "next"
18 | }
19 | ],
20 | "paths": {
21 | "@/*": ["./*"]
22 | }
23 | },
24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
25 | "exclude": ["node_modules"]
26 | }
27 |
--------------------------------------------------------------------------------
/WEEK14/next-server/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/WEEK14/next-server/.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 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/WEEK14/next-server/actions/user.ts:
--------------------------------------------------------------------------------
1 | "use server"
2 |
3 | import client from "@/db"
4 |
5 | export async function signup(email: string, password: string) {
6 | // should add zod validation here
7 | const user = await client.user.create({
8 | data: {
9 | email: email,
10 | password: password
11 | }
12 | });
13 |
14 | console.log(user.id);
15 |
16 | return "Signed up!"
17 | }
--------------------------------------------------------------------------------
/WEEK14/next-server/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK14/next-server/app/favicon.ico
--------------------------------------------------------------------------------
/WEEK14/next-server/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import type { Metadata } from "next";
2 | import { Inter } from "next/font/google";
3 | import "./globals.css";
4 |
5 | const inter = Inter({ subsets: ["latin"] });
6 |
7 | export const metadata: Metadata = {
8 | title: "Create Next App",
9 | description: "Generated by create next app",
10 | };
11 |
12 | export default function RootLayout({
13 | children,
14 | }: Readonly<{
15 | children: React.ReactNode;
16 | }>) {
17 | return (
18 |
19 | {children}
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/WEEK14/next-server/app/signup/page.tsx:
--------------------------------------------------------------------------------
1 | import { Signup } from "@/components/Signup"
2 |
3 | export default function() {
4 | return
5 | }
--------------------------------------------------------------------------------
/WEEK14/next-server/app/user/loading.tsx:
--------------------------------------------------------------------------------
1 | export default function Loading() {
2 | return (
3 |
4 | Loading...
5 |
6 | )
7 | }
--------------------------------------------------------------------------------
/WEEK14/next-server/db.ts:
--------------------------------------------------------------------------------
1 | import { PrismaClient } from '@prisma/client'
2 |
3 | const prismaClientSingleton = () => {
4 | return new PrismaClient()
5 | }
6 |
7 | declare global {
8 | var prisma: undefined | ReturnType
9 | }
10 |
11 | const prisma = globalThis.prisma ?? prismaClientSingleton()
12 |
13 | export default prisma
14 |
15 | if (process.env.NODE_ENV !== 'production') globalThis.prisma = prisma
--------------------------------------------------------------------------------
/WEEK14/next-server/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | export default nextConfig;
5 |
--------------------------------------------------------------------------------
/WEEK14/next-server/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/WEEK14/next-server/prisma/migrations/20240311115536_init/migration.sql:
--------------------------------------------------------------------------------
1 | -- CreateTable
2 | CREATE TABLE "User" (
3 | "id" SERIAL NOT NULL,
4 | "email" TEXT NOT NULL,
5 | "password" TEXT NOT NULL,
6 |
7 | CONSTRAINT "User_pkey" PRIMARY KEY ("id")
8 | );
9 |
--------------------------------------------------------------------------------
/WEEK14/next-server/prisma/migrations/20240311120844_unique/migration.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Warnings:
3 |
4 | - A unique constraint covering the columns `[email]` on the table `User` will be added. If there are existing duplicate values, this will fail.
5 |
6 | */
7 | -- CreateIndex
8 | CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
9 |
--------------------------------------------------------------------------------
/WEEK14/next-server/prisma/migrations/migration_lock.toml:
--------------------------------------------------------------------------------
1 | # Please do not edit this file manually
2 | # It should be added in your version-control system (i.e. Git)
3 | provider = "postgresql"
--------------------------------------------------------------------------------
/WEEK14/next-server/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK14/next-server/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "tailwindcss";
2 |
3 | const config: Config = {
4 | content: [
5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}",
6 | "./components/**/*.{js,ts,jsx,tsx,mdx}",
7 | "./app/**/*.{js,ts,jsx,tsx,mdx}",
8 | ],
9 | theme: {
10 | extend: {
11 | backgroundImage: {
12 | "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
13 | "gradient-conic":
14 | "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
15 | },
16 | },
17 | },
18 | plugins: [],
19 | };
20 | export default config;
21 |
--------------------------------------------------------------------------------
/WEEK14/next-server/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": ["dom", "dom.iterable", "esnext"],
4 | "allowJs": true,
5 | "skipLibCheck": true,
6 | "strict": true,
7 | "noEmit": true,
8 | "esModuleInterop": true,
9 | "module": "esnext",
10 | "moduleResolution": "bundler",
11 | "resolveJsonModule": true,
12 | "isolatedModules": true,
13 | "jsx": "preserve",
14 | "incremental": true,
15 | "plugins": [
16 | {
17 | "name": "next"
18 | }
19 | ],
20 | "paths": {
21 | "@/*": ["./*"]
22 | }
23 | },
24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
25 | "exclude": ["node_modules"]
26 | }
27 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 | # Keep environment variables out of version control
4 | .env
5 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:16-alpine
2 |
3 | WORKDIR /app
4 |
5 | COPY package* .
6 | RUN npm install
7 |
8 | COPY ./prisma .
9 | RUN npx prisma generate
10 |
11 | COPY . .
12 |
13 | RUN npm run build
14 |
15 | EXPOSE 3000
16 |
17 | CMD ["node", "dist/index.js"]
18 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/README.md:
--------------------------------------------------------------------------------
1 | - The env variables which must be present in the .env file, are passed through the docker command, env variables can be passed by both .env files as well as by the command line.
2 |
3 | - We are adding the "RUN npm prisma generate" in our Dockerfile, so that the prisma client is generated with the environment variables passed with the command when the docker image is built.
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "week-15-1",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "build": "tsc -b"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "@prisma/client": "^5.10.2",
14 | "express": "^4.18.3",
15 | "prisma": "^5.10.2"
16 | },
17 | "devDependencies": {
18 | "typescript": "^5.4.2",
19 | "@types/express": "^4.17.21"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/prisma/migrations/20240309103132_init/migration.sql:
--------------------------------------------------------------------------------
1 | -- CreateTable
2 | CREATE TABLE "User" (
3 | "id" SERIAL NOT NULL,
4 | "email" TEXT NOT NULL,
5 | "name" TEXT,
6 |
7 | CONSTRAINT "User_pkey" PRIMARY KEY ("id")
8 | );
9 |
10 | -- CreateIndex
11 | CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
12 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/prisma/migrations/migration_lock.toml:
--------------------------------------------------------------------------------
1 | # Please do not edit this file manually
2 | # It should be added in your version-control system (i.e. Git)
3 | provider = "postgresql"
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/prisma/schema.prisma:
--------------------------------------------------------------------------------
1 | // This is your Prisma schema file,
2 | // learn more about it in the docs: https://pris.ly/d/prisma-schema
3 |
4 | // Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
5 | // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
6 |
7 | generator client {
8 | provider = "prisma-client-js"
9 | }
10 |
11 | datasource db {
12 | provider = "postgresql"
13 | url = env("DATABASE_URL")
14 | }
15 |
16 | model User {
17 | id Int @id @default(autoincrement())
18 | email String @unique
19 | name String?
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-1-main/src/index.ts:
--------------------------------------------------------------------------------
1 |
2 | import { PrismaClient } from "@prisma/client";
3 | import express from "express";
4 |
5 | const app = express();
6 | app.use(express.json());
7 |
8 | const client = new PrismaClient();
9 |
10 | app.get("/", (req, res) => {
11 | res.json({
12 | message: "Healthy server"
13 | })
14 | })
15 |
16 | app.post("/", async (req, res) => {
17 | await client.user.create({
18 | data: {
19 | email: req.body.email,
20 | name: req.body.name
21 | }
22 | })
23 |
24 | res.json({
25 | message: "Done signing up!"
26 | })
27 | })
28 |
29 | app.listen(3000);
--------------------------------------------------------------------------------
/WEEK15/week-15-live-2.2-main/.dockerignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-2.2-main/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 |
--------------------------------------------------------------------------------
/WEEK15/week-15-live-2.2-main/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:20
2 |
3 | WORKDIR /app
4 |
5 | COPY package* .
6 |
7 | RUN npm install
8 |
9 | COPY . .
10 |
11 | RUN npm run build
12 |
13 | EXPOSE 3000
14 |
15 | CMD ["node", "dist/index.js"]
--------------------------------------------------------------------------------
/WEEK15/week-15-live-2.2-main/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK15/week-15-live-2.2-main/README.md
--------------------------------------------------------------------------------
/WEEK15/week-15-live-2.2-main/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 | mongodb:
4 | image: mongo
5 | container_name: mongodb
6 | ports:
7 | - "27017:27017"
8 | volumes:
9 | - mongodb_data:/data/db
10 |
11 | backend:
12 | build: .
13 | container_name: backend
14 | depends_on:
15 | - mongodb
16 | ports:
17 | - "3000:3000"
18 | environment:
19 | MONGO_URL: "mongodb://mongodb:27017"
20 |
21 | volumes:
22 | mongodb_data:
--------------------------------------------------------------------------------
/WEEK15/week-15-live-2.2-main/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "week-15-live-2.2",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "build": "tsc -b",
8 | "start": "node dist/index.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "@types/express": "^4.17.21",
15 | "@types/mongoose": "^5.11.97",
16 | "express": "^4.18.3",
17 | "mongoose": "^8.2.1",
18 | "typescript": "^5.4.2"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK16/next-auth/.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 | .yarn/install-state.gz
8 |
9 | # testing
10 | /coverage
11 |
12 | # next.js
13 | /.next/
14 | /out/
15 |
16 | # production
17 | /build
18 |
19 | # misc
20 | .DS_Store
21 | *.pem
22 |
23 | # debug
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/WEEK16/next-auth/app/api/auth/[...nextauth]/route.ts:
--------------------------------------------------------------------------------
1 | import { NEXT_AUTH_CONFIG } from "@/app/lib/auth";
2 | import NextAuth from "next-auth";
3 |
4 |
5 | const handler = NextAuth(NEXT_AUTH_CONFIG); // Taking the NEXT_AUTH_CONFIG from here to a separate file so that it can be used inside the server side to get the id of the user, because without passing the NEXT_AUTH_CONFIG to the getServerSession, the id of the user doesn't gets displayed
6 |
7 | export { handler as GET, handler as POST };
8 |
--------------------------------------------------------------------------------
/WEEK16/next-auth/app/api/user/route.ts:
--------------------------------------------------------------------------------
1 | import { NEXT_AUTH_CONFIG } from "@/app/lib/auth";
2 | import { getServerSession } from "next-auth"
3 | import { NextResponse } from "next/server";
4 |
5 | export async function GET() {
6 | const session = await getServerSession(NEXT_AUTH_CONFIG);
7 |
8 | return NextResponse.json({
9 | session
10 | })
11 | }
--------------------------------------------------------------------------------
/WEEK16/next-auth/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK16/next-auth/app/favicon.ico
--------------------------------------------------------------------------------
/WEEK16/next-auth/app/lib/providers.tsx:
--------------------------------------------------------------------------------
1 | 'use client';
2 | import React from 'react';
3 | import { SessionProvider } from 'next-auth/react';
4 |
5 | export const Providers = ({ children }: { children: React.ReactNode }) => {
6 | return (
7 |
8 | {children}
9 |
10 | );
11 | };
--------------------------------------------------------------------------------
/WEEK16/next-auth/app/page.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { Appbar } from "@/components/Appbar"
3 | import { useSession } from "next-auth/react"
4 |
5 | const page = () => {
6 | const session = useSession();
7 |
8 | return (
9 | <>
10 | Hello WOrld!
11 |
12 | {JSON.stringify(session.data?.user)}
13 | >
14 | )
15 | }
16 |
17 | export default page
--------------------------------------------------------------------------------
/WEEK16/next-auth/components/Appbar.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { signIn, signOut } from "next-auth/react"
3 | import Link from "next/link";
4 |
5 | export const Appbar = () => {
6 | return
7 | Signin
8 |
9 |
10 | }
--------------------------------------------------------------------------------
/WEEK16/next-auth/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {};
3 |
4 | export default nextConfig;
5 |
--------------------------------------------------------------------------------
/WEEK16/next-auth/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "next-auth",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "next": "14.1.4",
13 | "next-auth": "^4.24.7",
14 | "react": "^18",
15 | "react-dom": "^18"
16 | },
17 | "devDependencies": {
18 | "@types/node": "^20",
19 | "@types/react": "^18",
20 | "@types/react-dom": "^18",
21 | "autoprefixer": "^10.0.1",
22 | "postcss": "^8",
23 | "tailwindcss": "^3.3.0",
24 | "typescript": "^5"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WEEK16/next-auth/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/WEEK16/next-auth/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK16/next-auth/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "tailwindcss";
2 |
3 | const config: Config = {
4 | content: [
5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}",
6 | "./components/**/*.{js,ts,jsx,tsx,mdx}",
7 | "./app/**/*.{js,ts,jsx,tsx,mdx}",
8 | ],
9 | theme: {
10 | extend: {
11 | backgroundImage: {
12 | "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
13 | "gradient-conic":
14 | "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
15 | },
16 | },
17 | },
18 | plugins: [],
19 | };
20 | export default config;
21 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // This configuration only applies to the package manager root.
2 | /** @type {import("eslint").Linter.Config} */
3 | module.exports = {
4 | ignorePatterns: ["apps/**", "packages/**"],
5 | extends: ["@repo/eslint-config/library.js"],
6 | parser: "@typescript-eslint/parser",
7 | parserOptions: {
8 | project: true,
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/.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 | # Local env files
9 | .env
10 | .env.local
11 | .env.development.local
12 | .env.test.local
13 | .env.production.local
14 |
15 | # Testing
16 | coverage
17 |
18 | # Turbo
19 | .turbo
20 |
21 | # Vercel
22 | .vercel
23 |
24 | # Build Outputs
25 | .next/
26 | out/
27 | build
28 | dist
29 |
30 |
31 | # Debug
32 | npm-debug.log*
33 | yarn-debug.log*
34 | yarn-error.log*
35 |
36 | # Misc
37 | .DS_Store
38 | *.pem
39 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/.npmrc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK16/turborepo/.npmrc
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/backend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "backend",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev": "tsc && nodemon dist/index.js"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "express": "^4.19.2",
15 | "nodemon": "^3.1.0",
16 | "@repo/common": "*"
17 | },
18 | "devDependencies": {
19 | "@types/express": "^4.17.21"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/backend/src/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express';
2 | const app = express();
3 | import {URL} from '@repo/common/url';
4 |
5 | app.get('/', (req, res) => {
6 | res.status(200).json({ message: 'Hello from debu!', url: URL});
7 | });
8 |
9 | app.listen(5000, () => {
10 | console.log('Server is running on http://localhost:5000');
11 | });
12 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/backend/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/base.json",
3 | "compilerOptions": {
4 | "outDir": "./dist",
5 | "rootDir": "./src",
6 | },
7 | }
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/.eslintrc.js:
--------------------------------------------------------------------------------
1 | /** @type {import("eslint").Linter.Config} */
2 | module.exports = {
3 | root: true,
4 | extends: ["@repo/eslint-config/next.js"],
5 | parser: "@typescript-eslint/parser",
6 | parserOptions: {
7 | project: true,
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK16/turborepo/apps/docs/app/favicon.ico
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import "./globals.css";
2 | import type { Metadata } from "next";
3 | import { Inter } from "next/font/google";
4 |
5 | const inter = Inter({ subsets: ["latin"] });
6 |
7 | export const metadata: Metadata = {
8 | title: "Create Turborepo",
9 | description: "Generated by create turbo",
10 | };
11 |
12 | export default function RootLayout({
13 | children,
14 | }: {
15 | children: React.ReactNode;
16 | }): JSX.Element {
17 | return (
18 |
19 | {children}
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/app/page.tsx:
--------------------------------------------------------------------------------
1 | import Inputbox from "@repo/ui/Inputbox"
2 |
3 | const page = () => {
4 | return (
5 |
6 | Docs App
7 |
8 |
9 | )
10 | }
11 |
12 | export default page
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | module.exports = {
3 | transpilePackages: ["@repo/ui"],
4 | };
5 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/docs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/nextjs.json",
3 | "compilerOptions": {
4 | "plugins": [
5 | {
6 | "name": "next"
7 | }
8 | ]
9 | },
10 | "include": [
11 | "next-env.d.ts",
12 | "next.config.js",
13 | "**/*.ts",
14 | "**/*.tsx",
15 | ".next/types/**/*.ts"
16 | ],
17 | "exclude": ["node_modules"]
18 | }
19 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:@typescript-eslint/recommended',
7 | 'plugin:react-hooks/recommended',
8 | ],
9 | ignorePatterns: ['dist', '.eslintrc.cjs'],
10 | parser: '@typescript-eslint/parser',
11 | plugins: ['react-refresh'],
12 | rules: {
13 | 'react-refresh/only-export-components': [
14 | 'warn',
15 | { allowConstantExport: true },
16 | ],
17 | },
18 | }
19 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/.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 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React + TS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/src/App.tsx:
--------------------------------------------------------------------------------
1 | import Inputbox from '@repo/ui/Inputbox'
2 |
3 | const App = () => {
4 | return (
5 |
6 | React App
7 |
8 |
9 | )
10 | }
11 |
12 | export default App
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.tsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')!).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true,
8 | "strict": true
9 | },
10 | "include": ["vite.config.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app/vite.config.ts:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:@typescript-eslint/recommended',
7 | 'plugin:react-hooks/recommended',
8 | ],
9 | ignorePatterns: ['dist', '.eslintrc.cjs'],
10 | parser: '@typescript-eslint/parser',
11 | plugins: ['react-refresh'],
12 | rules: {
13 | 'react-refresh/only-export-components': [
14 | 'warn',
15 | { allowConstantExport: true },
16 | ],
17 | },
18 | }
19 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/.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 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React + TS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/src/App.tsx:
--------------------------------------------------------------------------------
1 | import Inputbox from '@repo/ui/Inputbox'
2 |
3 | const App = () => {
4 | return (
5 |
6 | React App 2
7 |
8 |
9 | )
10 | }
11 |
12 | export default App
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App.tsx'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root')!).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true,
8 | "strict": true
9 | },
10 | "include": ["vite.config.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/react-app2/vite.config.ts:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/.eslintrc.js:
--------------------------------------------------------------------------------
1 | /** @type {import("eslint").Linter.Config} */
2 | module.exports = {
3 | root: true,
4 | extends: ["@repo/eslint-config/next.js"],
5 | parser: "@typescript-eslint/parser",
6 | parserOptions: {
7 | project: true,
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK16/turborepo/apps/web/app/favicon.ico
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import "./globals.css";
2 | import type { Metadata } from "next";
3 | import { Inter } from "next/font/google";
4 |
5 | const inter = Inter({ subsets: ["latin"] });
6 |
7 | export const metadata: Metadata = {
8 | title: "Create Turborepo",
9 | description: "Generated by create turbo",
10 | };
11 |
12 | export default function RootLayout({
13 | children,
14 | }: {
15 | children: React.ReactNode;
16 | }): JSX.Element {
17 | return (
18 |
19 | {children}
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/app/page.tsx:
--------------------------------------------------------------------------------
1 | import Inputbox from '@repo/ui/Inputbox'
2 | import {URL} from '@repo/common/index'
3 |
4 | const page = () => {
5 | console.log(URL);
6 |
7 | return (
8 | <>
9 | {`${URL}`}
10 | Web App
11 |
12 |
13 | >
14 | );
15 | };
16 |
17 | export default page;
18 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | module.exports = {
3 | transpilePackages: ["@repo/ui"],
4 | };
5 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/apps/web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/nextjs.json",
3 | "compilerOptions": {
4 | "plugins": [
5 | {
6 | "name": "next"
7 | }
8 | ]
9 | },
10 | "include": [
11 | "next-env.d.ts",
12 | "next.config.js",
13 | "**/*.ts",
14 | "**/*.tsx",
15 | ".next/types/**/*.ts"
16 | ],
17 | "exclude": ["node_modules"]
18 | }
19 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "turborepo",
3 | "private": true,
4 | "scripts": {
5 | "build": "turbo build",
6 | "dev": "turbo dev",
7 | "lint": "turbo lint",
8 | "format": "prettier --write \"**/*.{ts,tsx,md}\""
9 | },
10 | "devDependencies": {
11 | "@repo/eslint-config": "*",
12 | "@repo/typescript-config": "*",
13 | "prettier": "^3.2.5",
14 | "turbo": "latest"
15 | },
16 | "engines": {
17 | "node": ">=18"
18 | },
19 | "packageManager": "npm@10.4.0",
20 | "workspaces": [
21 | "apps/*",
22 | "packages/*"
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/common/index.ts:
--------------------------------------------------------------------------------
1 | export const URL = "http://localhost:10000";
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/common/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/common",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "exports": {
10 | "./url": "./index.ts"
11 | },
12 | "keywords": [],
13 | "author": "",
14 | "license": "ISC"
15 | }
16 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/eslint-config/README.md:
--------------------------------------------------------------------------------
1 | # `@turbo/eslint-config`
2 |
3 | Collection of internal eslint configurations.
4 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/eslint-config/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/eslint-config",
3 | "version": "0.0.0",
4 | "private": true,
5 | "files": [
6 | "library.js",
7 | "next.js",
8 | "react-internal.js"
9 | ],
10 | "devDependencies": {
11 | "@vercel/style-guide": "^5.2.0",
12 | "eslint-config-turbo": "^1.12.4",
13 | "eslint-config-prettier": "^9.1.0",
14 | "eslint-plugin-only-warn": "^1.1.0",
15 | "@typescript-eslint/parser": "^7.1.0",
16 | "@typescript-eslint/eslint-plugin": "^7.1.0",
17 | "typescript": "^5.3.3"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/typescript-config/base.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "display": "Default",
4 | "compilerOptions": {
5 | "declaration": true,
6 | "declarationMap": true,
7 | "esModuleInterop": true,
8 | "incremental": false,
9 | "isolatedModules": true,
10 | "lib": ["es2022", "DOM", "DOM.Iterable"],
11 | "module": "NodeNext",
12 | "moduleDetection": "force",
13 | "moduleResolution": "NodeNext",
14 | "noUncheckedIndexedAccess": true,
15 | "resolveJsonModule": true,
16 | "skipLibCheck": true,
17 | "strict": true,
18 | "target": "ES2022"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/typescript-config/nextjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "display": "Next.js",
4 | "extends": "./base.json",
5 | "compilerOptions": {
6 | "plugins": [{ "name": "next" }],
7 | "module": "ESNext",
8 | "moduleResolution": "Bundler",
9 | "allowJs": true,
10 | "jsx": "preserve",
11 | "noEmit": true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/typescript-config/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@repo/typescript-config",
3 | "version": "0.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "publishConfig": {
7 | "access": "public"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/typescript-config/react-library.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "display": "React Library",
4 | "extends": "./base.json",
5 | "compilerOptions": {
6 | "jsx": "react-jsx"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/.eslintrc.js:
--------------------------------------------------------------------------------
1 | /** @type {import("eslint").Linter.Config} */
2 | module.exports = {
3 | root: true,
4 | extends: ["@repo/eslint-config/react-internal.js"],
5 | parser: "@typescript-eslint/parser",
6 | parserOptions: {
7 | project: "./tsconfig.lint.json",
8 | tsconfigRootDir: __dirname,
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/src/Inputbox.tsx:
--------------------------------------------------------------------------------
1 |
2 | const Inputbox = () => {
3 | return (
4 |
5 |
6 |
7 |
8 |
9 | )
10 | }
11 |
12 | export default Inputbox
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/src/button.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import { ReactNode } from "react";
4 |
5 | interface ButtonProps {
6 | children: ReactNode;
7 | className?: string;
8 | appName: string;
9 | }
10 |
11 | export const Button = ({ children, className, appName }: ButtonProps) => {
12 | return (
13 |
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/src/card.tsx:
--------------------------------------------------------------------------------
1 | export function Card({
2 | className,
3 | title,
4 | children,
5 | href,
6 | }: {
7 | className?: string;
8 | title: string;
9 | children: React.ReactNode;
10 | href: string;
11 | }): JSX.Element {
12 | return (
13 |
19 |
20 | {title} ->
21 |
22 | {children}
23 |
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/src/code.tsx:
--------------------------------------------------------------------------------
1 | export function Code({
2 | children,
3 | className,
4 | }: {
5 | children: React.ReactNode;
6 | className?: string;
7 | }): JSX.Element {
8 | return {children}
;
9 | }
10 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/react-library.json",
3 | "compilerOptions": {
4 | "outDir": "dist"
5 | },
6 | "include": ["src"],
7 | "exclude": ["node_modules", "dist"]
8 | }
9 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/tsconfig.lint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/react-library.json",
3 | "compilerOptions": {
4 | "outDir": "dist"
5 | },
6 | "include": ["src", "turbo"],
7 | "exclude": ["node_modules", "dist"]
8 | }
9 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/packages/ui/turbo/generators/templates/component.hbs:
--------------------------------------------------------------------------------
1 | export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => {
2 | return (
3 |
4 |
{{ pascalCase name }} Component
5 | {children}
6 |
7 | );
8 | };
9 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@repo/typescript-config/base.json"
3 | }
4 |
--------------------------------------------------------------------------------
/WEEK16/turborepo/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "globalDependencies": ["**/.env.*local"],
4 | "pipeline": {
5 | "build": {
6 | "dependsOn": ["^build"],
7 | "outputs": [".next/**", "!.next/cache/**"]
8 | },
9 | "lint": {
10 | "dependsOn": ["^lint"]
11 | },
12 | "dev": {
13 | "cache": false,
14 | "persistent": true
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WEEK18/README.md:
--------------------------------------------------------------------------------
1 | ## WEEK18
2 |
3 | ### Live Classes
4 | 18.1 ->
5 |
6 |
7 | ### Recorded Classes
8 |
9 |
10 |
11 | ### Notion Notes
12 | Link - https://quickest-juniper-f9c.notion.site/Cohort-2-0-FullStack-Open-Source-6b6c2a9f1282499aba4782b88bf7e204
13 |
14 |
15 | ### Assignments
16 |
17 |
18 |
19 | ### Extra Links
20 | After 18.1 ->
21 | Link to the Steps
22 | 1.
23 |
24 |
25 | ### Extras
26 |
27 |
--------------------------------------------------------------------------------
/WEEK19/express-server-redis/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "express-server-redis",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": "",
12 | "dependencies": {
13 | "@types/express": "^5.0.0",
14 | "express": "^4.21.1",
15 | "redis": "^4.7.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WEEK19/express-server-redis/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./src/index.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["next/core-web-vitals", "next/typescript"]
3 | }
4 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/.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.*
7 | .yarn/*
8 | !.yarn/patches
9 | !.yarn/plugins
10 | !.yarn/releases
11 | !.yarn/versions
12 |
13 | # testing
14 | /coverage
15 |
16 | # next.js
17 | /.next/
18 | /out/
19 |
20 | # production
21 | /build
22 |
23 | # misc
24 | .DS_Store
25 | *.pem
26 |
27 | # debug
28 | npm-debug.log*
29 | yarn-debug.log*
30 | yarn-error.log*
31 |
32 | # env files (can opt-in for committing if needed)
33 | .env*
34 |
35 | # vercel
36 | .vercel
37 |
38 | # typescript
39 | *.tsbuildinfo
40 | next-env.d.ts
41 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/app/api/route.ts:
--------------------------------------------------------------------------------
1 | // app/api/hello/route.js
2 |
3 | import { NextResponse } from 'next/server';
4 |
5 | export async function GET() {
6 | return NextResponse.json({ message: 'Hello, world!' });
7 | }
8 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK19/middlewares-in-next/app/favicon.ico
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/app/fonts/GeistMonoVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK19/middlewares-in-next/app/fonts/GeistMonoVF.woff
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/app/fonts/GeistVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK19/middlewares-in-next/app/fonts/GeistVF.woff
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --background: #ffffff;
7 | --foreground: #171717;
8 | }
9 |
10 | @media (prefers-color-scheme: dark) {
11 | :root {
12 | --background: #0a0a0a;
13 | --foreground: #ededed;
14 | }
15 | }
16 |
17 | body {
18 | color: var(--foreground);
19 | background: var(--background);
20 | font-family: Arial, Helvetica, sans-serif;
21 | }
22 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/middleware.ts:
--------------------------------------------------------------------------------
1 | import { NextResponse } from 'next/server'
2 | import type { NextRequest } from 'next/server'
3 |
4 | let requestCount = 0;
5 | export function middleware(request: NextRequest) {
6 | requestCount++;
7 | console.log("number of requests is " + requestCount);
8 | return NextResponse.next()
9 | }
10 |
11 | export const config = {
12 | matcher: '/api/:path*',
13 | }
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/next.config.ts:
--------------------------------------------------------------------------------
1 | import type { NextConfig } from "next";
2 |
3 | const nextConfig: NextConfig = {
4 | /* config options here */
5 | };
6 |
7 | export default nextConfig;
8 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('postcss-load-config').Config} */
2 | const config = {
3 | plugins: {
4 | tailwindcss: {},
5 | },
6 | };
7 |
8 | export default config;
9 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/public/file.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/public/window.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK19/middlewares-in-next/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "tailwindcss";
2 |
3 | export default {
4 | content: [
5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}",
6 | "./components/**/*.{js,ts,jsx,tsx,mdx}",
7 | "./app/**/*.{js,ts,jsx,tsx,mdx}",
8 | ],
9 | theme: {
10 | extend: {
11 | colors: {
12 | background: "var(--background)",
13 | foreground: "var(--foreground)",
14 | },
15 | },
16 | },
17 | plugins: [],
18 | } satisfies Config;
19 |
--------------------------------------------------------------------------------
/WEEK19/worker-redis/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "worker-redis",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": "",
12 | "dependencies": {
13 | "redis": "^4.7.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WEEK19/worker-redis/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./src/index.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["next/core-web-vitals", "next/typescript"]
3 | }
4 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/.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.*
7 | .yarn/*
8 | !.yarn/patches
9 | !.yarn/plugins
10 | !.yarn/releases
11 | !.yarn/versions
12 |
13 | # testing
14 | /coverage
15 |
16 | # next.js
17 | /.next/
18 | /out/
19 |
20 | # production
21 | /build
22 |
23 | # misc
24 | .DS_Store
25 | *.pem
26 |
27 | # debug
28 | npm-debug.log*
29 | yarn-debug.log*
30 | yarn-error.log*
31 |
32 | # env files (can opt-in for committing if needed)
33 | .env*
34 |
35 | # vercel
36 | .vercel
37 |
38 | # typescript
39 | *.tsbuildinfo
40 | next-env.d.ts
41 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK19/ws-nextjs/app/favicon.ico
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/app/fonts/GeistMonoVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK19/ws-nextjs/app/fonts/GeistMonoVF.woff
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/app/fonts/GeistVF.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/debsouryadatta/100xdevs-cohort-2.0-harkiratSingh/3f9b71e981ab31934fb5a428719133a9419d3585/WEEK19/ws-nextjs/app/fonts/GeistVF.woff
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --background: #ffffff;
7 | --foreground: #171717;
8 | }
9 |
10 | @media (prefers-color-scheme: dark) {
11 | :root {
12 | --background: #0a0a0a;
13 | --foreground: #ededed;
14 | }
15 | }
16 |
17 | body {
18 | color: var(--foreground);
19 | background: var(--background);
20 | font-family: Arial, Helvetica, sans-serif;
21 | }
22 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/next.config.ts:
--------------------------------------------------------------------------------
1 | import type { NextConfig } from "next";
2 |
3 | const nextConfig: NextConfig = {
4 | /* config options here */
5 | };
6 |
7 | export default nextConfig;
8 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ws-nextjs",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "react": "19.0.0-rc-66855b96-20241106",
13 | "react-dom": "19.0.0-rc-66855b96-20241106",
14 | "next": "15.0.3"
15 | },
16 | "devDependencies": {
17 | "typescript": "^5",
18 | "@types/node": "^20",
19 | "@types/react": "^18",
20 | "@types/react-dom": "^18",
21 | "postcss": "^8",
22 | "tailwindcss": "^3.4.1",
23 | "eslint": "^8",
24 | "eslint-config-next": "15.0.3"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('postcss-load-config').Config} */
2 | const config = {
3 | plugins: {
4 | tailwindcss: {},
5 | },
6 | };
7 |
8 | export default config;
9 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/public/file.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/public/window.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WEEK19/ws-nextjs/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "tailwindcss";
2 |
3 | export default {
4 | content: [
5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}",
6 | "./components/**/*.{js,ts,jsx,tsx,mdx}",
7 | "./app/**/*.{js,ts,jsx,tsx,mdx}",
8 | ],
9 | theme: {
10 | extend: {
11 | colors: {
12 | background: "var(--background)",
13 | foreground: "var(--foreground)",
14 | },
15 | },
16 | },
17 | plugins: [],
18 | } satisfies Config;
19 |
--------------------------------------------------------------------------------
/WEEK19/ws-nodejs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ws-nodejs",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": "",
12 | "dependencies": {
13 | "@types/cors": "^2.8.17",
14 | "@types/express": "^5.0.0",
15 | "@types/ws": "^8.5.13",
16 | "cors": "^2.8.5",
17 | "express": "^4.21.1",
18 | "typescript": "^5.6.3",
19 | "ws": "^8.18.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WEEK19/ws-nodejs/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./src/index.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------
/WEEK21/attacker/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "attacker",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": "",
12 | "dependencies": {
13 | "axios": "^1.7.7"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WEEK21/attacker/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./src/index.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------
/WEEK21/pubsub/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pubsub",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": "",
12 | "dependencies": {
13 | "redis": "^4.7.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WEEK21/pubsub/src/index.ts:
--------------------------------------------------------------------------------
1 | import { PubSubManager } from "./PubSubManager";
2 |
3 | setInterval(() => {
4 | PubSubManager.getInstance().userSubscribe(Math.random().toString(), "APPL");
5 | }, 5000)
6 |
--------------------------------------------------------------------------------
/WEEK21/pubsub/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./src/pubsubmanager.ts","./src/index.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------
/WEEK21/react-captcha/.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 |
--------------------------------------------------------------------------------
/WEEK21/react-captcha/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React + TS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WEEK21/react-captcha/src/main.tsx:
--------------------------------------------------------------------------------
1 | import { StrictMode } from 'react'
2 | import { createRoot } from 'react-dom/client'
3 | import './index.css'
4 | import App from './App.tsx'
5 |
6 | createRoot(document.getElementById('root')!).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/WEEK21/react-captcha/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/WEEK21/react-captcha/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [],
3 | "references": [
4 | { "path": "./tsconfig.app.json" },
5 | { "path": "./tsconfig.node.json" }
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/WEEK21/react-captcha/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vite.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | })
8 |
--------------------------------------------------------------------------------
/WEEK21/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "server",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": "",
12 | "dependencies": {
13 | "@types/express": "^5.0.0",
14 | "cors": "^2.8.5",
15 | "dotenv": "^16.4.5",
16 | "express": "^4.21.1",
17 | "express-rate-limit": "^7.4.1"
18 | },
19 | "devDependencies": {
20 | "@types/cors": "^2.8.17"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WEEK21/server/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./src/index.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------
/WEEK21/singleton-state/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "singleton-state",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": ""
12 | }
13 |
--------------------------------------------------------------------------------
/WEEK21/singleton-state/src/index.ts:
--------------------------------------------------------------------------------
1 | import { gameInstance } from "./GameManager";
2 | import { startLogger } from "./logger";
3 |
4 | startLogger();
5 |
6 | setInterval(() => {
7 | gameInstance.addGame({
8 | id: Math.random().toString(),
9 | "whitePlayer": "harkirat",
10 | "blackPlayer": "jaskirat",
11 | moves: []
12 | })
13 | }, 5000)
--------------------------------------------------------------------------------
/WEEK21/singleton-state/src/logger.ts:
--------------------------------------------------------------------------------
1 | import { gameInstance } from "./GameManager";
2 |
3 | export const startLogger = () => {
4 | setInterval(() => {
5 | gameInstance.logState();
6 | }, 5000);
7 | }
8 |
--------------------------------------------------------------------------------
/WEEK21/singleton-state/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./src/gamemanager.ts","./src/index.ts","./src/logger.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------
/WEEK22/cluster-nodejs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cluster-nodejs",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "keywords": [],
9 | "author": "",
10 | "license": "ISC",
11 | "description": "",
12 | "dependencies": {
13 | "@types/express": "^5.0.0",
14 | "express": "^4.21.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WEEK22/cluster-nodejs/tsconfig.tsbuildinfo:
--------------------------------------------------------------------------------
1 | {"root":["./index.ts"],"version":"5.6.3"}
--------------------------------------------------------------------------------