Skip to content

Commit 96e4743

Browse files
authored
feat(api): improve code performance when connecting to firestore service
BREAKING CHANGE: The way how this API connects to Firestore has been changed
1 parent dcf63a0 commit 96e4743

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4699
-4069
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

.devcontainer/base.Dockerfile

Lines changed: 0 additions & 55 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/javascript-node
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
33
{
44
"name": "Node.js",
5-
"build": {
6-
"dockerfile": "Dockerfile",
7-
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
8-
// Append -bullseye or -buster to pin to an OS version.
9-
// Use -bullseye variants on local arm64/Apple Silicon.
10-
"args": { "VARIANT": "18" }
5+
"image": "mcr.microsoft.com/devcontainers/javascript-node:18-bullseye",
6+
"features": {
7+
"ghcr.io/devcontainers/features/git:1": {},
8+
"ghcr.io/devcontainers/features/github-cli:1": {},
9+
"ghcr.io/devcontainers/features/node:1": {},
10+
"ghcr.io/dhoeric/features/google-cloud-cli:1": {}
1111
},
12-
13-
// Configure tool-specific properties.
1412
"customizations": {
15-
// Configure properties specific to VS Code.
1613
"vscode": {
17-
// Add the IDs of extensions you want installed when the container is created.
1814
"extensions": [
1915
"dbaeumer.vscode-eslint",
16+
"esbenp.prettier-vscode",
2017
"rangav.vscode-thunder-client"
2118
]
2219
}
23-
},
20+
}
21+
22+
// Features to add to the dev container. More info: https://containers.dev/features.
23+
// "features": {},
2424

2525
// Use 'forwardPorts' to make a list of ports inside the container available locally.
2626
// "forwardPorts": [],
2727

2828
// Use 'postCreateCommand' to run commands after the container is created.
2929
// "postCreateCommand": "yarn install",
3030

31-
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
32-
"remoteUser": "node",
33-
"features": {
34-
"git": "latest"
35-
}
31+
// Configure tool-specific properties.
32+
// "customizations": {},
33+
34+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
35+
// "remoteUser": "root"
3636
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3+
# misc
4+
lmm-oa-sws
5+
36
# dependencies
47
/node_modules
58
/.pnp

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"prettier.printWidth": 150
3+
}

index.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
// dependency
2-
import 'dotenv/config';
2+
import "dotenv/config";
33

44
// app import
5-
import app from './src/app.js';
5+
import app from "./src/app.js";
66

77
// load utils
8-
import { logger } from './src/utils/logger.js';
8+
import { logger } from "./src/utils/logger.js";
9+
10+
// load classes
11+
import { Users } from "./src/classes/Users.js";
12+
import { Congregations } from "./src/classes/Congregations.js";
13+
import { CongregationRequests } from "./src/classes/CongregationRequests.js";
14+
import { Announcements } from "./src/classes/Announcements.js";
915

1016
const PORT = process.env.PORT || 8000;
1117
const APP_VERSION = process.env.npm_package_version;
1218

13-
app.listen(PORT, () => {
14-
logger(
15-
'info',
16-
JSON.stringify({ details: `server up and running (v${APP_VERSION})` })
17-
);
19+
app.listen(PORT, async () => {
20+
await Announcements.loadAll();
21+
await Users.loadAll();
22+
await Congregations.loadAll();
23+
await CongregationRequests.loadAll();
24+
25+
logger("info", JSON.stringify({ details: `server up and running (v${APP_VERSION})` }));
1826
});

0 commit comments

Comments
 (0)