Feat/mern mvp vivek#65
Open
viv756 wants to merge 28 commits into
Open
Conversation
- Add Vite + React + TS client with Tailwind v4 and shadcn path aliases - Add Express + TypeScript server with MongoDB, nodemon, ts-node - Configure tsconfig for CommonJS output and add .gitignore
Introduce a typed error-handling layer for the Express API: - AppError base class with HTTP status and app-level error codes, plus NotFound/BadRequest/Unauthorized/Forbidden/InternalServer and HttpException subclasses - HTTP_STATUS config and ErrorCodeEnum for consistent status/error codes - errorHandler middleware to format error responses - asyncHandler middleware to forward async route errors - wire errorHandler into the app in index.ts - set exactOptionalPropertyTypes to false in tsconfig
- getEnv util to read env vars with defaults and throw on missing required values - Env config object centralizing PORT, NODE_ENV, MONGO_URI, BASE_PATH, FRONTEND_ORIGIN, and JWT settings - use Env.PORT/NODE_ENV in startup log
- add cookie-parser, cors, dotenv (and @types) dependencies - load env via dotenv/config - wire json, urlencoded, cookieParser, and cors (FRONTEND_ORIGIN, credentials) - add GET / health route using asyncHandler - bind server to Env.PORT
- User model with bcrypt password hashing hook, comparePassword/omitPassword, and role enum (OWNER/ADMIN/CUSTOMER) - Venue model with hourly pricing and operating hours (minutes from midnight) - Reservation and Booking models with startTime/endTime slots for time-based booking and overlap checks - Payment model with provider/status enums; required amount, booking, customer - Review model with 1-5 rating - domain enums for booking, reservation, payment statuses - bcrypt util for hashing and comparison
- register and login controllers/services with bcrypt and JWT - signin sets an httpOnly accessToken cookie - role-aware signup (CUSTOMER/OWNER whitelist, ADMIN blocked) - jwt util to sign and verify access tokens - connectDatabase to connect Mongoose via MONGO_URI - call connectDatabase on server startup
- add VenueTypeEnum (banquet hall, conference room, wedding lawn, auditorium, rooftop, party hall) - type venueType as VenueTypeEnumType in the model and schema enum - type CreateVenueParams.venueType against the enum in venue service
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
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.
Description
Phase Category
Tech Stack (For Phase 1 MVP Submissions)
(Example: Frontend: React, Backend: Node.js, Database: MongoDB)
Type of Change
Checklist:
AI Disclosure
Screenshots / Screen Recording (if applicable)