Internship case studies

Winternship 2025 Case Studies – Solutions

Welcome to my repository of solved lessons from the Winternship 2025 Case Studies.
This repo showcases my progress in mastering modern web development concepts through practical, hands-on challenges across TypeScript, React (Vite), MongoDB, and now Express.


📘 Overview

The Winternship 2025 program provides structured case studies across:

Each case study bridges theory and practice with real-world coding exercises.


🚀 What’s Inside


🛠️ How to Run

Clone the repository and run any case study as described below.

TypeScript (General Case Studies)

Most lessons can be run directly by compiling the TypeScript file and executing the generated JavaScript:

cd Internship_caseStudies/CaseStudy1
tsc lesson-name.ts
node lesson-name.js

TypeScript (Lesson 19)

Lesson 19 is a standalone TypeScript project and uses external dependencies.

cd Internship_caseStudies/CaseStudy1/nineteen
npm install
tsc
node dist/index.js

This will install required dependencies (typedi, reflect-metadata), compile the project using the local tsconfig.json, and run the output from the dist directory.

React (Vite)

cd Internship_caseStudies/react/my-react-app
npm install
npm run dev

This will start the Vite dev server and open the app in your browser.

Task Manager (Vite)

cd Internship_caseStudies/react/my-task-app
npm install
npm run dev

This will start the Vite dev server and open the app in your browser.
You can then interact with the Task Manager mini-app: add tasks, toggle completion, and delete tasks.

MongoDB

Case Study 1: MovieFlix Analytics

cd Internship_caseStudies/mongodb
npm install
node solution.js

Case Study 2: FastBite CRUD Challenge

cd Internship_caseStudies/mongodb
npm install
node menu-crud.js

Case Study 3: FinTrust Transactions & Refunds

cd Internship_caseStudies/mongodb
npm install
node seed-refund.js   # seed sample users + transaction
node refund-transaction.js   # run refund workflow

Express

Lesson 1: Getting Started

cd Internship_caseStudies/express/lesson1
npm install
node app.js

Then visit:

Lesson 2: Modular routes

cd Internship_caseStudies/express/lesson2
npm install
node app.js

Then visit:

Lesson 3: PATCH endpoint + validation

cd Internship_caseStudies/express/lesson3
npm install
node app.js

Then test:

# Valid update
curl -X PATCH http://localhost:3000/products/1/inStock \
  -H "Content-Type: application/json" \
  -d '{"inStock": false}'

# Invalid update (missing or wrong type)
curl -X PATCH http://localhost:3000/products/1/inStock \
  -H "Content-Type: application/json" \
  -d '{}'
curl -X PATCH http://localhost:3000/products/1/inStock \
  -H "Content-Type: application/json" \
  -d '{"inStock": "yes"}'

Lesson 4: POST /transfer endpoint

cd Internship_caseStudies/express/lesson4
npm install
node app.js

Then test:

# Valid transfer
curl -X POST http://localhost:3000/transfer \
  -H "Content-Type: application/json" \
  -d '{"fromCustomerId":"11111111-1111-4111-8111-111111111111","toCustomerId":"22222222-2222-4222-8222-222222222222","points":100}'

# Invalid UUIDs
curl -X POST http://localhost:3000/transfer \
  -H "Content-Type: application/json" \
  -d '{"fromCustomerId":"123","toCustomerId":"456","points":50}'

# Insufficient points
curl -X POST http://localhost:3000/transfer \
  -H "Content-Type: application/json" \
  -d '{"fromCustomerId":"22222222-2222-4222-8222-222222222222","toCustomerId":"11111111-1111-4111-8111-111111111111","points":9999}'

Lesson 5: BakingController

cd Internship_caseStudies/express/lesson5
npm install
node app.js

Then test:

# Start baking an order
curl -X POST http://localhost:3000/baking/start \
  -H "Content-Type: application/json" \
  -d '{"orderId":"101","flavor":"chocolate"}'

# Check baking status
curl -X GET http://localhost:3000/baking/status/101

Lesson 6: Discharge workflow with insurance middleware

cd Internship_caseStudies/express/lesson6
npm install
node app.js

Then test:

# Valid discharge request
curl -X POST http://localhost:3000/discharge \
  -H "Content-Type: application/json" \
  -d '{"patientName":"John Doe","doctorSigned":true,"pharmacyChecked":true,"followupScheduled":true,"insuranceApproved":true}'

# Missing insurance approval (should return 403)
curl -X POST http://localhost:3000/discharge \
  -H "Content-Type: application/json" \
  -d '{"patientName":"Jane Doe","doctorSigned":true,"pharmacyChecked":true,"followupScheduled":true}'

Lesson 7: Admissions validation for art applicants

cd Internship_caseStudies/express/lesson7
npm install
node app.js

Then test:

# Valid art applicant with portfolio link
curl -X POST http://localhost:3000/applications \
  -H "Content-Type: application/json" \
  -d '{"name":"Asha","email":"asha@example.com","applicantType":"art","portfolioLink":"https://asha-artfolio.com"}'

# Invalid: art applicant missing portfolioLink
curl -X POST http://localhost:3000/applications \
  -H "Content-Type: application/json" \
  -d '{"name":"Ravi","email":"ravi@example.com","applicantType":"art"}'

# Invalid: art applicant with malformed portfolioLink
curl -X POST http://localhost:3000/applications \
  -H "Content-Type: application/json" \
  -d '{"name":"Mira","email":"mira@example.com","applicantType":"art","portfolioLink":"not-a-url"}'

# Valid: non-art applicant (portfolio not required)
curl -X POST http://localhost:3000/applications \
  -H "Content-Type: application/json" \
  -d '{"name":"Karan","email":"karan@example.com","applicantType":"science"}'

Lesson 8: ReturnBook workflow with MVC

cd Internship_caseStudies/express/lesson8
npm install
node app.js

Then test:

# Borrow a book
curl -X POST http://localhost:3000/books/1/borrow

# Return a book
curl -X POST http://localhost:3000/books/1/return

# Error: return a book that isn’t borrowed
curl -X POST http://localhost:3000/books/2/return

Lesson 9: Course deletion workflow

cd Internship_caseStudies/express/lesson9
npm install
node app.js

Then test:

# Delete an existing course
curl -X DELETE http://localhost:3000/courses/101

# Try deleting a non-existent course
curl -X DELETE http://localhost:3000/courses/999

Lesson 10: BillingService integration

cd Internship_caseStudies/express/lesson10
npm install
node app.js

Then test:

# Book appointment with billing + notification
curl -X POST http://localhost:3000/appointments/book \
  -H "Content-Type: application/json" \
  -d '{"patient":"alice@example.com","time":"Monday 10am","amount":50}'

Expected:


📈 Progress Tracker


✨ Highlights


📜 License

This project is open-source under the MIT License.