Skip to content

Commit 79518e0

Browse files
committed
Corrected Backend and Added Attendence
1 parent 2fb2b53 commit 79518e0

4 files changed

Lines changed: 30 additions & 7 deletions

File tree

.idea/vcs.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ILPlatform Backend
1+
# ILPlatform Backend
22

33
This repo constitutes the backend for the ILPlatform landing and curriculum page. It is built using Firebase Functions
44
and connects to the Salesforce and Google API for database and document management.
@@ -7,8 +7,9 @@ and connects to the Salesforce and Google API for database and document manageme
77

88
In order for the code to make sense, you need to generate the following files:
99

10-
- `functions/.googleapi_credentials.json` - Can be obtained through the Google Cloud Console under Credentials > OAuth
11-
2.0 Client IDs with type Web Application and redirect URI "http://localhost:8888/oauth2callback".
10+
- `functions/.googleapi_credentials.json` - Can be obtained through the Google Cloud Console (Project: ILPlatform
11+
Website) under Credentials (search for it) > OAuth 2.0 Client IDs with type Web Application and redirect
12+
URI "http://localhost:8888/oauth2callback". Simply select pre-existing client and generate new client secret.
1213
- `functions/.googleapi_token.json` - Can be obtained by running the server locally (see below) and calling any endpoint
1314
that requires the Google Connector. Ensure that all required scopes are activated in the Google API.
1415
- `functions/.firebase_adminsdk.json` - Can be obtained through the Firebase Console under Project Settings > Service
@@ -35,16 +36,33 @@ In order for the code to make sense, you need to generate the following files:
3536
- `functions/venv` - Contains the Python virtual environment for the backend. Can be created by running
3637
```bash
3738
cd functions
38-
python3.11 -m venv venv
39+
python3.12 -m venv venv
3940
source venv/bin/activate
40-
python3.11 -m pip install -r requirements.txt
41+
python3.12 -m pip install -r requirements.txt
4142
```
43+
Alternatively, run `source sh_create_env.sh`.
4244

4345
## Local Development
4446

4547
In order to run the code, you need to run the following;
4648

4749
```
48-
. functions/venv/bin/activate
50+
source functions/venv/bin/activate
4951
firebase emulators:start --only functions
52+
```
53+
Alternatively, run `source sh_start.sh`.
54+
55+
## Possible Issues
56+
57+
### User code failed to load
58+
59+
An error of this style might occur:
60+
```
61+
⬢ functions: Failed to load function definition from source: FirebaseError: User code failed to load. Cannot determine backend specification. Timeout after 10000. See https://firebase.google.com/docs/functions/tips#avoid_deployment_timeouts_during_initialization'
62+
```
63+
64+
To solve it, do the following:
65+
66+
```
67+
npm i -g firebase-tools
5068
```

sh_create_env.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cd functions
2+
python3.12 -m venv venv
3+
source venv/bin/activate
4+
python3.12 -m pip install -r requirements.txt

sh_start.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
source functions/venv/bin/activate
2+
firebase emulators:start --only functions

0 commit comments

Comments
 (0)