diff --git a/.firebaserc.example b/.firebaserc.example index d80d27f1..43e110fb 100644 --- a/.firebaserc.example +++ b/.firebaserc.example @@ -1,18 +1,18 @@ { "projects": { - "default": "conferencecenterr" + "default": "openplanner" }, "targets": { - "conferencecenterr": { + "openplanner": { "hosting": { "conferencecenterr": [ - "conferencecenterr" + "conferencecenterrX" ], "apiopenplanner": [ - "apiopenplanner" + "apiopenplannerX" ], "serviceapi": [ - "serviceapi" + "serviceapiX" ] } } diff --git a/README.md b/README.md index 72de387d..48078102 100644 --- a/README.md +++ b/README.md @@ -44,23 +44,49 @@ React guidelines: ### Requirements -- One firebase project for **`open planner`**. +- One Firebase project for **`OpenPlanner`** on the Blaze plan. - Node.js **20+** - [Bun.js](https://bun.js.org/) as a build tool ### Installation -1. Create a **`.env`** with **`.env.example`** as a template. -2. Create a web app in your firebase project for **`conference hall`** and **`open planner`**. then copy the config and fill **`.env`** with it. -3. Use [bun.sh](https://bun.sh/) to install dependencies and build the project: `bun install` +1. Create a `.env` from `.env.example`. Do the same for the `.env` files in `functions` . +2. In your Firebase project, create a **Web App** named `openplanner` associated with the default hosting to obtain the Firebase config. Copy the generated config and populate `.env`. +3. In your Firebase project, create the following **Web App** (replace `X` with your suffix): + - API: Hosting site `apiopenplannerX` + - ConferenceCenter: Hosting site `conferencecenterrX` + - ServiceApi: Hosting site `serviceapiX` +4. Copy `.firebaserc.example` to `.firebaserc` and set your Firebase project values. Targets are resolved via `firebase target:apply`, no need to hardcode Hosting target name ids in `firebase.json`. +5. Install dependencies with Bun: `bun install`. Inside OpenPlanner's firebase project: -1. Enable Authentication with email/pwd in console.firebase.google.com -2. In the Authentication parameters, "User actions", disable the "Protection against enumeration of e-mail addresses (recommended)" option -3. Enable Storage, with rules in test or prod (whatever) -4. Set the hosting config for the website using the firebase CLI: `firebase target:apply hosting conferencecenterr dist` -5. Set the hosting config for the API (swagger) `firebase target:apply hosting apiopenplanner api-swagger` +1. Enable Authentication with email/password (Authentication > Sign-in method > Email/Password > Enable). +2. In Authentication settings, under User actions, disable “Protection against email enumeration (recommended)”. +3. Create Storage (use test or prod rules as needed). +4. Create a Firestore database (default mode). +5. Log in and select the Firebase project in your terminal: + +``` +firebase login +firebase use openplanner +``` + +6. Configure hosting targets with the Firebase CLI (replace X with your actual target suffix): + +``` +firebase target:apply hosting conferencecenterr conferencecenterrX +firebase target:apply hosting apiopenplanner apiopenplannerX +firebase target:apply hosting serviceapi serviceapiX +``` + +7. Deploy: `firebase deploy`. + +8. Copy the URL of the created API function into the .env file. + +9. Run frontend app: `npm run start`. Your app is available on `http://localhost:3000/`. + +10. To sign in to the app, create a user in Firebase under Authentication > Users. ### Development diff --git a/bun.lockb b/bun.lockb index ee87d5b6..b06a4fec 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/firebase.json b/firebase.json index eb51f2a9..f6e19066 100644 --- a/firebase.json +++ b/firebase.json @@ -45,7 +45,7 @@ }, { "target": "serviceapi", - "public": "api-swagger", + "public": "serviceapi-swagger", "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "rewrites": [ { diff --git a/functions/package-lock.json b/functions/package-lock.json index 88732027..6e81d2f2 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -2143,6 +2143,7 @@ "version": "12.2.3", "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "license": "MIT", "optional": true, "dependencies": { "@types/linkify-it": "*", @@ -6202,6 +6203,7 @@ "version": "12.3.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "license": "MIT", "optional": true, "dependencies": { "argparse": "^2.0.1", diff --git a/serviceapi-swagger/.empty b/serviceapi-swagger/.empty new file mode 100644 index 00000000..e69de29b