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.
The Winternship 2025 program provides structured case studies across:
Each case study bridges theory and practice with real-world coding exercises.
my-react-app)
my-task-app)
solution.js)
$match, $group, $project, $sort, $limitmongosh or Node.js drivermenu-crud.js)
insertOne, find, updateOne, deleteOneupsert and $addToSet for repeatable runsmongosh or Node.js driverrefund-transaction.js, seed-refund.js)
app.js)
npm init and npm install express/ (homepage), /events (list of activities), /contact (JSON with email + phone)res.send() vs res.json() responsesnode app.jsapp.js, routes/)
routes/events.js, routes/classes.js, routes/contact.jsapp.js with app.use('/path', router)node app.jsapp.js, routes/products.js)
PATCH /products/:id/inStock to update only the inStock field400 Bad Request if inStock is missing or not a boolean404 Not Found if product ID does not existnode app.jsapp.js, routes/transfer.js)
POST /transfer to move points between accounts404 Not Found if sender/receiver not found, 400 Bad Request if invalid UUIDs or insufficient points200 OK and updated balances on successnode app.jsapp.js, routes/baking.js)
POST /baking/start to begin baking an orderGET /baking/status/:id to check baking status by order ID400 Bad Request if orderId or flavor missing, 404 Not Found if order not found201 Created on start and 200 OK on status retrievalnode app.jsapp.js, routes/discharge.js)
insuranceApprovalCheck middleware to enforce req.body.insuranceApproved403 Forbidden when insurance approval is missingnode app.jsapp.js, routes/applications.js)
POST /applications endpoint to submit applicationsapplicantType is "art", portfolioLink must be a valid URL400 Bad Request with message "A valid portfolio link is required for art applicants." if missing or invalid201 Created and application payload on successnode app.jsapp.js, models/Book.js, repositories/, services/BookService.js, controllers/BookController.js)
POST /books/:id/borrow → borrow a bookPOST /books/:id/return → return a bookisBorrowed flag) when returnednode app.jsapp.js, models/Course.js, repositories/, services/CourseService.js, controllers/CourseController.js)
delete(courseId) method in repository to remove courses from storagedeleteCourse method to enforce rules (course must exist before deletion)DELETE /courses/:id endpoint for admins200 OK with success message or 404 Not Found if course does not existnode app.jsapp.js, services/, controllers/AppointmentController.js, tests/AppointmentService.test.js)
BillingService interface and StripeBillingService implementationbookAppointment charges patient and sends notification when bookingPOST /appointments/book endpointnode app.jsClone the repository and run any case study as described below.
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
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.
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.
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.
cd Internship_caseStudies/mongodb
npm install
node solution.js
cd Internship_caseStudies/mongodb
npm install
node menu-crud.js
cd Internship_caseStudies/mongodb
npm install
node seed-refund.js # seed sample users + transaction
node refund-transaction.js # run refund workflow
cd Internship_caseStudies/express/lesson1
npm install
node app.js
Then visit:
cd Internship_caseStudies/express/lesson2
npm install
node app.js
Then visit:
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"}'
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}'
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
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}'
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"}'
201 Created with application payload if valid.400 Bad Request with "A valid portfolio link is required for art applicants." if missing or invalid.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
isBorrowed: trueisBorrowed: falsecd 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
200 OK with "Course deleted successfully" if found404 Not Found with "Course not found" if missingcd 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:
{
"status": "confirmed",
"patient": "alice@example.com",
"time": "Monday 10am",
"amount": 50
}
This project is open-source under the MIT License.