Skip to content

Commit 87be9ab

Browse files
authored
Merge pull request #26 from CodeLog-Development/feature/profile
Merge feature/profile into dev
2 parents 934f5f4 + 4c2ca2a commit 87be9ab

Some content is hidden

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

46 files changed

+577
-379
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

3-
firebase-debug.log
3+
*-debug.log
44
.firebase/*.cache
55
# api/firebase-service-account.json
66

README.md

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,16 @@
1-
# Gatekeeper
2-
3-
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
4-
5-
**This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)**
6-
7-
## Generate code
8-
9-
If you happen to use Nx plugins, you can leverage code generators that might come with it.
10-
11-
Run `nx list` to get a list of available plugins and whether they have generators. Then run `nx list <plugin-name>` to see what generators are available.
12-
13-
Learn more about [Nx generators on the docs](https://nx.dev/plugin-features/use-code-generators).
14-
15-
## Running tasks
16-
17-
To execute tasks with Nx use the following syntax:
18-
19-
```
20-
nx <target> <project> <...options>
21-
```
1+
[![Build and test](https://github.com/CodeLog-Development/gatekeeper/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/CodeLog-Development/gatekeeper/actions/workflows/build-and-test.yml)
222

23-
You can also run multiple targets:
24-
25-
```
26-
nx run-many -t <target1> <target2>
27-
```
28-
29-
..or add `-p` to filter specific projects
30-
31-
```
32-
nx run-many -t <target1> <target2> -p <proj1> <proj2>
33-
```
34-
35-
Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/core-features/run-tasks).
36-
37-
## Want better Editor Integration?
38-
39-
Have a look at the [Nx Console extensions](https://nx.dev/nx-console). It provides autocomplete support, a UI for exploring and running tasks & generators, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.
40-
41-
## Ready to deploy?
42-
43-
Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed.
44-
45-
## Set up CI!
3+
# Gatekeeper
464

47-
Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
5+
## Building
486

49-
- [Set up remote caching](https://nx.dev/core-features/share-your-cache)
50-
- [Set up task distribution across multiple machines](https://nx.dev/core-features/distribute-task-execution)
51-
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
7+
1. The first step is to run `yarn install` in the project root to download and build
8+
all dependencies.
9+
2. Next, you can run `yarn nx run app:build:production` and `yarn nx run api:build:production`
10+
to build the projects.
5211

53-
## Connect with us!
12+
## Development
5413

55-
- [Join the community](https://nx.dev/community)
56-
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
57-
- [Follow us on Twitter](https://twitter.com/nxdevtools)
14+
- To run the backend and frontend in a dev environment, start up the emulators for the backend using
15+
`yarn nx run api:emulators`.
16+
- You can then start the frontend with `yarn nx serve app`

api/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@gatekeeper/api",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"dependencies": {
5-
"@aws-sdk/client-ec2": "3.422.0",
5+
"@aws-sdk/client-ec2": "^3.422.0",
66
"@nestjs/common": "^10.2.6",
77
"@nestjs/config": "^3.1.1",
88
"@nestjs/core": "^10.2.6",
@@ -16,7 +16,8 @@
1616
"tslib": "^2.3.0"
1717
},
1818
"scripts": {
19-
"serve": "cd .. && yarn nx build api && yarn firebase serve"
19+
"serve": "cd .. && yarn nx build api && yarn firebase serve",
20+
"emulators": "cd .. && yarn nx build api && yarn firebase emulators:start"
2021
},
2122
"type": "commonjs",
2223
"main": "./src/index.js",

api/project.json

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"targets": {
77
"build": {
88
"executor": "@nx/js:tsc",
9-
"outputs": [
10-
"{options.outputPath}"
11-
],
9+
"outputs": ["{options.outputPath}"],
1210
"options": {
1311
"outputPath": "dist/api",
1412
"tsConfig": "api/tsconfig.lib.json",
@@ -27,21 +25,14 @@
2725
},
2826
"lint": {
2927
"executor": "@nx/linter:eslint",
30-
"outputs": [
31-
"{options.outputFile}"
32-
],
28+
"outputs": ["{options.outputFile}"],
3329
"options": {
34-
"lintFilePatterns": [
35-
"api/**/*.ts",
36-
"api/package.json"
37-
]
30+
"lintFilePatterns": ["api/**/*.ts", "api/package.json"]
3831
}
3932
},
4033
"test": {
4134
"executor": "@nx/jest:jest",
42-
"outputs": [
43-
"{workspaceRoot}/coverage/{projectRoot}"
44-
],
35+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
4536
"options": {
4637
"jestConfig": "api/jest.config.ts",
4738
"passWithNoTests": true
@@ -58,6 +49,12 @@
5849
"options": {
5950
"script": "serve"
6051
}
52+
},
53+
"emulators": {
54+
"executor": "nx:run-script",
55+
"options": {
56+
"script": "emulators"
57+
}
6158
}
6259
},
6360
"tags": []

api/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ const createFunction = async (
1717
new ExpressAdapter(expressInstance),
1818
{
1919
cors: {
20-
origin: [
21-
'https://codelog-mc.web.app',
22-
'https://us-central1-codelog-mc.cloudfunctions.net',
23-
'http://localhost',
24-
],
20+
origin: true,
2521
methods: ['GET', 'POST', 'OPTIONS', 'PUT', 'DELETE'],
2622
credentials: true,
2723
},
@@ -31,7 +27,9 @@ const createFunction = async (
3127
await app.init();
3228
};
3329

34-
export const api = functions.https.onRequest(async (request, response) => {
30+
export const api = new functions.FunctionBuilder({
31+
regions: ['europe-west2'],
32+
}).https.onRequest(async (request, response) => {
3533
await createFunction(expressServer);
3634
expressServer(request, response);
3735
});

0 commit comments

Comments
 (0)