Skip to content

Commit b4c3497

Browse files
authored
Merge pull request #21 from kotl/revert-20-main
Revert "Terraform and layout optimizations"
2 parents 37b8eb2 + 6325dc0 commit b4c3497

25 files changed

+82
-196
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ to store the to-do list items.
2929
3030
## Explore the app's codebase
3131

32-
- In `src/bootstrap.js`, you can find important configuration values:
32+
- In `src/environments/environments.ts`, you can find important configuration values:
3333

3434
- Within `firebase`, find the values needed to connect your app to Firebase
3535
(most importantly `apiKey`, `projectId`, and `appId`).
36-
- Find your Gemini API key (`geminiApiKey`).
36+
- Find your Gemini API key (`gemini_api_key`).
3737

3838
Note that if you
3939
[run the sample app in IDX](https://github.com/FirebaseExtended/make-it-so-angular/main/README.md#set-up-and-run-the-app),
@@ -105,12 +105,12 @@ to complete some manual setup steps.
105105
c. Create a new Firebase web app in your new project.
106106
You can skip setting up Firebase Hosting.
107107
d. Copy your Firebase config object, and replace the placeholder values in the
108-
`src/bootstrap.js` file of the sample app.
108+
`src/environments/environments.ts` file of the sample app.
109109

110110
2. Set up the Gemini API:
111111
a. [Get a Gemini API key](https://aistudio.google.com/app/apikey) in Google AI Studio.
112112
Use the Firebase project you just created.
113-
b. Add your Gemini API key into the `src/bootstrap.js` file of the sample app.
113+
b. Add your Gemini API key into the `src/environments/environments.ts` file of the sample app.
114114

115115
3. Run `npm install` to install the app's dependencies.
116116

@@ -173,7 +173,7 @@ your Firebase project (as described below).
173173
view and delete your Gemini API key.
174174
- In the sample app's codebase, delete references to the Gemini API key in the following places:
175175
- `google_apikeys_key` resource entry in `main.tf`
176-
- `geminiApiKey` in both `src/bootstrap.js` and `src/bootstrap.js.tmpl`
176+
- `gemini_api_key` in both `src/environments/environments.ts` and `src/environments/environments.ts.tmpl`
177177

178178
- If you're no longer using the Google AI Gemini API, then disable it in your project
179179
and delete references to it in your sample app's codebase:

angular.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@
3434
}
3535
],
3636
"styles": ["src/styles.scss"],
37-
"scripts": [
38-
{
39-
"input": "src/bootstrap.js",
40-
"inject": false
41-
}
42-
]
37+
"scripts": []
4338
},
4439
"configurations": {
4540
"production": {

idx-template.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
"name": "Firebase Project ID",
1515
"type": "string",
1616
"required": true
17-
},
18-
{
19-
"id": "bootstrapJs",
20-
"name": "Sample App Bootstrap",
21-
"type": "string",
22-
"required": false
2317
}
2418
]
2519
}

