Skip to content

Conversation

@Paulherveph
Copy link
Collaborator

@Paulherveph Paulherveph commented Jun 23, 2025

TripBook Room Database: Feature Summary


Purpose: A robust local persistence layer for the TripBook app, designed to work seamlessly alongside the existing mock data infrastructure.


Key Features & Implementation:

  • Offline First: All user-created trips are saved locally, ensuring data persists between app sessions and is available offline.
  • Complete Data Model: Includes 5 entity tables (TripEntity, ReviewEntity, CommentEntity, TriphomeEntity, PlaceEntity) to model the app's core data.
  • Automatic Primary Keys: New database entries (TripEntity) automatically receive a unique, auto-generated ID.
  • Permanent Image Storage: cCopying selected photos to the app's private internal storage, ensuring they always load.
  • Advanced Data Handling: Uses Room TypeConverters with Gson to safely store complex data types like List<String> for image URLs.
  • Optimized for Performance: Leverages @Index annotations on entities for fast, efficient searching and querying of trips.
  • Safe Migrations: Implements .fallbackToDestructiveMigration() to prevent crashes during development when the database schema changes.

Current Status: FULLY FUNCTIONAL

  • Users can successfully add new trips with images, and the data is saved directly to the database.
  • The Trip Catalog correctly displays a unified list of both the original mock trips and all new, user-created trips.
  • All data, including images, persists reliably after the app is closed and restarted.
  • The system is stable and integrated without disrupting existing team workflows.

image

sas-bergson and others added 30 commits May 9, 2025 23:51
Pulling the changes from the main branch
…d UI also members are to add code and UI and to modify the existing code which the skeleton will be provided but the splash page and dashbaord are my work
…ase for the view of the different trips"

This reverts commit 91b30110ecad354fc40a109b9ebd93a7be4e416f.
…base for the view of the different trips"

This reverts commit 4c28a860341002dd39d891d66f63d1ec8284dd2a.
…hony

Merge pull request #6 from sas-bergson/main
Nagana noa junior/features/reservations/dashboard
…eatures/reservations/dashboard

Revert 31 nagana noa junior/features/reservations/dashboard
… tripcatalog-paulherve

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/com/android/tripbook/TripCatalogActivity.kt
#	gradle/libs.versions.toml
- Changed `minSdk` version from 31 to 28 in `build.gradle.kts`.
- Added `votes` property to `Review` data structure in `SampleReviews.kt` for upvote/downvote functionality.
- Enhanced `ReviewCard` to display voting buttons and current vote count.
- Refactored `TripCard` to accept `miniProfileContent` for user profiles.
- Updated `TripCatalogScreen` to show user avatars in trip cards.
- Modified `MockReviewViewModel` to support voting logic, pagination, and sorting.
- Created new `User` data class in `User.kt` for user information.
- Added new composables in `MiniProfile.kt` for user profile display.
- Documented changes in a new README file.
- Added `DocumentLayout.json` for managing development layout.
levelingdev and others added 17 commits June 5, 2025 14:33
Added complete Room database infrastructure while maintaining Mock data compatibility for easy migration.
Database Implementation:
- Room database fully operational with TripEntity and ReviewEntity
- Complete CRUD operations with TripDao and ReviewDao
- Foreign key relationships working correctly
- Database migrations and version control implemented

Test Data Integration:
- Added authentic Cameroon destinations (Limbe Coastal Paradise)
- Real Cameroon images from Getty Images (Kribi, Bamenda locations)
- Comprehensive test reviews with local cultural content
- Database test framework with SimpleDatabaseTest

Catalog Integration:
- Combined Room database trips with sample trips in catalog
- Search functionality works across all trip types
- Proper data persistence and retrieval
- Clean database state with problematic entries removed

Technical Achievements:
- Resolved Compose dependency conflicts (BOM 2023.08.00)
- Fixed KSP and Google Services plugin integration
- Stable build configuration for team collaboration
- No breaking changes to existing functionality

Database is production-ready and fully tested with authentic Cameroon content.
� Team Collaboration Features:
- Database test code commented out and inactive by default
- Team members can use mock data without database interference
- Clean app startup with no database operations running
- Original sample trips functionality preserved

� Database Testing Ready:
- All Room database code preserved and functional
- Easy reactivation with simple comment removal
- Cameroon test data and authentic images maintained
- Instant demonstration capability available

� Toggle Instructions:
- TO ACTIVATE: Remove /* and */ around database code blocks
- TO DEACTIVATE: Add /* and */ around database code blocks
- Clear documentation in code comments
- No breaking changes to existing functionality
 Benefits:
- Zero conflicts with team members' work
- Professional collaboration approach
- Database achievements preserved and demonstrable
- Seamless switching between mock and database modes

Perfect solution for team development while maintaining database functionality.
…-ICTU20241940-AddNewPlace' into tripcatalog-paulherve-ICTU20223134-RoomDatabase

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/com/android/tripbook/Adapter/TripsAdapter.kt
#	app/src/main/java/com/android/tripbook/BookingActivity.kt
#	app/src/main/java/com/android/tripbook/MainActivity.kt
#	app/src/main/java/com/android/tripbook/Repository/TripsRepository.kt
#	app/src/main/java/com/android/tripbook/TripCatalogActivity.kt
#	app/src/main/java/com/android/tripbook/ViewModel/MainviewModel.kt
#	app/src/main/java/com/android/tripbook/ui/navigation/MainNavGraph.kt
#	app/src/main/java/com/android/tripbook/ui/navigation/NavigationUtils.kt
#	app/src/main/java/com/android/tripbook/ui/screens/TripCatalogScreen.kt
#	app/src/main/java/com/android/tripbook/ui/screens/booking/BookingScreen.kt
#	gradle/libs.versions.toml
#	gradle/wrapper/gradle-wrapper.properties
Copy link
Collaborator

@nganeemmanuelict nganeemmanuelict left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok for now

Copy link
Collaborator

@Fokoua-Will-Brayan Fokoua-Will-Brayan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great for now but could do better

Copy link
Collaborator

@NissoStudios NissoStudios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and functional even though I know you can do better as a " Dev Master " 💪🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.