-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started with Effective Office
This guide will help you set up and run the Effective Office project for local development.
- Project Overview
- Prerequisites
- Setting Up the Environment
- Running the Backend
- Running the Client Applications
- Verifying the Setup
- Troubleshooting
- Development Workflow
- Additional Resources
Effective Office is a multi-module Kotlin application aimed at automating office processes and providing statistics for employees. The project follows a client-server architecture with a Spring Boot backend, multiple client applications including an iOS tablet app, and Docker-based containerization for deployment.
Key features include:
- Meeting room booking and management
- Real-time availability displays
- Google Calendar integration
- Office space visualization
- Git
- JDK 17 or higher
- Gradle 8.0 or newer
- Docker and Docker Compose (optional, for containerized setup)
- PostgreSQL (if running without Docker)
- Android Studio Meerkat or IntelliJ IDEA 2025 or newer
- Android SDK
- Xcode 16 or newer (for iOS development)
- CocoaPods (for iOS development)
git clone https://github.com/effective-dev-opensource/Effective-Office
cd Effective-Office
./scripts/install.sh
This script installs a pre-commit hook that scans for potential secrets using Gitleaks.
cp backend/app/src/main/resources/env.example backend/app/src/main/resources/.env
Edit the .env
file with your configuration:
SPRING_DATASOURCE_URL=jdbc:postgresql://0.0.0.0:5432/effectiveoffice
SPRING_DATASOURCE_USERNAME=postgres
SPRING_DATASOURCE_PASSWORD=postgres
MIGRATIONS_ENABLE=true
APPLICATION_URL=http://localhost:8080
LOG_LEVEL=debug
CALENDAR_APPLICATION_NAME=YourApplicationName
CALENDAR_DELEGATED_USER=yourdelegateduseremail
GOOGLE_CREDENTIALS_FILE=classpath:google-credentials.json
DEFAULT_APP_EMAIL=yourdefaultappemail
FIREBASE_CREDENTIALS=classpath:firebase-credentials.json
DEFAULT_CALENDAR=yourdefaultcalendar
cp deploy/dev/.env.example deploy/dev/.env
Edit the .env
file with your configuration:
POSTGRES_DB=effectiveoffice
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/effectiveoffice
# Application Configuration
MIGRATIONS_ENABLE=true
LOG_LEVEL=DEBUG
CALENDAR_APPLICATION_NAME=EffectiveOffice
DEFAULT_CALENDAR=primary
TEST_CALENDARS=your_test_calendars
TEST_APPLICATION_URL=http://localhost:8080
LABEL=dev.effectiveoffice.local
To use Google Calendar API integration, you need to set up Google API credentials:
-
Create a project in the Google Cloud Console:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API for your project
-
Create a service account:
- Go to "IAM & Admin" > "Service Accounts"
- Click "Create Service Account"
- Enter a name and description for the service account
- Grant the service account the necessary permissions (Calendar API roles)
- Click "Create"
-
Generate a JSON key:
- Select the service account you just created
- Go to the "Keys" tab
- Click "Add Key" > "Create new key"
- Select "JSON" as the key type
- Click "Create"
- The JSON key file will be downloaded to your computer
-
Place the credentials file in the project:
- Rename the downloaded file to
google-credentials.json
- Place it in
backend/app/src/main/resources/
- Rename the downloaded file to
For Firebase Cloud Messaging (FCM) integration, you need Firebase credentials:
-
Create a Firebase project:
- Go to the Firebase Console
- Create a new project or select an existing one
-
Generate a service account key:
- Go to Project Settings > Service Accounts
- Click "Generate new private key"
- The JSON key file will be downloaded to your computer
-
Place the credentials file in the project:
- Rename the downloaded file to
firebase-credentials.json
- Place it in
backend/app/src/main/resources/
- Rename the downloaded file to
For signing Android applications, you need keystore files:
-
Debug Keystore:
- For development and testing, create a debug keystore:
mkdir -p keystore keytool -genkey -v -keystore keystore/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
- For development and testing, create a debug keystore:
-
Production Keystore:
- For production releases, create a secure keystore:
mkdir -p keystore keytool -genkey -v -keystore keystore/main.keystore -alias release -keyalg RSA -keysize 2048 -validity 10000
- Follow the prompts to enter your details and set a secure password
- For production releases, create a secure keystore:
- Navigate to the deployment directory:
cd deploy/dev
- Start the Docker containers:
docker-compose up -d
- Check if the containers are running:
docker ps
- View logs (optional):
docker logs effective-office-app-dev -f
- Start a PostgreSQL container using Docker:
docker run --name postgres-effectiveoffice -e POSTGRES_DB=effectiveoffice -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:15-alpine
- Build and run the backend application with the local profile:
./gradlew :backend:app:bootRun --args='--spring.profiles.active=local'
This command:
- Builds and runs the backend application
- Activates the
local
Spring profile - Uses the configuration from
application-local.yml
- Connects to your local PostgreSQL database
The backend will be available at http://localhost:8080
.
- Open the project in Android Studio or IntelliJ IDEA
- Sync the Gradle project to download dependencies
-
Select an Android device or emulator
-
Run the
composeApp
configuration from Android StudioOr use Gradle:
./gradlew :clients:tablet:composeApp:installDebug
-
Install CocoaPods dependencies and generate the Xcode project:
./gradlew :clients:tablet:composeApp:podInstall
-
Open the generated Xcode project:
open clients/tablet/composeApp/build/xcode-frameworks/ComposeApp.xcodeproj
-
Select an iOS device or simulator in Xcode
-
Run the project in Xcode
-
Open the Xcode project:
open iosApp/iosApp.xcodeproj
-
Select a target device or simulator
-
Build and run the application
- Open a web browser and navigate to
http://localhost:8080/api/actuator/health
- You should see a JSON response indicating the application is "UP"
- API documentation is available at
http://localhost:8080/api/swagger-ui.html
- The tablet application should connect to the backend automatically if it's running
- Check the application logs for any connection errors
-
Database Connection Issues
- Verify PostgreSQL is running:
docker ps | grep postgres
- Check database credentials in the
.env
file - Ensure the database port is not in use by another application
- Verify PostgreSQL is running:
-
Application Fails to Start
- Check the application logs:
docker logs effective-office-app-dev
- Verify all required environment variables are set
- Ensure JDK 17 or higher is installed:
java -version
- Check the application logs:
-
API Endpoints Not Accessible
- Check if the application is running:
curl http://localhost:8080/api/actuator/health
- Verify network settings and firewall configurations
- Check if the application is running:
-
Google Calendar API Issues
- Verify that your credentials file is correctly formatted and has the necessary permissions
- Ensure the Google Calendar API is enabled in your Google Cloud project
- Check that the service account has the correct permissions
-
Firebase Notification Issues
- Verify that your Firebase credentials are correct
- Ensure the Firebase project has Cloud Messaging enabled
- Check that the service account has the necessary permissions
-
Build Failures
- Sync Gradle project and update dependencies
- Check for compatibility issues between Gradle, Kotlin, and Android plugin versions
- Clear build cache:
./gradlew clean
-
iOS Build Issues
- Update CocoaPods:
pod repo update
- Reinstall pods:
./gradlew :clients:tablet:composeApp:podInstall --refresh-dependencies
- Check Xcode version compatibility
- Update CocoaPods:
-
Connection to Backend Fails
- Verify the backend is running and accessible
- Check API endpoint configuration in the client application
- Ensure network permissions are granted to the application
- Start the backend server
- Run the client application
- Make changes to the code
- Rebuild and restart as needed
For more information on the development workflow, including branching strategy and coding standards, please refer to the Development Guide.