idx-template.nix

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
{ pkgs, projectId, bootstrapJs, ... }:
1+
{ pkgs, projectId, ... }:
22
{
33
bootstrap = ''
44
cp -rf ${./.} "$out/"
55
chmod -R +w "$out"
6-
echo 'bootstrapJs was set to: ${bootstrapJs}'
6+
77
# Apply project ID to configs
8-
if [ -z '${bootstrapJs}' ] || [ '${bootstrapJs}' = 'false' ]
9-
then
10-
sed -e 's/<project-id>/${projectId}/' ${.idx/dev.nix} > "$out/.idx/dev.nix"
11-
else
12-
sed -e 's/<project-id>/${projectId}/' ${.idx/dev.nix} | sed -e 's/terraform init/# terraform init/' | sed -e 's/terraform apply/# terraform apply/' > "$out/.idx/dev.nix"
13-
echo '${bootstrapJs}' > "$out/src/bootstrap.js"
14-
echo '{"projects":{"default":"${projectId}"}}' > "$out/.firebaserc"
15-
fi
8+
sed -e 's/<project-id>/${projectId}/' ${.idx/dev.nix} > "$out/.idx/dev.nix"
9+
1610
# Remove the template files themselves and any connection to the template's
1711
# Git repository
1812
rm -rf "$out/.git" "$out/idx-template".{nix,json} "$out/node_modules"

main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ resource "google_apikeys_key" "generativelanguage" {
7171
project = var.project
7272

7373
name = "gemini-api-key"
74-
display_name = "Generative language Gemini API Key"
74+
display_name = "Gemini API Key"
7575

7676
restrictions {
7777
api_targets {
@@ -118,7 +118,7 @@ resource "google_firebaserules_release" "firestore" {
118118
resource "google_firebase_web_app" "example" {
119119
project = var.project
120120

121-
display_name = "Sample Firebase AI App"
121+
display_name = "Make It So AI!"
122122
}
123123

124124
data "google_firebase_web_app_config" "example" {
@@ -144,13 +144,13 @@ resource "local_file" "firebaserc" {
144144
}
145145

146146
resource "local_file" "environment_ts" {
147-
content = templatefile("${path.module}/src/bootstrap.js.tmpl", merge(
147+
content = templatefile("${path.module}/src/environments/environments.ts.tmpl", merge(
148148
data.google_firebase_web_app_config.example,
149149
{
150150
project_id = data.google_project.project.project_id,
151151
gemini_api_key = google_apikeys_key.generativelanguage.key_string,
152152
debug_token = "" # Use local.uuid4 in when using Vertex AI in Firebase
153153
}
154154
))
155-
filename = "${path.module}/src/bootstrap.js"
155+
filename = "${path.module}/src/environments/environments.ts"
156156
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"@angular/platform-browser": "^18.1.0",
2222
"@angular/platform-browser-dynamic": "^18.1.0",
2323
"@google/generative-ai": "^0.19.0",
24-
"backoff-rxjs": "^7.0.0",
2524
"firebase": "^10.13.0",
2625
"rxjs": "~7.8.0",
2726
"tslib": "^2.3.0",

pnpm-lock.yaml

Lines changed: 2 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/app.component.html

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Copyright 2025 Google LLC
2+
Copyright 2024 Google LLC
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -16,29 +16,19 @@
1616
<div class="site-layout h-screen overflow-scroll">
1717
<div class="w-full py-4 flex flex-col lg:px-12 mb-8">
1818
<!-- Icon and Title Section -->
19-
@if (viewCodeLink) {
20-
<div
21-
class="w-full mr-8 flex items-center justify-center ">
22-
<div class="pl-[10%] pr-[10%] banner font-light flex flex-col sm:flex-row items-center">
23-
<img src="assets/link.svg" class="link">
24-
<span>{{viewCodeMessage}}</span>
25-
<a mat-button class="m-1" [href]="viewCodeLink" target="_blank" rel="noopener">Create Workspace</a>
26-
</div>
27-
</div>
28-
}
29-
<div class="flex items-center p-6 pb-0 pl-[10%] justify-start">
19+
<div class="flex items-center p-8 pl-[10%] justify-start">
3020
<img
31-
src="../assets/gemini_logo.svg"
21+
src="../assets/Spark_Gradient.png"
3222
alt="Icon"
3323
class="w-12 h-12 mr-4"
3424
/>
35-
<h1 class="text-2xl md:text-3xl">
25+
<h1 class="text-3xl" style="font-family: 'Helvetica Neue', sans-serif">
3626
Planning with the Gemini API
3727
</h1>
3828
</div>
3929

4030
<div
41-
class="w-full p-4 py-0 flex flex-col lg:items-start lg:flex-row lg:gap-6 justify-between items-center mx-auto"
31+
class="w-full p-4 flex flex-col lg:items-start lg:flex-row lg:gap-6 justify-between items-center mx-auto"
4232
>
4333
<!-- Task Generation -->
4434
<div
@@ -47,7 +37,7 @@ <h1 class="text-2xl md:text-3xl">
4737
<div class="flex-grow flex flex-col justify-between overflow-scroll">
4838
<div>
4939
<!-- Checkbox Images Section -->
50-
<div class="w-full flex gap-12 mb-4 p-4 justify-center mx-auto">
40+
<div class="w-[90%] flex gap-12 justify-center mx-auto">
5141
<app-checkboximage
5242
#location
5343
[src]="'/assets/location.png'"
@@ -65,7 +55,7 @@ <h1 class="text-2xl md:text-3xl">
6555
<!-- Prompt Input Section -->
6656
<form>
6757
<div class="w-full flex flex-col justify-between gap-4 mb-4 p-4 lg:flex-row xl:flex-row">
68-
<mat-form-field class="w-full mb-8" appearance="outline">
58+
<mat-form-field class="w-11/12 mb-8" appearance="outline">
6959
<mat-label>Add a prompt</mat-label>
7060
<textarea
7161
[formControl]="formControls.prompt"
@@ -90,15 +80,15 @@ <h1 class="text-2xl md:text-3xl">
9080
</mat-form-field>
9181
<button
9282
mat-button
93-
class="mt-6 flex items-center gap-2 pr-4 with-bg"
83+
class="mt-6 flex items-center gap-2 pr-4"
9484
(click)="onGoClick()"
9585
[disabled]="!formControls.prompt.value"
9686
>
9787
<span class="flex items-center">
9888
<img
9989
src="../assets/spark_icon_24.svg"
10090
alt="Gemini Icon"
101-
class="w-12 h-6"
91+
class="w-6 h-6"
10292
/>
10393
<span class="p-2">Go</span>
10494
</span>
@@ -128,8 +118,8 @@ <h1 class="text-2xl md:text-3xl">
128118
<div class="flex flex-row gap-4 w-full justify-end">
129119
<button
130120
mat-button
131-
[disabled]="!generatedTask || !(firestoreReady | async)"
132-
class="w-36 text-md with-bg"
121+
[disabled]="!generatedTask"
122+
class="w-36 text-md"
133123
(click)="onSave()"
134124
>
135125
Save

src/app/app.component.scss

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2025 Google LLC
2+
* Copyright 2024 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,29 +21,11 @@
2121
}
2222

2323
.mat-mdc-button {
24-
--mdc-text-button-label-text-color: #0B57D0;
25-
height: 48px;
26-
border-radius: 0.75rem;
27-
}
28-
29-
.with-bg {
30-
--mdc-text-button-label-text-color: 181C20;
3124
background-color: #bbdefb;
25+
height: 48px;
26+
border-radius: 0.75rem
3227
}
3328

3429
::ng-deep .mdc-notched-outline__notch {
3530
border-right: none;
3631
}
37-
38-
.banner {
39-
border-radius: 24px;
40-
border-color: #0B57D0;
41-
border-width: 1px;
42-
font-family: 'Google Sans Text';
43-
font-size: 14px;
44-
}
45-
46-
.link {
47-
float:left;
48-
margin: 12px;
49-
}

src/app/app.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2025 Google LLC
2+
* Copyright 2024 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/app/app.component.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2025 Google LLC
2+
* Copyright 2024 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@ import { TaskComponent } from './task.component';
4141
import { CheckboximageComponent } from './checkboximage.component';
4242
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
4343
import { ChangeDetectionStrategy } from '@angular/core';
44-
import { environment } from '../environments/environments';
4544

4645
const HELP_ME_CLEAN = 'You are an organization expert transforming this place to be enjoyed by a child and a toddler who love superheroes';
4746
const HELP_ME_PLAN = 'You are a travel expert planning a trip here for 5 people including one toddler and my mom who is turning 50.';
@@ -81,13 +80,9 @@ export class AppComponent {
8180
validators: Validators.required,
8281
}),
8382
};
84-
readonly viewCodeLink = environment.viewCodeLink;
85-
readonly viewCodeMessage = environment.viewCodeMessage;
86-
8783
isLoading = signal(false);
8884
tasks: TaskWithSubtasks[] = [];
8985
generatedTask?: TaskWithSubtasks;
90-
firestoreReady: Observable<boolean>;
9186

9287
@ViewChild('location') locationImage! : CheckboximageComponent;
9388
@ViewChild('room') roomImage! : CheckboximageComponent;
@@ -98,12 +93,11 @@ export class AppComponent {
9893
constructor(
9994
public taskService: TaskService,
10095
private cdr: ChangeDetectorRef,
101-
) {
102-
this.firestoreReady = this.taskService.firestoreReady;
103-
}
96+
) {}
10497

10598
ngOnInit(): void {
10699
this.loadTasks().subscribe();
100+
this.onGoClick() // Generate the first task
107101
}
108102

109103
async ngAfterViewInit() {

src/app/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2025 Google LLC
2+
* Copyright 2024 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/app/services/task.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2025 Google LLC
2+
* Copyright 2024 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)