-
Notifications
You must be signed in to change notification settings - Fork 2
George Taschina - Technical Challenge #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
george-taschina
wants to merge
17
commits into
tryhackme:main
Choose a base branch
from
george-taschina:feature/george-taschina-challenge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
George Taschina - Technical Challenge #2
george-taschina
wants to merge
17
commits into
tryhackme:main
from
george-taschina:feature/george-taschina-challenge
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ocker-compose for development environments. Added CLAUDE.md file. Updated API's index.ts for migration
- Add Dockerfile.dev for API and client packages - Update docker-compose.yml with api/client services - Enable vite host binding for container access Co-Authored-By: Claude <noreply@anthropic.com>
- Add config layer with Zod env validation + MongoDB singleton
- Add common utils: ApiError, ApiResponse, Winston logger
- Add middleware: requestId, requestLogger, errorHandler, notFound
- Create modules/room with routes/handlers/service/repository pattern
- Add /health endpoint for monitoring
- Wrap all responses in {success, data} or {success, error} envelope
- Move routes to /api/v1 prefix
- Add Jest + mongodb-memory-server tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When pnpm installs winston, it puts the actual files in /workspace/node_modules/.pnpm/... and creates a symlink at /workspace/packages/api/node_modules/winston. When you mount your host folder: The real files in .pnpm/ are replaced by your host's (empty) .pnpm/ folder. The symlink now points to a file that doesn't exist. Node.js throws the Cannot find package 'winston' error because the link is "dead."
- Fix integration test to insert into separate collections (rooms, tasks, questions) - Add --forceExit to Jest for proper test exit - Change vitest to run mode instead of watch - Exclude dist folders from biome check Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- POST /rooms/:roomCode/questions/:questionOrder endpoint - Case-insensitive answer comparison, hint on wrong answer - Repository: findQuestion, updateQuestionProgress methods - Exclude answer field from room GET response - Frontend: useSubmitAnswer hook, loading/error states - Seed data updated with answers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add requiresAnswer field to Question type. Backend sets based on null answer and auto-marks correct. Frontend shows disabled input with "No answer needed" placeholder and "Continue" button. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add helmet for security headers - Configure CORS origin whitelist via ALLOWED_ORIGINS env - Add rate limiting (100 req/15min) on answer submission - Add roomCode regex validation, answer max length - Sanitize room title/describe with SafeHTML Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix integration test missing requiresAnswer field - Add tests for submitAnswer in RoomService - Add tests for ApiError, ApiResponse, errorHandler - Add tests for room handlers and validators - Exclude coverage folder from biome Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…sion hook Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Technical Challenge - Changes Documentation
Original State (origin/main)
The original codebase was a minimal starter with:
API (
packages/api):index.tsfile with inline Express setupClient (
packages/client):src/components/andsrc/pages/foldersInfrastructure:
Changes Made (14 commits)
1. Express v4 → v5 Migration + Docker Environment
Commit:
886bea9,8bbd298Dockerfile.devfor API and clientdocker-compose.ymlwith hot reloadCLAUDE.mdwith project documentationFull Docker dev environment:
No Node.js installation required - hot reload via volume mounts.
2. Backend & Frontend Architecture Refactor
Commit:
b198e1bTransformed single-file API into layered architecture:
{success, data}or{success, error}/api/v13. Shared Types Package
Commit:
6c4a534Created
packages/sharedwith TypeScript types:Room,Task,Question,QuestionProgressApiSuccessResponse,ApiErrorResponse4. Answer Submission Feature
Commit:
a267558Backend:
POST /rooms/:roomCode/questions/:questionOrderendpointfindQuestion()andupdateQuestionProgress()repository methodsFrontend:
useSubmitAnswermutation hook5. Auto-Complete "No Answer Needed" Questions
Commit:
1213970requiresAnswerfield to Question typeanswer === null6. Progress Calculation Fix
Commit:
bc06e0dcorrectQuestions / totalQuestions * 1007. XSS Protection
Commit:
ba2efb9SafeHTMLcomponent with DOMPurify8. Security Hardening
Commit:
cf9b5f7ALLOWED_ORIGINSenv var/^[a-z0-9-]+$/, answer max 500 chars9. Test Coverage Improvement
Commit:
9f0a02dCoverage: 14% → 83%
New test files:
tests/unit/common/utils/ApiError.test.tstests/unit/common/utils/ApiResponse.test.tstests/unit/common/middleware/errorHandler.test.tstests/unit/modules/room/room.handlers.test.tstests/unit/modules/room/room.validators.test.tsFixed integration test (missing
requiresAnswerfield)10. Test Output Cleanup
Commit:
e4dcab9silent: truewhenNODE_ENV=test)11. CI/CD Pipeline
Commit:
743d8ab.github/workflows/ci.yml:New packages:
packages/sharedNew directories:
packages/api/src/config/packages/api/src/common/packages/api/src/modules/packages/api/tests/packages/client/src/features/packages/client/src/shared/.github/workflows/Verification Commands
🤖 Generated with Claude Code