Sugbo Eats is a mobile application designed to simplify the process of reserving tables at restaurants in Cebu. Built using Java and Firebase, the app allows users to browse restaurants and make reservations with ease.
- Browse Restaurants: Explore a list of participating restaurants in Cebu with detailed information.
- View Availability: Check available time slots for each restaurant to plan your visit.
- Make Reservations: Reserve tables directly through the app with just a few taps.
- Real-Time Database: Utilize Firebase Realtime Database to store and retrieve reservation data instantly.
- Java: The primary programming language for Android app development.
- Firebase Realtime Database: Manages and stores reservation data efficiently.
- Android Studio: Integrated Development Environment (IDE) used for building and testing the app.
To get a local copy up and running, follow these steps:
-
Clone the repository:
git clone https://github.com/ivanovich18/sugbo-eats-mobile.git
-
Open the project in Android Studio:
- Launch Android Studio.
- Click on Open an existing project.
- Navigate to the cloned repository and select it.
-
Set up Firebase:
- Create a new project on the Firebase Console.
- Add an Android app to your Firebase project.
- Follow the instructions to download the
google-services.jsonfile. - Place the
google-services.jsonfile in theappdirectory of your project.
-
Install dependencies:
- Verify that you have the necessary dependencies specified in the
build.gradlefile. - Sync the project with Gradle files to ensure everything is set up correctly.
- Verify that you have the necessary dependencies specified in the
To manage sensitive information like API keys and project configuration in your google-services.json file securely, follow these steps:
-
Store Sensitive Data in Environment Variables
Set your important data as environment variables on your build machine or CI/CD system. For local development, you can use a
.envfile.-
Create a
.envfile in the root directory of your project. -
Add your Firebase credentials to the
.envfile:FIREBASE_PROJECT_NUMBER=your_project_number FIREBASE_PROJECT_ID=your_project_id FIREBASE_STORAGE_BUCKET=your_storage_bucket FIREBASE_APP_ID=your_app_id FIREBASE_CLIENT_ID=your_client_id FIREBASE_API_KEY=your_api_key
-
-
Modify Gradle Build Script
Update your
app/build.gradlefile to replace placeholders in yourgoogle-services-template.jsonfile with actual environment variables:-
Rename your existing
google-services.jsontogoogle-services-template.jsonand replace sensitive values with placeholders:{ "project_info": { "project_number": "${FIREBASE_PROJECT_NUMBER}", "project_id": "${FIREBASE_PROJECT_ID}", "storage_bucket": "${FIREBASE_STORAGE_BUCKET}" }, "client": [ { "client_info": { "mobilesdk_app_id": "${FIREBASE_APP_ID}", "android_client_info": { "package_name": "com.bscpe3g.sugboeats" } }, "oauth_client": [ { "client_id": "${FIREBASE_CLIENT_ID}", "client_type": 3 } ], "api_key": [ { "current_key": "${FIREBASE_API_KEY}" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "${FIREBASE_CLIENT_ID}", "client_type": 3 } ] } } } ], "configuration_version": "1" } -
Add a custom Gradle task to replace placeholders in the
google-services-template.jsonfile with actual environment variables:import org.apache.tools.ant.filters.ReplaceTokens android { // Other configurations... // Custom task to replace tokens in google-services-template.json task replaceGoogleServicesJson { doLast { def templateFile = file('google-services-template.json') def outputFile = file('google-services.json') ant.filterset(id: 'tokens', tokens: [ 'FIREBASE_PROJECT_NUMBER': System.getenv("FIREBASE_PROJECT_NUMBER"), 'FIREBASE_PROJECT_ID': System.getenv("FIREBASE_PROJECT_ID"), 'FIREBASE_STORAGE_BUCKET': System.getenv("FIREBASE_STORAGE_BUCKET"), 'FIREBASE_APP_ID': System.getenv("FIREBASE_APP_ID"), 'FIREBASE_CLIENT_ID': System.getenv("FIREBASE_CLIENT_ID"), 'FIREBASE_API_KEY': System.getenv("FIREBASE_API_KEY") ]) ant.copy(file: templateFile, tofile: outputFile) { filterchain { filterset(refid: 'tokens') } } } } preBuild.dependsOn replaceGoogleServicesJson }
-
-
Set Environment Variables
Ensure that the environment variables are set in your development environment or CI/CD pipeline. For local development, you can set them in your terminal session or use a
.envfile with a library likedotenvto load these automatically.Example of setting environment variables in your terminal:
export FIREBASE_PROJECT_NUMBER=your_project_number export FIREBASE_PROJECT_ID=your_project_id export FIREBASE_STORAGE_BUCKET=your_storage_bucket export FIREBASE_APP_ID=your_app_id export FIREBASE_CLIENT_ID=your_client_id export FIREBASE_API_KEY=your_api_key
-
Run the Build Process
When you build your project, the replaceGoogleServicesJson task will generate a google-services.json file with the correct values, keeping sensitive information out of your source control.
-
Browse Restaurants:
- Open the app and browse through the list of available restaurants in Cebu.
-
Make Reservations:
- Select a restaurant, choose a suitable time slot, and make your reservation.
- Ronilo Jose Cabag
- Miles Dagle
- Aldrin Felices
- John Kevin Genon
- Ivan Suralta
- Rovic Tecson
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
