Expand the Data Model
Transform the original database structure into a more robust architecture containing related Trip, Category, and Review collections.
Software Developer • Enterprise Applications • AI Solutions
CS 499 Capstone Enhancement
This enhancement revisits the Travlr Getaways full-stack travel management application originally developed in CS 465: Full Stack Development I. The application includes a customer-facing Express and Handlebars website, an Angular administrative single-page application, a RESTful Express API, and a MongoDB database managed through Mongoose.
The original application used a comparatively simple database structure centered primarily on trip records. Although the design supported the original course requirements, it offered limited support for relationships, customer-generated content, reporting, and more advanced data analysis.
This enhancement redesigned the MongoDB and Mongoose data model by introducing related Category and Review collections, stronger validation, database indexes, calculated review metrics, and MongoDB aggregation pipelines. These improvements support new customer review functionality, improved trip organization, and an administrative statistics dashboard.
Transform the original database structure into a more robust architecture containing related Trip, Category, and Review collections.
Strengthen Mongoose schemas and request validation to ensure that properly formatted and complete information is stored in the database.
Add customer ratings and reviews while maintaining accurate average-rating and review-count values for each trip.
Use MongoDB aggregation pipelines to calculate meaningful pricing, duration, rating, review, and category statistics.
Category documents store reusable information that classifies travel packages. Each trip references a category through a MongoDB ObjectId, allowing multiple trips to share the same category without duplicating category data.
Trip documents remain the central records in the application. The enhanced schema includes category references, normalized duration values, average ratings, review counts, and indexes supporting common queries.
Review documents contain customer feedback, numeric ratings, customer names, timestamps, and a reference to the associated trip. This allows each trip to support multiple independent review records.
Average rating and review count values are stored directly on trip documents. These calculated values improve common read operations while remaining synchronized whenever a new review is submitted.
The dashboard displays the number of trips, average price, lowest and highest prices, average duration, shortest and longest durations, total reviews, reviewed trip count, and overall average rating.
A MongoDB aggregation pipeline identifies and ranks the destinations with the highest customer ratings, allowing administrators to recognize strongly performing travel packages.
The dashboard identifies trips receiving the largest number of customer reviews, providing insight into customer engagement and destination popularity.
Category-based aggregation reports summarize the number of trips, average pricing, average duration, total reviews, and average ratings for each travel category.
Redesigned the application's database architecture to support related collections, efficient queries, stronger validation, improved scalability, and new customer and administrative functionality.
Applied MongoDB ObjectId relationships, Mongoose schema modeling, database indexes, calculated metrics, and aggregation pipelines to deliver meaningful application features and reporting.
Coordinated database changes across the REST API, Angular administrative interface, customer-facing Express website, validation middleware, and application documentation.
Documented the database architecture, design decisions, technical trade-offs, implementation results, and user benefits through the repository README, capstone narrative, and ePortfolio.
Preserved authenticated administrative operations, validated incoming data before database modifications, and strengthened database integrity by rejecting incomplete or improperly formatted requests.
A central design decision involved balancing normalization with application performance. Creating separate Category and Review collections improved organization, reduced unnecessary duplication, and allowed related information to be managed independently.
However, repeatedly recalculating average ratings and review counts during common trip queries would have introduced unnecessary processing. To address this concern, the enhancement uses selective denormalization by storing these calculated metrics directly on each trip document.
The original enhancement plan also included a customer favorites feature. During development, I determined that related collections, aggregation pipelines, customer reviews, reporting, validation, and indexing provided a stronger demonstration of advanced database concepts. Favorites were therefore retained as a possible future enhancement rather than expanding the current milestone's scope.
This enhancement reinforced that effective database design extends beyond storing and retrieving information. Data modeling decisions directly influence application architecture, query performance, maintainability, scalability, and the user experience.
Introducing related collections strengthened my understanding of normalization, while storing calculated review statistics on trip documents demonstrated when selective denormalization can improve performance. This required balancing data organization against the efficiency of frequently performed read operations.
Implementing the customer review system also demonstrated how thoughtful database enhancements can produce visible value for users. Customers can now provide ratings and feedback, while administrators can use aggregated review metrics to better understand engagement and trip performance.
The greatest challenge involved maintaining consistency across every application layer. Database schema changes required corresponding updates to the REST API, Angular administrative application, customer-facing website, validation middleware, and reporting logic.
Overall, this work strengthened my ability to design database-driven applications, evaluate architectural trade-offs, implement advanced MongoDB features, and integrate related data across a complete full-stack application.
The original repository contains the Travlr Getaways application as developed during CS 465. The Database Enhancement branch contains the completed data-modeling, validation, indexing, review, aggregation, dashboard, API, and interface enhancements.