Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ AWS_SECRET_ACCESS_KEY=flightbook_dev_secret
JWT_SECRET=mySecret
TOKEN_EXPIRATION=1000h

FIREBASE_CREDENTIAL_JSON=

# Origin
ORIGIN_INSTRUCTOR=localhsot:4200

# Mobile App URL
MOBILE_APP_URL=http://localhost:8100

# Instructor App URL
INSTRUCTOR_APP_URL=http://localhost:4200

# Backend API URL
API_URL=http://localhost:8282

# Email
EMAIL_HOST:
EMAIL_USER:
Expand All @@ -78,6 +82,12 @@ MAP_URL=
MAP_ATTRIBUTIONS=
MAP_CROSS_ORIGIN=

# Google OAuth Credentials (from Google Cloud Console)
GOOGLE_CLIENT_ID=your-client-id-here.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret-here

FIREBASE_CREDENTIAL_JSON=

# Version Check (Mobile App)
ANDROID_MINIMAL_VERSION_BUILD=
ANDROID_LATEST_BUILD=
Expand All @@ -99,6 +109,29 @@ npm run start:dev
MIGRATION_NAME=appointmentType npm run migration:generate
```

## Google Cloud Console Setup

### Create OAuth 2.0 Credentials

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project or select an existing one
3. Enable the **Google Calendar API**:
- Navigate to "APIs & Services" → "Library"
- Search for "Google Calendar API"
- Click "Enable"

4. Create OAuth 2.0 credentials:
- Go to "APIs & Services" → "Credentials"
- Click "Create Credentials" → "OAuth 2.0 Client ID"
- Choose "Web application" as application type
- Configure the OAuth consent screen if prompted

5. Add authorized redirect URIs:
- Add your backend callback URL: `{API_URL}/schools/google-calendar/callback`
- Note: We use a single redirect URI for all schools. The school ID is passed via the OAuth `state` parameter

6. Copy the **Client ID** and **Client Secret**

## Security
If you discover security related issues, please email yannick.lagger@flightbook.ch instead of using the issue tracker.

Expand Down
167 changes: 158 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"csv-parse": "^6.1.0",
"firebase-admin": "^13.7.0",
"google-auth-library": "^10.5.0",
"googleapis": "^144.0.0",
"helmet": "^8.1.0",
"jwks-rsa": "^3.2.0",
"moment": "^2.30.1",
Expand Down
21 changes: 21 additions & 0 deletions src/db/migrations/1775101486000-addGoogleCalendarIntegration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class AddGoogleCalendarIntegration1775101486000 implements MigrationInterface {
name = 'AddGoogleCalendarIntegration1775101486000'

public async up(queryRunner: QueryRunner): Promise<void> {
// Add google_calendar_event_id column to appointment table
await queryRunner.query(`
ALTER TABLE "appointment"
ADD COLUMN "google_calendar_event_id" character varying
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
// Remove google_calendar_event_id column from appointment table
await queryRunner.query(`
ALTER TABLE "appointment"
DROP COLUMN "google_calendar_event_id"
`);
}
}
13 changes: 13 additions & 0 deletions src/i18n/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,18 @@
"forceUpdate": "Diese Version wird nicht mehr unterstützt. Bitte aktualisiere die App, um fortzufahren.",
"optionalUpdate": "Eine neue Version der App ist verfügbar. Ein Update wird empfohlen.",
"upToDate": "Deine App ist auf dem neuesten Stand."
},
"appointment": {
"stateValue": {
"ANNOUNCED": "Angesagt",
"CONFIRMED": "Bestätigt",
"CANCELED": "Abgesagt"
},
"state": "Status",
"meetingPoint": "Treffpunkt",
"maxPeople": "Max Teilnehmer*innen",
"instructor": "Fluglehrer*in",
"takeOffCoordinator": "Starthelfer*in",
"description": "Beschreibung"
}
}
13 changes: 13 additions & 0 deletions src/i18n/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,18 @@
"forceUpdate": "Cette version n'est plus supportée. Veuillez mettre à jour l'application pour continuer.",
"optionalUpdate": "Une nouvelle version de l’application est disponible. Une mise à jour est recommandée.",
"upToDate": "Votre application est à jour."
},
"appointment": {
"stateValue": {
"ANNOUNCED": "Annoncé",
"CONFIRMED": "Confirmé",
"CANCELED": "Annulé"
},
"state": "Statut",
"meetingPoint": "Point de rencontre",
"maxPeople": "Max participants",
"instructor": "Instructeur",
"takeOffCoordinator": "Aide au décollage",
"description": "Description"
}
}
Loading
Loading