Compare commits

...

163 Commits
v2 ... v3.0.0

Author SHA1 Message Date
30d0151bdb Merge pull request #646 from AmruthPillai/i18n_main
New Crowdin updates
2022-03-11 20:28:50 +01:00
4dd94c3363 Update CHANGELOG.md 2022-03-11 20:27:25 +01:00
f711b089bc New translations landing.json (German) 2022-03-11 20:25:38 +01:00
01c1125153 New translations modals.json (German) 2022-03-11 20:25:37 +01:00
fa42d82416 New translations dashboard.json (German) 2022-03-11 20:25:32 +01:00
6322d4d105 New translations builder.json (German) 2022-03-11 20:25:28 +01:00
77467929c7 New translations common.json (German) 2022-03-11 20:25:27 +01:00
3a524f9c9c fix(lang): add hi, de to next-i18next 2022-03-11 20:21:35 +01:00
63f900870b chore(release): 3.0.0 2022-03-11 20:03:50 +01:00
32f78e85f7 Merge pull request #645 from AmruthPillai/feat/add-docs-workspace
Add docs powered by Docusaurus v2
2022-03-11 20:03:29 +01:00
1cc2232730 docs(docusaurus): update docs, add languages, ready to build 2022-03-11 20:02:16 +01:00
2ff6761630 Merge branch 'main' into feat/add-docs-workspace 2022-03-11 19:48:35 +01:00
5836e55a36 docs(readme): update readme with languages section, add license badge 2022-03-11 19:42:07 +01:00
ec98c14fbd Create LICENSE 2022-03-11 19:40:38 +01:00
78c1f5a380 Delete feature_request.md 2022-03-11 19:29:10 +01:00
808fa45124 Delete bug_report.md 2022-03-11 19:29:04 +01:00
2625ed4f3d Merge pull request #644 from AmruthPillai/i18n_main
New Crowdin updates
2022-03-11 19:27:42 +01:00
40085f8d78 New translations modals.json (Hindi) 2022-03-11 19:26:50 +01:00
f4e3be178c New translations landing.json (German) 2022-03-11 19:26:48 +01:00
601f61c59a New translations dashboard.json (Hindi) 2022-03-11 19:26:47 +01:00
59049e8f77 New translations modals.json (German) 2022-03-11 19:26:45 +01:00
798e77f693 New translations landing.json (Hindi) 2022-03-11 19:26:44 +01:00
78565079e7 New translations common.json (Hindi) 2022-03-11 19:26:42 +01:00
0bec4cff05 New translations dashboard.json (German) 2022-03-11 19:26:38 +01:00
26dc0069f9 New translations common.json (German) 2022-03-11 19:26:36 +01:00
90bb80b1e2 New translations builder.json (German) 2022-03-11 19:26:35 +01:00
61ed3ff018 New translations modals.json (Kannada) 2022-03-11 19:26:34 +01:00
36a12e82a2 New translations builder.json (Hindi) 2022-03-11 19:26:26 +01:00
a3cf1752cc Merge pull request #643 from AmruthPillai/i18n_main
New Crowdin updates
2022-03-11 19:06:12 +01:00
5b79e23564 Merge branch 'main' into i18n_main 2022-03-11 19:06:05 +01:00
300e4a790d New translations modals.json (Kannada) 2022-03-11 19:04:32 +01:00
ba4666b767 New translations modals.json (Tamil) 2022-03-11 19:04:31 +01:00
b283c6ee8f New translations landing.json (Tamil) 2022-03-11 19:04:29 +01:00
316eca35ef New translations common.json (Kannada) 2022-03-11 19:04:27 +01:00
16c18de964 New translations common.json (Tamil) 2022-03-11 19:04:26 +01:00
0c23af4be8 New translations builder.json (Kannada) 2022-03-11 19:04:25 +01:00
fe1b325fdf New translations builder.json (Tamil) 2022-03-11 19:04:24 +01:00
9395a4d578 docs(style): update CHANGELOG.md 2022-03-11 15:46:49 +01:00
c11f92841b chore(release): 3.0.0-beta.6 2022-03-11 15:44:42 +01:00
2654cba039 fix(webkit): fix issue with webkit not supporting .at() 2022-03-11 15:40:25 +01:00
7d8828a358 fix(i18n): add missing translation keys, update lang/locale logic 2022-03-11 08:43:20 +01:00
8bc7d2599e feat(lang): add language switcher on the landing page, in the footer 2022-03-10 21:59:16 +01:00
036adbfc96 Delete .DS_Store 2022-03-10 15:34:02 +01:00
4b7e43424c style(changelog): add standard-version to automate releases and tags 2022-03-10 15:32:46 +01:00
0f1c3a8142 chore(release): 3.0.0 2022-03-10 15:29:49 +01:00
8dc27ecf07 Merge pull request #641 from AmruthPillai/i18n_main
New Crowdin updates
2022-03-10 14:58:45 +01:00
a05917b00d New translations modals.json (Kannada) 2022-03-10 14:58:17 +01:00
d5f2eea34c New translations landing.json (Kannada) 2022-03-10 14:58:16 +01:00
29bc3f33a6 New translations dashboard.json (Kannada) 2022-03-10 14:58:15 +01:00
b332b77eff New translations dashboard.json (Tamil) 2022-03-10 14:58:14 +01:00
8e09db276e New translations builder.json (Kannada) 2022-03-10 14:58:12 +01:00
2f7cfd2add New translations builder.json (Tamil) 2022-03-10 14:58:11 +01:00
6a4464b239 New translations common.json (Kannada) 2022-03-10 14:29:16 +01:00
972e8b1bcf fix(app): fix issue with using swipelayout 2022-03-10 14:13:54 +01:00
ad916c5b07 Create close-stale.yml 2022-03-10 09:37:47 +01:00
eca80a1663 feat(health): add health checks to server api 2022-03-10 09:25:15 +01:00
8f48f5fcd6 remove codemagic.yaml 2022-03-10 00:18:50 +01:00
40f5111eba update local.properties path 2022-03-10 00:12:33 +01:00
55a09c0c05 remove other group from codemagic.yml 2022-03-09 23:58:25 +01:00
1e72efa7ac ci(codemagic): add android app ci to build and publish automatically 2022-03-09 23:49:22 +01:00
fd752bfd70 Merge pull request #640 from AmruthPillai/feat/android-app
Adding Android App Source Code to the Monorepo
2022-03-09 23:40:56 +01:00
ee328186c8 fix(client): add safety check on path.id split 2022-03-09 23:39:04 +01:00
ecab1e0bfa style(eslint): do not log all files when linting, just errors 2022-03-09 22:43:45 +01:00
cbbdc92c66 style(prettier): add android app to ignore files for eslint, prettier and docker 2022-03-09 22:41:57 +01:00
5d54f8101b feat(app): add an android app that loads beta.rxresu.me through a webview 2022-03-09 22:40:59 +01:00
4fe5788b23 docs(landing): add links to privacy policy and terms of service 2022-03-09 20:19:05 +01:00
612335696c ci(docker): use version instead of commit sha 2022-03-09 19:30:30 +01:00
781dc4d231 ci(release): remove release-it 2022-03-09 19:18:31 +01:00
5d37dcb0ed ci(release-it): add release-it to auto-generate changelogs and release to github 2022-03-09 19:15:20 +01:00
6255849822 fix(printer): fix issue with printer service, locating the right URL of the server 2022-03-09 18:55:17 +01:00
ef3b2c5638 docs(source-code): add docs to build project from source, docker + local build 2022-03-09 14:05:40 +01:00
6c671f2dba Merge branch 'main' into feat/add-docs-workspace 2022-03-09 11:08:17 +01:00
4447b58b8f Merge pull request #635 from AmruthPillai/i18n_main
New Crowdin updates
2022-03-09 09:45:28 +01:00
b210b19b03 Merge branch 'main' into i18n_main 2022-03-09 09:45:06 +01:00
1e909f3257 docs(changelog): add CHANGELOG.md 2022-03-09 09:44:11 +01:00
c3f037ee1d chore(version): bump version to v3.0.0.beta.1 2022-03-09 09:40:16 +01:00
6f02048ebd feat(client/landing): add testimonials section to landing page 2022-03-09 09:37:38 +01:00
78cd1c036e Update source file landing.json 2022-03-09 00:02:00 +01:00
7e1448bbf9 docs(readme): add fossa license check badge 2022-03-08 23:56:11 +01:00
dc4aa0b496 feat(docs): add docusaurus workspace, initial setup of docs 2022-03-08 23:54:00 +01:00
a131bb3652 feat(client): add language selector, language detector and privacy/tos pages 2022-03-08 22:57:47 +01:00
bf9da32465 Merge pull request #634 from AmruthPillai/i18n_main
New Crowdin updates
2022-03-08 16:33:25 +01:00
efba6ee7dd New translations landing.json (Tamil) 2022-03-08 16:30:34 +01:00
9c2ff5e14f New translations common.json (Tamil) 2022-03-08 16:30:31 +01:00
d167baa607 Merge pull request #633 from AmruthPillai/i18n_main
New Crowdin updates
2022-03-08 16:23:21 +01:00
e420ea6ce4 New translations modals.json (Kannada) 2022-03-08 16:22:51 +01:00
ec0a88675b New translations modals.json (Tamil) 2022-03-08 16:22:50 +01:00
11827dcc29 New translations landing.json (Kannada) 2022-03-08 16:22:49 +01:00
1f6f052129 New translations landing.json (Tamil) 2022-03-08 16:22:48 +01:00
66b98a21e8 New translations dashboard.json (Kannada) 2022-03-08 16:22:47 +01:00
b017d7aa41 New translations dashboard.json (Tamil) 2022-03-08 16:22:47 +01:00
62398fd96f New translations common.json (Kannada) 2022-03-08 16:22:46 +01:00
8167f51ce1 New translations common.json (Tamil) 2022-03-08 16:22:45 +01:00
f0a381a37c New translations builder.json (Kannada) 2022-03-08 16:22:44 +01:00
d923dfe3c0 New translations builder.json (Tamil) 2022-03-08 16:22:43 +01:00
d3f1cc746a Update Crowdin configuration file 2022-03-08 16:22:32 +01:00
8ee4993321 Update README.md 2022-03-08 15:49:04 +01:00
917850157e Update issue templates 2022-03-08 15:12:24 +01:00
b4856be5ab refactor(.env.example): update example to match current configuration 2022-03-08 14:07:28 +01:00
fc29fb8eb4 docs(readme): update description, add sections to README.md 2022-03-08 14:03:09 +01:00
2e288a5407 ci(github): add github action to redeploy latest version after docker image ci 2022-03-08 11:50:59 +01:00
43ce43ab5b refactor(server): remove api prefix for all routes 2022-03-08 10:52:13 +01:00
5a2594eb88 refactor(server): use proxy mechanisms to remove server_url config 2022-03-08 10:36:04 +01:00
e52edaa552 chore(husky): implement husky commit hooks to install, lint and format before commit 2022-03-08 08:11:47 +01:00
54fd97b5ec fix(pnpm): install deps to update pnpm-lock.yaml 2022-03-08 07:56:25 +01:00
9df12194bf fix(mail.service): use sendgrid api instead of nodemailer for better deliverability 2022-03-08 07:46:06 +01:00
e96b090904 fix(printer.service): add --disable-dev-shm-usage flag to chromium headless playwright browser 2022-03-08 00:06:07 +01:00
d79997d380 ci(docker): add env port to dockerfile, use port env instead of server_port 2022-03-07 23:52:39 +01:00
2696a54d17 fix(playwright): use playwright docker image due to runtime error 2022-03-07 23:09:14 +01:00
28ba2b1b8f ci(docker): fix short sha generation, seperate jobs for parallel execution 2022-03-07 22:42:09 +01:00
deb51f0e29 ci(docker): publish multiple docker images, to multiple registries 2022-03-07 22:26:33 +01:00
aa5e748cca ci(docker): use docker hub instead of digitalocean container registry 2022-03-07 21:55:37 +01:00
b0a295d8bb build(docker): minimize production docker image size by using ubuntu:focal 2022-03-07 21:43:38 +01:00
c738f311da fix(databasemodule): make ssl optional, pass ca cert as base64 env 2022-03-07 15:06:16 +01:00
cff51a8be9 Update docker-build-push.yml 2022-03-07 14:05:27 +01:00
1a0ab6fb22 ci(docker): add github action to build docker images automatically 2022-03-07 14:02:40 +01:00
938e2e8e25 build(v3): use pnpm, docker, docker-compose to orchestrate two services (client, server) 2022-03-07 13:43:34 +01:00
9c1380f401 🚀 release v3.0.0 2022-03-06 22:48:29 +01:00
00505a9e5d ci(docker): changes to dockerfile to make builds faster 2022-03-05 23:18:47 +01:00
37f0ab3bca ci(docker): attempt to fix production deploy, with env management 2022-03-05 14:36:38 +01:00
a4983ac6bc fix(i18n): load locales from file system, instead of http-backend 2022-03-05 10:08:28 +01:00
7c73685759 1646397537 2022-03-04 13:38:58 +01:00
269d5206e6 1646393163 2022-03-04 12:26:03 +01:00
e1529e03f9 add option to pass CA certificate for database deploys 2022-03-04 11:50:10 +01:00
5104ea6438 perf(app): working docker build stage, with github actions ci to push image 2022-03-04 10:54:31 +01:00
36f41c2f9d add commit script in npm 2022-03-03 21:14:46 +01:00
7e50c8e85b ci(docker): build production Docker image, also push to Docker Hub 2022-03-03 21:14:07 +01:00
993fd82f4c testing github actions 2022-03-03 20:15:19 +01:00
ed6578b052 attempting to make docker package smaller, and take less memory 2022-03-03 20:05:22 +01:00
5fc7a32c67 attempt docker build with pnpm 2022-03-03 15:33:11 +01:00
58160b2b6e experiments with docker packaging, figuring out deploy plan 2022-03-03 12:24:32 +01:00
2aa3786f5f experiments with docker packaging, figuring out deploy plan 2022-03-03 09:35:13 +01:00
a30011e841 switch from pnpm to npm as package manager 2022-03-02 20:46:14 +01:00
295172687b 🚀 release: v3.0.0 2022-03-02 17:44:11 +01:00
2175256310 clear everything 2022-02-28 20:23:10 +01:00
ff892e3ea5 Merge pull request #624 from AmruthPillai/dependabot/npm_and_yarn/url-parse-1.5.10
Bump url-parse from 1.5.7 to 1.5.10
2022-02-28 06:53:30 +01:00
0e2e50d658 Bump url-parse from 1.5.7 to 1.5.10
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 04:36:42 +00:00
4657f1f5f5 Merge pull request #622 from AmruthPillai/dependabot/npm_and_yarn/follow-redirects-1.14.8
Bump follow-redirects from 1.14.1 to 1.14.8
2022-02-20 07:07:59 +01:00
81fc3b981c Merge pull request #618 from AmruthPillai/dependabot/npm_and_yarn/ws-5.2.3
Bump ws from 5.2.2 to 5.2.3
2022-02-20 07:07:53 +01:00
e961d043da Merge pull request #617 from AmruthPillai/dependabot/npm_and_yarn/simple-get-3.1.1
Bump simple-get from 3.1.0 to 3.1.1
2022-02-20 07:07:48 +01:00
4d4c24b79d Merge pull request #616 from AmruthPillai/dependabot/npm_and_yarn/functions/lodash-4.17.21
Bump lodash from 4.17.20 to 4.17.21 in /functions
2022-02-20 07:07:43 +01:00
d40539680a Merge pull request #623 from AmruthPillai/dependabot/npm_and_yarn/url-parse-1.5.7
Bump url-parse from 1.5.1 to 1.5.7
2022-02-20 07:07:29 +01:00
ea0a5ec989 Bump url-parse from 1.5.1 to 1.5.7
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.7.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.1...1.5.7)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-19 08:10:21 +00:00
9e855be82c Bump follow-redirects from 1.14.1 to 1.14.8
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.1 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.1...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 16:37:08 +00:00
a9be89a754 Bump ws from 5.2.2 to 5.2.3
Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-09 12:18:40 +00:00
789c49e47e Bump simple-get from 3.1.0 to 3.1.1
Bumps [simple-get](https://github.com/feross/simple-get) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/feross/simple-get/releases)
- [Commits](https://github.com/feross/simple-get/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: simple-get
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-09 12:18:30 +00:00
56f46a185c Bump lodash from 4.17.20 to 4.17.21 in /functions
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

---
updated-dependencies:
- dependency-name: lodash
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-09 12:17:25 +00:00
3a8f4f00d0 Merge pull request #614 from martadinata666/gatsby-host
use -H 0.0.0.0 on Gatsby
2022-02-09 13:16:54 +01:00
e9c7f33d30 Merge pull request #609 from apat183/fix-image-stretching
add 'object cover' class to templates that have issues with profile image stretching.
2022-02-08 09:16:21 +01:00
7e1483b2a2 Merge pull request #613 from zzarc/fix-readme-translation
fix translation error for language Japanese
2022-02-05 19:50:47 +01:00
d3359cfa58 fix translation error 2022-02-05 01:20:09 -08:00
04afc009ef use -H 0.0.0.0 on Gatsby 2022-02-05 10:33:15 +07:00
46090b0793 fix translation error in readme 2022-02-04 01:49:01 -08:00
b617ec6bfa add 'object cover' class to templates that have issues with profile images streatching 2022-01-25 20:30:35 +13:00
fd15989346 Merge pull request #599 from adamantike/allow-links-for-awards-and-certs
Allow links for certifications
2022-01-10 08:42:35 +01:00
fd00a4b4e1 Merge pull request #601 from mupsys/remove_dup_address_onyx
Added new ContactE without the address block and added it to the Onyx…
2022-01-10 07:50:12 +01:00
30d567d853 Added new ContactE without the address block and added it to the Onyx template (removes the duplicate address in that template.)
Signed-off-by: mupsys <1337sword@protonmail.com>
2022-01-09 23:03:35 -07:00
a9d1f0fa7b Revert changes to awards 2022-01-09 17:15:24 -03:00
3be316e9dd Allow links for awards and certifications
Add option to set a URL for each award or certification. This is useful,
for example, when sharing verified certificates as proofs provided by
issuers.

Fixes #575
2022-01-09 14:31:58 -03:00
2426144d1b Merge pull request #580 from AmruthPillai/l10n_develop
New Crowdin updates
2021-11-01 10:25:36 +01:00
c04367b7b5 New translations en.json (Croatian) 2021-10-30 13:49:08 +02:00
59828140ee Merge pull request #579 from AmruthPillai/l10n_develop
New Crowdin updates
2021-10-26 16:58:35 +02:00
8b12d366f9 New translations en.json (Croatian) 2021-10-26 01:04:26 +02:00
725 changed files with 35488 additions and 84544 deletions

View File

@ -1,4 +1,21 @@
.cache/
node_modules/
functions/
public/
# Build Artifacts
dist
.next
# IDEs
.vscode
# Project Metadata
README.md
CHANGELOG.md
# Project Dependencies
node_modules
# Docker
Dockerfile
.dockerignore
docker-compose.yml
# Android App
/app

8
.editorconfig Normal file
View File

@ -0,0 +1,8 @@
root = true
[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

View File

@ -1,8 +1,30 @@
FIREBASE_APIKEY=""
FIREBASE_APPID=""
FIREBASE_AUTHDOMAIN=""
FIREBASE_DATABASEURL=""
FIREBASE_MEASUREMENTID=""
FIREBASE_MESSAGINGSENDERID=""
FIREBASE_PROJECTID=""
FIREBASE_STORAGEBUCKET=""
# App
TZ=UTC
SECRET_KEY=change-me
# URLs
PUBLIC_URL=http://localhost:3000
PUBLIC_SERVER_URL=http://localhost:3100
# Database
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DATABASE=reactive_resume
POSTGRES_SSL_CERT=
# Auth
JWT_SECRET=change-me
JWT_EXPIRY_TIME=604800
# Google
PUBLIC_GOOGLE_CLIENT_ID=change-me
GOOGLE_CLIENT_SECRET=change-me
GOOGLE_API_KEY=change-me
# SendGrid (Optional)
SENDGRID_API_KEY=
SENDGRID_FORGOT_PASSWORD_TEMPLATE_ID=
SENDGRID_FROM_NAME=
SENDGRID_FROM_EMAIL=

View File

@ -1,4 +0,0 @@
.cache
package.json
package-lock.json
public

View File

@ -1,36 +0,0 @@
{
"globals": {
"atob": true,
"Blob": true,
"fetch": true,
"window": true,
"document": true,
"FileReader": true,
"localStorage": true
},
"extends": [
"airbnb",
"plugin:jest/recommended",
"plugin:jest/style",
"prettier"
],
"plugins": ["jest", "prettier", "sort-imports-es6-autofix"],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"jsx-a11y/label-has-associated-control": 0,
"react/jsx-one-expression-per-line": 0,
"react/jsx-props-no-spreading": 0,
"prettier/prettier": ["error"],
"react/no-array-index-key": 0,
"jsx-a11y/anchor-is-valid": 0,
"react/button-has-type": 0,
"no-unused-expressions": 0,
"no-restricted-syntax": 0,
"no-param-reassign": 0,
"consistent-return": 0,
"no-nested-ternary": 0,
"react/prop-types": 0,
"no-plusplus": 0
}
}

38
.eslintrc.json Normal file
View File

@ -0,0 +1,38 @@
{
"root": true,
"ignorePatterns": ["/app"],
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"plugins": ["@typescript-eslint/eslint-plugin", "simple-import-sort", "unused-imports"],
"rules": {
// TypeScript ESLint
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
// Simple Import Sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
// Unused Imports
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "none",
"argsIgnorePattern": "^_"
}
]
},
"overrides": [
{
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
}

View File

@ -1,14 +0,0 @@
{
"projects": {
"default": "rx-resume"
},
"targets": {
"rx-resume": {
"hosting": {
"rxresume": [
"public"
]
}
}
}
}

3
.github/FUNDING.yml vendored
View File

@ -1,3 +0,0 @@
# These are supported funding model platforms
custom: ['buymeacoffee.com/AmruthPillai']

38
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@ -0,0 +1,38 @@
---
name: Bug Report
about: Create a report to help improve
title: "[BUG] "
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature Request
about: Suggest an idea for this project
title: "[FEATURE] "
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

16
.github/workflows/close-stale.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '0 0 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5.0.0
with:
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity. Remove the stale label or comment on this PR, otherwise it would be closed in 5 days.'
stale-issue-message: 'This issue is stale because it has been open for 30 days with no activity. Remove the stale label or comment on this issue, otherwise it would be closed in 5 days.'
days-before-stale: 30
days-before-close: 5

View File

@ -1,34 +0,0 @@
name: CodeQL Analysis
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
schedule:
- cron: '37 16 * * 0'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@ -0,0 +1,21 @@
name: Deploy Latest Version on DigitalOcean
on:
workflow_run:
workflows:
- Build and Push Docker Image
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install DigitalOcean CLI
uses: digitalocean/action-doctl@v2.1.0
with:
token: ${{ secrets.DIGITALOCEAN_TOKEN }}
- name: Create Deployment with Latest Version
run: doctl apps create-deployment ${{ secrets.DIGITALOCEAN_APP_ID }} --wait --force-rebuild

120
.github/workflows/docker-build-push.yml vendored Normal file
View File

@ -0,0 +1,120 @@
name: Build and Push Docker Image
on:
release:
types: [published]
jobs:
docker_client:
name: Docker (Client)
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.0.0
- id: version
name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Login to Docker
uses: docker/login-action@v1.14.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Client Image
uses: docker/build-push-action@v2.9.0
with:
context: .
push: true
file: client/Dockerfile
tags: |
amruthpillai/reactive-resume:client-latest
amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }}
docker_server:
name: Docker (Server)
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.0.0
- id: version
name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Login to Docker
uses: docker/login-action@v1.14.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Server Image
uses: docker/build-push-action@v2.9.0
with:
context: .
push: true
file: server/Dockerfile
tags: |
amruthpillai/reactive-resume:server-latest
amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }}
github_client:
name: GitHub (Client)
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.0.0
- id: version
name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1.14.1
with:
registry: ghcr.io
username: $GITHUB_REPOSITORY_OWNER
password: ${{ secrets.GH_TOKEN }}
- name: Build and Push Client Image
uses: docker/build-push-action@v2.9.0
with:
context: .
push: true
file: client/Dockerfile
tags: |
ghcr.io/amruthpillai/reactive-resume:client-latest
ghcr.io/amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }}
github_server:
name: GitHub (Server)
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.0.0
- id: version
name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1.14.1
with:
registry: ghcr.io
username: $GITHUB_REPOSITORY_OWNER
password: ${{ secrets.GH_TOKEN }}
- name: Build and Push Server Image
uses: docker/build-push-action@v2.9.0
with:
context: .
push: true
file: server/Dockerfile
tags: |
ghcr.io/amruthpillai/reactive-resume:server-latest
ghcr.io/amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }}

View File

@ -1,27 +0,0 @@
name: Run Unit Tests
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test

80
.gitignore vendored
View File

@ -1,76 +1,10 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Coverage directory used by Jest
test-coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# dotenv environment variable files
# Environment Variables
.env
.env.*
!.env.example
# gatsby files
.cache/
public
# Project Dependencies
node_modules
# Firebase Files
.firebase
# Mac files
.DS_Store
# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
# macOS
.DS_Store

1
.husky/.gitignore vendored
View File

@ -1 +0,0 @@
_

View File

@ -1,4 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
pnpm install
pnpm run lint
pnpm run format

5
.idea/.gitignore generated vendored
View File

@ -1,5 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,58 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<HTMLCodeStyleSettings>
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
<option name="HTML_ENFORCE_QUOTES" value="true" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<VueCodeStyleSettings>
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
</VueCodeStyleSettings>
<codeStyleSettings language="HTML">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Vue">
<option name="SOFT_MARGINS" value="80" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View File

@ -1,7 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

8
.idea/modules.xml generated
View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Reactive-Resume.iml" filepath="$PROJECT_DIR$/.idea/Reactive-Resume.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated
View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

2
.nvmrc
View File

@ -1 +1 @@
16
lts/*

View File

@ -1,4 +1,32 @@
.cache
package.json
package-lock.json
public
# Schema
schema/dist
# Server
server/dist
# Client
client/.next
client/public/__ENV.js
# IDEs
.vscode
# Project Metadata
LICENSE
README.md
CHANGELOG.md
# Project Dependencies
node_modules
# Docker
Dockerfile
.dockerignore
docker-compose.yml
# Android App
/app
# Docs
docs/build
docs/.docusaurus

View File

@ -1,5 +1,4 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all"
"printWidth": 120,
"singleQuote": true
}

3
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "lokalise.i18n-ally"]
}

26
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Debug: Server",
"port": 9229,
"restart": true,
"stopOnEntry": false,
"protocol": "inspector"
},
{
"name": "Debug: Client",
"type": "node-terminal",
"request": "launch",
"command": "pnpm run dev:client",
"console": "integratedTerminal",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
}

28
.vscode/settings.json vendored
View File

@ -1,11 +1,25 @@
{
"files.associations": {
"*.js": "javascriptreact"
},
"css.validate": false,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll.eslint": true
},
"i18n-ally.localesPaths": ["src/i18n/locales"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"eslint.workingDirectories": [
"schema",
"client",
"server"
],
"i18n-ally.enabledFrameworks": [
"react"
],
"i18n-ally.keystyle": "nested",
"css.validate": false
}
"i18n-ally.localesPaths": [
"client/public/locales"
],
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
"i18n-ally.sortKeys": true,
"scss.validate": false
}

28
CHANGELOG.md Normal file
View File

@ -0,0 +1,28 @@
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [3.0.0](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.0.0-beta.6...v3.0.0) (2022-03-11)
### Features
* **lang**: add German, Kannada and Tamil languages to the app ([3a524f9](https://github.com/AmruthPillai/Reactive-Resume/commit/3a524f9c9c7a0e446491265b2242ad3dfeae188c))
* **docs:** add docusaurus workspace, initial setup of docs ([dc4aa0b](https://github.com/AmruthPillai/Reactive-Resume/commit/dc4aa0b496096bd59c45426bfcea6ba7db5f5c01))
## [3.0.0-beta.6](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2022-03-11)
### Features
* **lang:** add language switcher on the landing page, in the footer ([8bc7d25](https://github.com/AmruthPillai/Reactive-Resume/commit/8bc7d2599ef6af7a07bfbe886c43844152b0d9f7))
### Bug Fixes
* **i18n:** add missing translation keys, update lang/locale logic ([7d8828a](https://github.com/AmruthPillai/Reactive-Resume/commit/7d8828a358d653bb162877a64c75028eb82678cd))
* **webkit:** fix issue with webkit not supporting .at() ([2654cba](https://github.com/AmruthPillai/Reactive-Resume/commit/2654cba039eb73d33257c36fa90a52cabc9fda96))
## [3.0.0-beta.5](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2022-03-10)
### Bug Fixes
* **app:** fix issue with using swipelayout ([972e8b1](https://github.com/AmruthPillai/Reactive-Resume/commit/972e8b1bcf9ad44d8915bf23d189711672937bc0))

View File

@ -1,65 +0,0 @@
# Deployment
This is a guide on how to build the source from scratch, along with setting up Firebase and related cloud functions to be able to export PDFs just like the original deployment of [rxresu.me](http://rxresu.me/).
### Requirements
- A Firebase project
- Works on both Linux, macOS and Windows
- Requires Node.js & NPM installed on the machine
### Setting up Firebase
1. Create a new Firebase project by visiting [Firebase Console](https://console.firebase.google.com/) and clicking on `Add Project`
![Screenshot 2021-03-13 at 10 19 10 AM](https://user-images.githubusercontent.com/1134738/111019495-97a73800-83e5-11eb-9eb1-6da100d839ba.png)
2. Disable Google Analytics, or keep it enabled as per your requirements. Most people wouldn't need it.
![Screenshot 2021-03-13 at 10 19 23 AM](https://user-images.githubusercontent.com/1134738/111019521-bc9bab00-83e5-11eb-9365-e521577e7a90.png)
3. Wait until Project is created, then click on Continue
![Screenshot 2021-03-13 at 10 21 30 AM](https://user-images.githubusercontent.com/1134738/111019543-e5bc3b80-83e5-11eb-923f-fc4fb2c6d84f.png)
4. Navigate to Realtime Database, and click on `Create Database`
![Screenshot 2021-03-13 at 10 28 57 AM](https://user-images.githubusercontent.com/1134738/111019691-f02b0500-83e6-11eb-9112-c3123273d035.png)
5. Select any location that's nearby to you, and most importantly, create the database in `Test Mode` and click on Enable
![Screenshot 2021-03-13 at 10 30 01 AM](https://user-images.githubusercontent.com/1134738/111019724-16e93b80-83e7-11eb-9713-06a7adf0c5d4.png)
6. Go back to Project Overview and click on `Web` and skip through every other step by clicking `Next`.
![Screenshot 2021-03-13 at 10 27 34 AM](https://user-images.githubusercontent.com/1134738/111019839-b4446f80-83e7-11eb-9fe2-183b06f6f829.png)
7. Copy configuration variables of your project, or keep this page open as you will need it later
![ezgif com-gif-maker](https://user-images.githubusercontent.com/1134738/111019829-9d9e1880-83e7-11eb-8ccc-573db1039b10.gif)
### Cloning the Repository
1. Run this command on your machine's terminal or Command Prompt
```
git clone git@github.com:AmruthPillai/Reactive-Resume.git
```
<img width="550" alt="Screenshot 2021-03-13 at 10 38 16 AM" src="https://user-images.githubusercontent.com/1134738/111019919-3df43d00-83e8-11eb-8d6b-d9fe0cc74a3a.png">
2. Copy the file `.env.example` to `.env` and start editing the file
```
cp .env.example .env
```
<img width="317" alt="Screenshot 2021-03-13 at 10 50 21 AM" src="https://user-images.githubusercontent.com/1134738/111020166-ed7ddf00-83e9-11eb-9cbb-a8732243bbd5.png">
3. Copy configuration variables from last step to the .env file, it's fine to have `FIREBASE_MEASUREMENTID` empty if you had Google Analytics disabled.
<img width="696" alt="Screenshot 2021-03-13 at 10 51 53 AM" src="https://user-images.githubusercontent.com/1134738/111020217-3c2b7900-83ea-11eb-801d-d8719cf23608.png">
4. Run `npm install` on the terminal/command prompt
5. After that's done, run `npm run build` and allow some time for the process to build

View File

@ -1,38 +0,0 @@
FROM node:alpine as builder
WORKDIR /app
RUN apk add --update --no-cache \
g++ \
yasm \
bash \
make \
automake \
autoconf \
libtool \
zlib-dev \
libpng-dev
RUN apk add --update --no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/community \
--repository http://dl-3.alpinelinux.org/alpine/edge/main \
vips-dev
COPY package*.json ./
RUN npm ci
ARG FIREBASE_APIKEY
ARG FIREBASE_APPID
ARG FIREBASE_AUTHDOMAIN
ARG FIREBASE_DATABASEURL
ARG FIREBASE_MEASUREMENTID
ARG FIREBASE_MESSAGINGSENDERID
ARG FIREBASE_PROJECTID
ARG FIREBASE_STORAGEBUCKET
COPY . ./
RUN npm run build
FROM nginx:alpine
RUN rm -rf /usr/share/nginx/html
COPY --from=builder /app/public/ /usr/share/nginx/html
COPY server.conf /etc/nginx/conf.d/default.conf

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 Amruth Pillai
Copyright (c) 2022 Amruth Pillai
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

159
README.md
View File

@ -1,138 +1,95 @@
<img src="https://raw.githubusercontent.com/AmruthPillai/Reactive-Resume/develop/static/images/logo.png" width="256px" />
<img src="https://i.imgur.com/pc8Ingg.png" alt="Reactive Resume" width="256px" height="256px" />
## A free and open source resume builder.
# Reactive Resume
[![Crowdin](https://badges.crowdin.net/reactive-resume/localized.svg)](https://crowdin.com/project/reactive-resume)
[![GitHub](https://img.shields.io/github/license/AmruthPillai/Reactive-Resume)](https://github.com/AmruthPillai/Reactive-Resume/blob/develop/LICENSE)
![Project Version](https://img.shields.io/github/package-json/v/AmruthPillai/Reactive-Resume?style=flat-square)
![Project License](https://img.shields.io/github/license/AmruthPillai/Reactive-Resume?style=flat-square)
[![Docker Pulls](https://img.shields.io/docker/pulls/amruthpillai/reactive-resume?style=flat-square)](https://hub.docker.com/r/amruthpillai/reactive-resume)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FAmruthPillai%2FReactive-Resume.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FAmruthPillai%2FReactive-Resume?ref=badge_shield)
### [Go to App](https://rxresu.me/)
### What is this app all about?
## [Go to App](https://rxresu.me) | [Docs](https://docs.rxresu.me)
Reactive Resume is a free and open source resume builder thats built to make the mundane tasks of creating, updating and sharing your resume as easy as 1, 2, 3. With this app, you can create multiple resumes, share them with recruiters through a unique link and print as PDF, all for free, no advertisements, without losing the integrity and privacy of your data.
You have complete control over what goes into your resume, how it looks, what colors, what templates, even the layout in which sections placed. Want a dark mode resume? Its as easy as editing 3 values and youre done. You dont need to wait to see your changes either. Everything you type, everything you change, appears immediately on your resume and gets updated in real time.
### Features
## Features
- Manage multiple resumes with one account
- Free, forever
- No Advertising
- No User Tracking
- Sync your data across devices
- Sign in with Google, or sign in anonymously just to test the app
- Accessible in multiple languages
- Import data from [LinkedIn](https://www.linkedin.com/), [JSON Resume](https://jsonresume.org/)
- Manage multiple resumes with one account
- Open Source (with large community support)
- Send your resume to others with a unique sharable link
- Pick any font from [Google Fonts](https://fonts.google.com/) to use on your resume
- Choose from 6 vibrant templates and more coming soon
- Structure sections and change layouts the way you want to
- Rename sections according to your language/industry
- Export your resume to JSON or PDF format with just one click
- Create an account using your email, or just Sign in with Google
- Mix and match colors to any degree, even a dark mode resume?
- Pick from a variety of crisp and clear fonts
- Easy to translate to your own language
- Import your existing [JSON Resume](https://jsonresume.org/) in one click
- No advertisements, no data sharing, no marketing emails
- **Everything is free, and theres no catch!**
- Add sections, add pages and change layouts the way you want to
- Tailor-made Backend and Database, isolated from Google, Amazon etc.
- **Oh, and did I mention that it's free?**
### Screenshots
## Languages
<img src="https://raw.githubusercontent.com/AmruthPillai/Reactive-Resume/develop/static/images/screenshots/screen-1.png" width="400px" />
&nbsp;
<img src="https://raw.githubusercontent.com/AmruthPillai/Reactive-Resume/develop/static/images/screenshots/screen-3.png" width="400px" />
&nbsp;
<img src="https://raw.githubusercontent.com/AmruthPillai/Reactive-Resume/develop/static/images/screenshots/screen-5.png" width="400px" />
### Translation
To translate the app, just fork the repository, go to `src/i18n/locales` and duplicate the `en.json` file to a new file `your-lang-code.json` and translate all of the strings inside. It's a simple process that would take just a few minutes, and by contributing, your name could also be added down below as a contributor.
For those of you familiar with the Crowdin Platform, you could do that too and just head to http://crowdin.com/project/reactive-resume/ to translate the app over there. They have a great interface that helps you navigate through various strings and manage translations.
##### Languages Currently Supported
- Arabic (عربى)
- Bengali (বাংলা)
- Czech (čeština)
- Chinese Simplified (简体中文)
- Danish (Dansk)
- Dutch (Nederlands)
- English (US)
- Finnish (Suomalainen)
- French (Français)
- English
- German (Deutsch)
- Greek (Ελληνικά)
- Hebrew (עִברִית)
- Hindi (हिंदी)
- Indonesian (Bahasa Indonesia)
- Italian (Italiano)
- Japanese (日本人)
- Kannada (ಕನ್ನಡ)
- Lithuanian (Lietuvių)
- Norwegian (Norsk)
- Persian (Farsi)
- Polish (Polskie)
- Portuguese (Brazilian)
- Portuguese (Portugal)
- Romanian (Română)
- Russian (русский)
- Slovak (Slovenčina)
- Spanish (Español)
- Swedish (Svenska)
- Turkish (Türkçe)
- Ukrainian (Українська)
- Hindi (हिन्दी)
- Kannada (ಕನ್ನಡ) (@aksh1251)
- Tamil (தமிழ்)
Thank you to all the amazing people who have contributed to Reactive Resume by translating it into their native language.
Help by [translating Reactive Resume](https://translate.rxresu.me) to your language!
### Building from Source
## Tutorial
Want to run your own instance of Reactive Resume? You are very much free to do so. The requirements to build from source are:
The docs include an extensive [Tutorial](https://docs.rxresu.me/tutorial) section which outline the features of Reactive Resume and help you through building your first resume on the app.
- NodeJS/NPM
- A Firebase Project
## Build from Source
1. First, clone this project repository
For extensive information on how to build the app on your local machine, head over to the docs's [Source Code](https://docs.rxresu.me/source-code) section.
```
git clone https://github.com/AmruthPillai/Reactive-Resume.git
cd Reactive-Resume
```
## Contributing
2. Run npm install to install dependencies for the project
This project makes use of [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) style and workflow for commit messages to ensure that the CHANGELOG is auto-generated. In general, this project follows the "fork-and-pull" Git workflow.
```
npm install
```
1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull Request** so that we can review your changes
3. Create a `.env` file and fill it with your Firebase credentials
NOTE: Be sure to merge the latest from `main` before making a pull request!
You can get these by setting up a firebase web app [here](https://console.firebase.google.com/u/0/).
## Bugs? Feature Requests?
Also note that you'll need to set up a Realtime Database, _not_ a Firestore Database, to get the correct value for `FIREBASE_DATABASEURL`. Be sure to set it to test mode so you can read/write data. Just remember to either revert these or remove the database after your testing is completed.
Use the [GitHub Issues](https://github.com/AmruthPillai/Reactive-Resume/issues/new/choose) platform to notify me about bugs or new features that you would like to see in Reactive Resume. Please check before creating new issues as there might already be one.
```
FIREBASE_APIKEY=""
FIREBASE_APPID=""
FIREBASE_AUTHDOMAIN=""
FIREBASE_DATABASEURL=""
FIREBASE_MEASUREMENTID=""
FIREBASE_MESSAGINGSENDERID=""
FIREBASE_PROJECTID=""
FIREBASE_STORAGEBUCKET=""
```
## Donations
4. Run `npm run start` to run the development server or `npm run build` to build the production app.
Reactive Resume would be nothing without the folks who supported me and kept the project alive in the beginning, and your cotinued support is what keeps me going. If you found Reactive Resume to be useful, helpful or just insightful and appreciate the effort I took to make the project, please consider donating as little or as much as your can.
And that's it! 🎉
### [☕️ Buy me a coffee](https://www.buymeacoffee.com/AmruthPillai) | [💸 PayPal](https://paypal.me/RajaRajanA)
### Donation
## Infrastructure
I try to do what I can, but if you found the app helpful, or you're in a better position than the others who depend on this project for their first job, please consider donating as little as \$5 to help keep the project alive :)
- [Next.js](https://nextjs.org/), frontend
- [NestJS](https://nestjs.com/), backend
- [PostgreSQL](https://www.postgresql.org/), database
- [DigitalOcean](https://www.digitalocean.com/), infrastructure provider
- [Crowdin](https://translate.rxresu.me/), translation management platform
#### https://www.buymeacoffee.com/AmruthPillai
&nbsp;
![Please buy me a coffee](https://i.imgur.com/x7g6kvF.png)
<a href="https://pillai.xyz/digitalocean">
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.svg" width="200px" />
</a>
### Appreciation
## License
Thank you to everyone who made this project possible, including the many users who voiced their opinions, created issues and PRs to the original Reactive Resume project, and helped me along the way to make this a reality.
Reactive Resume is packaged and distributed using the [MIT License](https://choosealicense.com/licenses/mit/) which allows for commercial use, distribution, modification and private use provided that all copies of the software contain the same license and copyright.
---
![The Great Gatsby](https://camo.githubusercontent.com/a615c7e1ef9a850f5427cdc153186763305bb853/68747470733a2f2f692e696d6775722e636f6d2f4472386a3569762e676966)
###### Made with Love by [Amruth Pillai](https://amruthpillai.com/)
_By the community, for the community._
A passion project by [Amruth Pillai](https://amruthpillai.com/)

View File

@ -1,12 +0,0 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 2.0.0 | :white_check_mark: |
| 1.0.0 | :x: |
## Reporting a Vulnerability
Use the [GitHub Issues](https://github.com/AmruthPillai/Reactive-Resume/issues) tab to report a vulnerability

View File

@ -1,17 +0,0 @@
import { delay } from '../../src/utils/index';
const ReachRouter = jest.requireActual('@reach/router');
const defaultDelayInMilliseconds = 100;
// eslint-disable-next-line no-unused-vars
const navigate = async (to, options) => {
await delay(defaultDelayInMilliseconds);
return Promise.resolve();
};
module.exports = {
...ReachRouter,
navigate: jest.fn(navigate),
};

View File

@ -1,35 +0,0 @@
import FirebaseStub, { AuthConstants } from '../../gatsby-plugin-firebase';
test('sets current user to anonymous user 1', async () => {
await FirebaseStub.auth().signInAnonymously();
const { currentUser } = FirebaseStub.auth();
expect(currentUser).toBeTruthy();
expect(currentUser.uid).toEqual(AuthConstants.anonymousUser1.uid);
});
test('calls onAuthStateChanged observer with anonymous user 1', async () => {
let user = null;
let error = null;
FirebaseStub.auth().onAuthStateChanged(
(_user) => {
user = _user;
},
(_error) => {
error = _error;
},
);
await FirebaseStub.auth().signInAnonymously();
expect(user).toBeTruthy();
expect(user.uid).toEqual(AuthConstants.anonymousUser1.uid);
expect(error).toBeNull();
});
test('returns anonymous user 1', async () => {
const user = await FirebaseStub.auth().signInAnonymously();
expect(user).toBeTruthy();
expect(user.uid).toEqual(AuthConstants.anonymousUser1.uid);
});

View File

@ -1,54 +0,0 @@
import FirebaseStub, { AuthConstants } from '../../gatsby-plugin-firebase';
describe('with Google auth provider', () => {
test('sets current user to Google user 3', async () => {
await FirebaseStub.auth().signInWithPopup(
new FirebaseStub.auth.GoogleAuthProvider(),
);
const { currentUser } = FirebaseStub.auth();
expect(currentUser).toBeTruthy();
expect(currentUser.uid).toEqual(AuthConstants.googleUser3.uid);
});
test('sets current user provider data', async () => {
const provider = new FirebaseStub.auth.GoogleAuthProvider();
await FirebaseStub.auth().signInWithPopup(provider);
const { currentUser } = FirebaseStub.auth();
expect(currentUser).toBeTruthy();
expect(currentUser.providerData).toBeTruthy();
expect(currentUser.providerData).toHaveLength(1);
expect(currentUser.providerData[0].providerId).toEqual(provider.providerId);
});
test('calls onAuthStateChanged observer with Google user 3', async () => {
let user = null;
let error = null;
FirebaseStub.auth().onAuthStateChanged(
(_user) => {
user = _user;
},
(_error) => {
error = _error;
},
);
await FirebaseStub.auth().signInWithPopup(
new FirebaseStub.auth.GoogleAuthProvider(),
);
expect(user).toBeTruthy();
expect(user.uid).toEqual(AuthConstants.googleUser3.uid);
expect(error).toBeNull();
});
test('returns Google user 3', async () => {
const user = await FirebaseStub.auth().signInWithPopup(
new FirebaseStub.auth.GoogleAuthProvider(),
);
expect(user).toBeTruthy();
expect(user.uid).toEqual(AuthConstants.googleUser3.uid);
});
});

View File

@ -1,29 +0,0 @@
import FirebaseStub from '../../gatsby-plugin-firebase';
test('sets current user to null', async () => {
await FirebaseStub.auth().signInAnonymously();
await FirebaseStub.auth().signOut();
const { currentUser } = FirebaseStub.auth();
expect(currentUser).toBeNull();
});
test('calls onAuthStateChanged observer with null', async () => {
let user = null;
let error = null;
FirebaseStub.auth().onAuthStateChanged(
(_user) => {
user = _user;
},
(_error) => {
error = _error;
},
);
await FirebaseStub.auth().signInAnonymously();
await FirebaseStub.auth().signOut();
expect(user).toBeNull();
expect(error).toBeNull();
});

View File

@ -1,35 +0,0 @@
import FirebaseStub from '../../gatsby-plugin-firebase';
test('reuses existing Auth instance', () => {
const auth1 = FirebaseStub.auth();
const auth2 = FirebaseStub.auth();
expect(auth1.uuid).toBeTruthy();
expect(auth2.uuid).toBeTruthy();
expect(auth1.uuid).toEqual(auth2.uuid);
});
test('onAuthStateChanged unsubscribe removes observer', () => {
const observer = () => {};
const unsubscribe = FirebaseStub.auth().onAuthStateChanged(observer);
expect(unsubscribe).toBeTruthy();
expect(
FirebaseStub.auth().onAuthStateChangedObservers.indexOf(observer),
).toBeGreaterThanOrEqual(0);
unsubscribe();
expect(
FirebaseStub.auth().onAuthStateChangedObservers.indexOf(observer),
).not.toBeGreaterThanOrEqual(0);
});
test('current user delete calls signOut', async () => {
const mockSignOut = jest.spyOn(FirebaseStub.auth(), 'signOut');
await FirebaseStub.auth().signInAnonymously();
const { currentUser } = FirebaseStub.auth();
await currentUser.delete();
expect(mockSignOut).toHaveBeenCalledTimes(1);
});

View File

@ -1,53 +0,0 @@
import { waitFor } from '@testing-library/react';
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('can filter resumes by user', async () => {
FirebaseStub.database().initializeData();
let snapshotValue = null;
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo(DatabaseConstants.user1.uid)
.on('value', (snapshot) => {
snapshotValue = snapshot.val();
});
await waitFor(() =>
snapshotValue ? Promise.resolve(true) : Promise.reject(),
);
expect(snapshotValue).not.toBeNull();
expect(Object.keys(snapshotValue)).toHaveLength(2);
Object.values(snapshotValue).forEach((resume) =>
expect(resume.user).toEqual(DatabaseConstants.user1.uid),
);
});
test('previously set query parameters are not kept when retrieving reference again', () => {
FirebaseStub.database().initializeData();
let reference = null;
reference = FirebaseStub.database().ref(DatabaseConstants.resumesPath);
expect(reference).toBeTruthy();
const { uuid } = reference;
expect(reference.orderByChildPath).toHaveLength(0);
expect(reference.equalToValue).toHaveLength(0);
reference = FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo('testuser1');
expect(reference).toBeTruthy();
expect(reference.uuid).toBe(uuid);
expect(reference.orderByChildPath).toBe('user');
expect(reference.equalToValue).toBe('testuser1');
reference = FirebaseStub.database().ref(DatabaseConstants.resumesPath);
expect(reference).toBeTruthy();
expect(reference.uuid).toBe(uuid);
expect(reference.orderByChildPath).toHaveLength(0);
expect(reference.equalToValue).toHaveLength(0);
});

View File

@ -1,51 +0,0 @@
import { waitFor } from '@testing-library/react';
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('removes event callbacks', async () => {
FirebaseStub.database().initializeData();
const userUid = DatabaseConstants.user1.uid;
let valueCallbackSnapshotValue = null;
const valueCallback = jest.fn((snapshot) => {
valueCallbackSnapshotValue = snapshot.val();
});
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo(userUid)
.on('value', valueCallback);
await waitFor(() => valueCallback.mock.calls[0][0]);
valueCallback.mockClear();
valueCallbackSnapshotValue = null;
let childRemovedCallbackSnapshotValue = null;
const childRemovedCallback = jest.fn((snapshot) => {
childRemovedCallbackSnapshotValue = snapshot.val();
});
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo(userUid)
.on('child_removed', childRemovedCallback);
const removedResume = (
await FirebaseStub.database()
.ref(
`${DatabaseConstants.resumesPath}/${DatabaseConstants.demoStateResume1Id}`,
)
.once('value')
).val();
expect(removedResume).toBeTruthy();
FirebaseStub.database().ref(DatabaseConstants.resumesPath).off();
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${removedResume.id}`)
.remove();
expect(childRemovedCallback.mock.calls).toHaveLength(0);
expect(childRemovedCallbackSnapshotValue).toBeNull();
expect(valueCallback.mock.calls).toHaveLength(0);
expect(valueCallbackSnapshotValue).toBeNull();
});

View File

@ -1,45 +0,0 @@
import { waitFor } from '@testing-library/react';
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('triggers event with true if on the connected reference path', async () => {
FirebaseStub.database().initializeData();
let snapshotValue = null;
FirebaseStub.database()
.ref(DatabaseConstants.connectedPath)
.on('value', (snapshot) => {
snapshotValue = snapshot.val();
});
await waitFor(() =>
snapshotValue ? Promise.resolve(true) : Promise.reject(),
);
expect(snapshotValue).not.toBeNull();
expect(snapshotValue).toBe(true);
});
test('triggers event with resumes if on the resumes reference path', async () => {
FirebaseStub.database().initializeData();
const resumesDataSnapshot = await FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.once('value');
const resumes = resumesDataSnapshot.val();
let snapshotValue = null;
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.on('value', (snapshot) => {
snapshotValue = snapshot.val();
});
await waitFor(() =>
snapshotValue ? Promise.resolve(true) : Promise.reject(),
);
expect(snapshotValue).not.toBeNull();
expect(snapshotValue).toEqual(resumes);
});

View File

@ -1,59 +0,0 @@
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('retrieves resume if it exists', async () => {
FirebaseStub.database().initializeData();
const resumeId = DatabaseConstants.demoStateResume1Id;
const resume = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.once('value')
).val();
expect(resume).toBeTruthy();
expect(resume.id).toEqual(resumeId);
});
test('retrieves null if resume does not exist', async () => {
FirebaseStub.database().initializeData();
const resumeId = 'invalidResumeId';
const resume = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.once('value')
).val();
expect(resume).toBeNull();
});
test('retrieves user if it exists', async () => {
FirebaseStub.database().initializeData();
const expectedUser = DatabaseConstants.user1;
const user = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.usersPath}/${expectedUser.uid}`)
.once('value')
).val();
expect(user).toBeTruthy();
expect(user).toEqual(expectedUser);
});
test('retrieves null if user does not exist', async () => {
FirebaseStub.database().initializeData();
const userId = 'invalidUserId';
const user = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.usersPath}/${userId}`)
.once('value')
).val();
expect(user).toBeNull();
});

View File

@ -1,77 +0,0 @@
import { waitFor } from '@testing-library/react';
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('deletes data', async () => {
FirebaseStub.database().initializeData();
const resumeId = DatabaseConstants.demoStateResume1Id;
const removedResume = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.once('value')
).val();
expect(removedResume).toBeTruthy();
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.remove();
const actualResume = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.once('value')
).val();
expect(actualResume).toBeNull();
});
test('triggers events', async () => {
FirebaseStub.database().initializeData();
const userUid = DatabaseConstants.user1.uid;
let valueCallbackSnapshotValue = null;
const valueCallback = jest.fn((snapshot) => {
valueCallbackSnapshotValue = snapshot.val();
});
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo(userUid)
.on('value', valueCallback);
await waitFor(() => valueCallback.mock.calls[0][0]);
valueCallback.mockClear();
valueCallbackSnapshotValue = null;
let childRemovedCallbackSnapshotValue = null;
const childRemovedCallback = jest.fn((snapshot) => {
childRemovedCallbackSnapshotValue = snapshot.val();
});
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo(userUid)
.on('child_removed', childRemovedCallback);
const removedResume = (
await FirebaseStub.database()
.ref(
`${DatabaseConstants.resumesPath}/${DatabaseConstants.demoStateResume1Id}`,
)
.once('value')
).val();
expect(removedResume).toBeTruthy();
expect(removedResume.user).toEqual(userUid);
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${removedResume.id}`)
.remove();
await waitFor(() => childRemovedCallback.mock.calls[0][0]);
expect(childRemovedCallback.mock.calls).toHaveLength(1);
expect(childRemovedCallbackSnapshotValue).toBeTruthy();
expect(childRemovedCallbackSnapshotValue).toEqual(removedResume);
await waitFor(() => valueCallback.mock.calls[0][0]);
expect(valueCallback.mock.calls).toHaveLength(1);
expect(valueCallbackSnapshotValue).toBeTruthy();
expect(removedResume.id in valueCallbackSnapshotValue).toBe(false);
});

View File

@ -1,71 +0,0 @@
import { waitFor } from '@testing-library/react';
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('inserts data', async () => {
FirebaseStub.database().initializeData();
const existingResume = (
await FirebaseStub.database()
.ref(
`${DatabaseConstants.resumesPath}/${DatabaseConstants.demoStateResume1Id}`,
)
.once('value')
).val();
expect(existingResume).toBeTruthy();
const newResume = JSON.parse(JSON.stringify(existingResume));
newResume.id = 'newre1';
newResume.name = `Test Resume ${newResume.id}`;
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${newResume.id}`)
.set(newResume);
const actualResume = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${newResume.id}`)
.once('value')
).val();
expect(actualResume).toBeTruthy();
expect(actualResume).toEqual(newResume);
});
test('triggers events', async () => {
FirebaseStub.database().initializeData();
let snapshotValue = null;
const callback = jest.fn((snapshot) => {
snapshotValue = snapshot.val();
});
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo(DatabaseConstants.user1.uid)
.on('value', callback);
await waitFor(() => callback.mock.calls[0][0]);
callback.mockClear();
snapshotValue = null;
const existingResume = (
await FirebaseStub.database()
.ref(
`${DatabaseConstants.resumesPath}/${DatabaseConstants.demoStateResume1Id}`,
)
.once('value')
).val();
expect(existingResume).toBeTruthy();
const newResume = JSON.parse(JSON.stringify(existingResume));
newResume.id = 'newre1';
newResume.name = `Test Resume ${newResume.id}`;
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${newResume.id}`)
.set(newResume);
await waitFor(() => callback.mock.calls[0][0]);
expect(callback.mock.calls).toHaveLength(1);
expect(snapshotValue).not.toBeNull();
expect(Object.keys(snapshotValue)).toHaveLength(3);
expect(snapshotValue[newResume.id]).toBeTruthy();
expect(snapshotValue[newResume.id]).toEqual(newResume);
});

View File

@ -1,26 +0,0 @@
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('reuses existing Reference instance', () => {
const ref1 = FirebaseStub.database().ref(
`${DatabaseConstants.resumesPath}/123`,
);
const ref2 = FirebaseStub.database().ref(
`${DatabaseConstants.resumesPath}/123`,
);
expect(ref1).toBeTruthy();
expect(ref2).toBeTruthy();
expect(ref1).toEqual(ref2);
});
test('leading slash in reference path is ignored', () => {
const path = `${DatabaseConstants.resumesPath}/123`;
const ref1 = FirebaseStub.database().ref(path);
expect(ref1).toBeTruthy();
expect(ref1.path).toEqual(path);
const ref2 = FirebaseStub.database().ref(`/${path}`);
expect(ref2).toBeTruthy();
expect(ref2).toEqual(ref1);
});

View File

@ -1,86 +0,0 @@
import { waitFor } from '@testing-library/react';
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('can spy on it', async () => {
FirebaseStub.database().initializeData();
const referencePath = `${DatabaseConstants.resumesPath}/123456`;
const functionSpy = jest.spyOn(
FirebaseStub.database().ref(referencePath),
'update',
);
const updateArgument = 'test value 123';
await FirebaseStub.database().ref(referencePath).update(updateArgument);
expect(functionSpy).toHaveBeenCalledTimes(1);
const functionCallArgument = functionSpy.mock.calls[0][0];
expect(functionCallArgument).toBeTruthy();
expect(functionCallArgument).toEqual(updateArgument);
});
test('updates data', async () => {
FirebaseStub.database().initializeData();
const resumeId = DatabaseConstants.demoStateResume1Id;
const existingResume = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.once('value')
).val();
expect(existingResume).toBeTruthy();
const resumeName = 'Test Resume renamed';
existingResume.name = resumeName;
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.update(existingResume);
const actualResume = (
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${resumeId}`)
.once('value')
).val();
expect(actualResume).toBeTruthy();
expect(existingResume).toEqual(actualResume);
expect(actualResume.name).toEqual(resumeName);
});
test('triggers events', async () => {
FirebaseStub.database().initializeData();
let snapshotValue = null;
const callback = jest.fn((snapshot) => {
snapshotValue = snapshot.val();
});
FirebaseStub.database()
.ref(DatabaseConstants.resumesPath)
.orderByChild('user')
.equalTo(DatabaseConstants.user1.uid)
.on('value', callback);
await waitFor(() => callback.mock.calls[0][0]);
callback.mockClear();
snapshotValue = null;
const existingResume = (
await FirebaseStub.database()
.ref(
`${DatabaseConstants.resumesPath}/${DatabaseConstants.demoStateResume1Id}`,
)
.once('value')
).val();
expect(existingResume).toBeTruthy();
existingResume.name = 'Test Resume renamed';
await FirebaseStub.database()
.ref(`${DatabaseConstants.resumesPath}/${existingResume.id}`)
.update(existingResume);
await waitFor(() => callback.mock.calls[0][0]);
expect(callback.mock.calls).toHaveLength(1);
expect(snapshotValue).not.toBeNull();
expect(Object.keys(snapshotValue)).toHaveLength(2);
expect(snapshotValue[existingResume.id]).toBeTruthy();
expect(snapshotValue[existingResume.id]).toEqual(existingResume);
});

View File

@ -1,67 +0,0 @@
import FirebaseStub, { DatabaseConstants } from '../../gatsby-plugin-firebase';
test('reuses existing Database instance', () => {
const database1 = FirebaseStub.database();
const database2 = FirebaseStub.database();
expect(database1.uuid).toBeTruthy();
expect(database2.uuid).toBeTruthy();
expect(database1.uuid).toEqual(database2.uuid);
});
test('ServerValue.TIMESTAMP returns current time in milliseconds', () => {
const now = new Date().getTime();
const timestamp = FirebaseStub.database.ServerValue.TIMESTAMP;
expect(timestamp).toBeTruthy();
expect(timestamp).toBeGreaterThanOrEqual(now);
});
test('initializing data sets up resumes and users', async () => {
FirebaseStub.database().initializeData();
const resumesRef = FirebaseStub.database().ref(DatabaseConstants.resumesPath);
const resumesDataSnapshot = await resumesRef.once('value');
const resumes = resumesDataSnapshot.val();
expect(resumes).toBeTruthy();
expect(Object.keys(resumes)).toHaveLength(5);
const demoStateResume1 = resumes[DatabaseConstants.demoStateResume1Id];
expect(demoStateResume1).toBeTruthy();
expect(demoStateResume1.id).toEqual(DatabaseConstants.demoStateResume1Id);
expect(demoStateResume1.user).toEqual(DatabaseConstants.user1.uid);
const demoStateResume2 = resumes[DatabaseConstants.demoStateResume2Id];
expect(demoStateResume2).toBeTruthy();
expect(demoStateResume2.id).toEqual(DatabaseConstants.demoStateResume2Id);
expect(demoStateResume2.user).toEqual(DatabaseConstants.user2.uid);
const initialStateResume1 = resumes[DatabaseConstants.initialStateResume1Id];
expect(initialStateResume1).toBeTruthy();
expect(initialStateResume1.id).toEqual(
DatabaseConstants.initialStateResume1Id,
);
expect(initialStateResume1.user).toEqual(DatabaseConstants.user1.uid);
const demoStateResume3 = resumes[DatabaseConstants.demoStateResume3Id];
expect(demoStateResume3).toBeTruthy();
expect(demoStateResume3.id).toEqual(DatabaseConstants.demoStateResume3Id);
expect(demoStateResume3.user).toEqual(DatabaseConstants.user3.uid);
const initialStateResume2 = resumes[DatabaseConstants.initialStateResume2Id];
expect(initialStateResume2).toBeTruthy();
expect(initialStateResume2.id).toEqual(
DatabaseConstants.initialStateResume2Id,
);
expect(initialStateResume2.user).toEqual(DatabaseConstants.user3.uid);
const usersRef = FirebaseStub.database().ref(DatabaseConstants.usersPath);
const usersDataSnapshot = await usersRef.once('value');
const users = usersDataSnapshot.val();
expect(users).toBeTruthy();
expect(Object.keys(users)).toHaveLength(3);
const anonymousUser1 = users[DatabaseConstants.user1.uid];
expect(anonymousUser1).toBeTruthy();
expect(anonymousUser1).toEqual(DatabaseConstants.user1);
const anonymousUser2 = users[DatabaseConstants.user2.uid];
expect(anonymousUser2).toBeTruthy();
expect(anonymousUser2).toEqual(DatabaseConstants.user2);
const googleUser3 = users[DatabaseConstants.user3.uid];
expect(googleUser3).toBeTruthy();
expect(googleUser3).toEqual(DatabaseConstants.user3);
});

View File

@ -1,19 +0,0 @@
import FirebaseStub from '../../gatsby-plugin-firebase';
test('reuses existing Functions instance', () => {
const functions1 = FirebaseStub.functions();
const functions2 = FirebaseStub.functions();
expect(functions1.uuid).toBeTruthy();
expect(functions2.uuid).toBeTruthy();
expect(functions1.uuid).toEqual(functions2.uuid);
});
test('deleteUser function returns true', async () => {
const deleteUser = FirebaseStub.functions().httpsCallable('deleteUser');
const result = await deleteUser();
expect(result).toBeTruthy();
expect(result.data).toEqual(true);
});

View File

@ -1,2 +0,0 @@
const mockFile = 'test-file-stub';
export default mockFile;

View File

@ -1,33 +0,0 @@
import Auth from './gatsby-plugin-firebase/auth/auth';
import AuthConstants from './gatsby-plugin-firebase/constants/auth';
import Database from './gatsby-plugin-firebase/database/database';
import DatabaseConstants from './gatsby-plugin-firebase/constants/database';
import Functions from './gatsby-plugin-firebase/functions/functions';
import FunctionsConstants from './gatsby-plugin-firebase/constants/functions';
import GoogleAuthProvider from './gatsby-plugin-firebase/auth/googleAuthProvider';
class FirebaseStub {
static auth() {
return Auth.instance;
}
static database() {
return Database.instance;
}
static functions() {
return Functions.instance;
}
}
FirebaseStub.auth.GoogleAuthProvider = GoogleAuthProvider;
FirebaseStub.database.ServerValue = {};
Object.defineProperty(FirebaseStub.database.ServerValue, 'TIMESTAMP', {
get() {
return new Date().getTime();
},
});
export default FirebaseStub;
export { AuthConstants, DatabaseConstants, FunctionsConstants };

View File

@ -1,125 +0,0 @@
/* eslint-disable no-underscore-dangle */
import { v4 as uuidv4 } from 'uuid';
import { delay } from '../../../src/utils/index';
import AuthProvider from './authProvider';
import Constants from '../constants/auth';
import GoogleAuthProvider from './googleAuthProvider';
import User from './user';
const singleton = Symbol('');
const singletonEnforcer = Symbol('');
class Auth {
constructor(enforcer) {
if (enforcer !== singletonEnforcer) {
throw new Error('Cannot construct singleton');
}
this._uuid = uuidv4();
this._currentUser = null;
this._onAuthStateChangedObservers = [];
}
static get instance() {
if (!this[singleton]) {
this[singleton] = new Auth(singletonEnforcer);
}
return this[singleton];
}
get currentUser() {
return this._currentUser;
}
get uuid() {
return this._uuid;
}
get onAuthStateChangedObservers() {
return this._onAuthStateChangedObservers;
}
onAuthStateChanged(observer) {
this.onAuthStateChangedObservers.push(observer);
return () => {
this._onAuthStateChangedObservers =
this.onAuthStateChangedObservers.filter((obs) => obs !== observer);
};
}
async signInAnonymously() {
const user = Constants.anonymousUser1;
this._currentUser = new User(
user.displayName,
user.email,
user.providerId,
user.uid,
user.isAnonymous,
this.signOut.bind(this),
);
await delay(Constants.defaultDelayInMilliseconds);
this.onAuthStateChangedObservers.forEach((observer) =>
observer(this._currentUser),
);
return this._currentUser;
}
/**
* Authenticates with popup.
*
* @param {AuthProvider} provider The provider to authenticate.
*/
async signInWithPopup(provider) {
if (!provider) {
throw new Error('provider must be provided.');
} else if (!(provider instanceof AuthProvider)) {
throw new Error('provider should be an AuthProvider.');
}
if (!(provider instanceof GoogleAuthProvider)) {
throw new Error(
`${provider.constructor.name} is currently not supported.`,
);
}
const user = Constants.googleUser3;
this._currentUser = new User(
user.displayName,
user.email,
user.providerId,
user.uid,
user.isAnonymous,
this.signOut.bind(this),
);
await delay(Constants.defaultDelayInMilliseconds);
this.onAuthStateChangedObservers.forEach((observer) =>
observer(this._currentUser),
);
return this._currentUser;
}
async signOut() {
if (this._currentUser === null) {
return;
}
this._currentUser = null;
await delay(Constants.defaultDelayInMilliseconds);
this.onAuthStateChangedObservers.forEach((observer) => observer(null));
}
}
export default Auth;

View File

@ -1,23 +0,0 @@
/* eslint-disable no-underscore-dangle */
class AuthProvider {
/**
* Creates a new auth provider.
*
* @param {string} providerId Provider ID.
*/
constructor(providerId) {
if (!providerId) {
throw new Error('providerId must be provided.');
} else if (typeof providerId !== 'string') {
throw new Error('providerId should be a string.');
} else {
this._providerId = providerId;
}
}
get providerId() {
return this._providerId;
}
}
export default AuthProvider;

View File

@ -1,10 +0,0 @@
import AuthProvider from './authProvider';
import Constants from '../constants/auth';
class GoogleAuthProvider extends AuthProvider {
constructor() {
super(Constants.googleAuthProviderId);
}
}
export default GoogleAuthProvider;

View File

@ -1,67 +0,0 @@
/* eslint-disable no-underscore-dangle */
import Constants from '../constants/auth';
// eslint-disable-next-line no-unused-vars
import AuthProvider from './authProvider';
import UserInfo from './userInfo';
import { delay } from '../../../src/utils/index';
class User extends UserInfo {
/**
* Creates a new user.
*
* @param {string|null} displayName Display name.
* @param {string|null} email Email.
* @param {string} providerId Auth provider ID.
* @param {string} uid The user's unique ID.
* @param {boolean} isAnonymous Is anonymous.
* @param {function():Promise<void>} deleteUser Delete user callback.
*/
constructor(displayName, email, providerId, uid, isAnonymous, deleteUser) {
super(displayName, email, providerId, uid);
if (!deleteUser) {
throw new Error('deleteUser must be provided.');
} else if (typeof deleteUser !== 'function') {
throw new Error('deleteUser should be a function.');
} else {
this._deleteUser = deleteUser;
}
this._isAnonymous = isAnonymous;
this._providerData = [];
if (!isAnonymous) {
this._providerData.push(
new UserInfo(displayName, email, providerId, uid),
);
}
}
get isAnonymous() {
return this._isAnonymous;
}
get providerData() {
return this._providerData;
}
async delete() {
await delay(Constants.defaultDelayInMilliseconds);
await this._deleteUser();
}
/**
* Reauthenticates the user with popup.
*
* @param {AuthProvider} provider The provider to authenticate.
*/
// eslint-disable-next-line no-unused-vars
async reauthenticateWithPopup(provider) {
await delay(Constants.defaultDelayInMilliseconds);
return this;
}
}
export default User;

View File

@ -1,47 +0,0 @@
/* eslint-disable no-underscore-dangle */
class UserInfo {
/**
* Creates a new user profile information.
*
* @param {string|null} displayName Display name.
* @param {string|null} email Email.
* @param {string} providerId Auth provider ID.
* @param {string} uid The user's unique ID.
*/
constructor(displayName, email, providerId, uid) {
if (!uid) {
throw new Error('uid must be provided.');
} else if (typeof uid !== 'string') {
throw new Error('uid should be a string.');
} else {
this._uid = uid;
}
if (typeof providerId !== 'string') {
throw new Error('providerId should be a string.');
} else {
this._providerId = providerId;
}
this._displayName = displayName;
this._email = email;
}
get displayName() {
return this._displayName;
}
get email() {
return this._email;
}
get providerId() {
return this._providerId;
}
get uid() {
return this._uid;
}
}
export default UserInfo;

View File

@ -1,51 +0,0 @@
const googleAuthProviderId = 'google.com';
const anonymousUser1 = {
displayName: 'Anonymous User 1',
email: 'anonymous1@noemail.com',
isAnonymous: true,
providerId: '',
uid: 'anonym1',
};
const anonymousUser2 = {
displayName: 'Anonymous User 2',
email: 'anonymous2@noemail.com',
isAnonymous: true,
providerId: '',
uid: 'anonym2',
};
const googleUser3 = {
displayName: 'Google User 3',
email: 'google3@noemail.com',
isAnonymous: false,
providerId: googleAuthProviderId,
uid: 'google3',
};
const defaultDelayInMilliseconds = 100;
class Auth {
static get googleAuthProviderId() {
return googleAuthProviderId;
}
static get anonymousUser1() {
return anonymousUser1;
}
static get anonymousUser2() {
return anonymousUser2;
}
static get googleUser3() {
return googleUser3;
}
static get defaultDelayInMilliseconds() {
return defaultDelayInMilliseconds;
}
}
export default Auth;

View File

@ -1,89 +0,0 @@
import AuthConstants from './auth';
const valueEventType = 'value';
const childRemovedEventType = 'child_removed';
const resumesPath = 'resumes';
const usersPath = 'users';
const connectedPath = '.info/connected';
const demoStateResume1Id = 'demo_1';
const demoStateResume2Id = 'demo_2';
const demoStateResume3Id = 'demo_3';
const initialStateResume1Id = 'init_1';
const initialStateResume2Id = 'init_2';
const user1 = {
uid: AuthConstants.anonymousUser1.uid,
isAnonymous: AuthConstants.anonymousUser1.isAnonymous,
};
const user2 = {
uid: AuthConstants.anonymousUser2.uid,
isAnonymous: AuthConstants.anonymousUser2.isAnonymous,
};
const user3 = {
uid: AuthConstants.googleUser3.uid,
isAnonymous: AuthConstants.googleUser3.isAnonymous,
};
const defaultDelayInMilliseconds = 100;
class Database {
static get valueEventType() {
return valueEventType;
}
static get childRemovedEventType() {
return childRemovedEventType;
}
static get resumesPath() {
return resumesPath;
}
static get usersPath() {
return usersPath;
}
static get connectedPath() {
return connectedPath;
}
static get demoStateResume1Id() {
return demoStateResume1Id;
}
static get demoStateResume2Id() {
return demoStateResume2Id;
}
static get demoStateResume3Id() {
return demoStateResume3Id;
}
static get initialStateResume1Id() {
return initialStateResume1Id;
}
static get initialStateResume2Id() {
return initialStateResume2Id;
}
static get user1() {
return user1;
}
static get user2() {
return user2;
}
static get user3() {
return user3;
}
static get defaultDelayInMilliseconds() {
return defaultDelayInMilliseconds;
}
}
export default Database;

View File

@ -1,15 +0,0 @@
const deleteUserFunctionName = 'deleteUser';
const defaultDelayInMilliseconds = 100;
class Functions {
static get deleteUserFunctionName() {
return deleteUserFunctionName;
}
static get defaultDelayInMilliseconds() {
return defaultDelayInMilliseconds;
}
}
export default Functions;

View File

@ -1,24 +0,0 @@
/* eslint-disable no-underscore-dangle */
class DataSnapshot {
constructor(getData, value = undefined) {
if (!getData) {
throw new Error('getData must be provided.');
} else if (typeof getData !== 'function') {
throw new Error('getData should be a function.');
}
this._getData = getData;
this._value = value;
}
get value() {
return this._value;
}
val() {
return typeof this.value !== 'undefined' ? this.value : this._getData();
}
}
export default DataSnapshot;

View File

@ -1,170 +0,0 @@
/* eslint-disable no-underscore-dangle */
import { v4 as uuidv4 } from 'uuid';
import fs from 'fs';
import path from 'path';
import DatabaseConstants from '../constants/database';
import Reference from './reference';
const singleton = Symbol('');
const singletonEnforcer = Symbol('');
const readFile = (fileRelativePath) => {
const fileAbsolutePath = path.resolve(__dirname, fileRelativePath);
const fileBuffer = fs.readFileSync(fileAbsolutePath);
const fileData = JSON.parse(fileBuffer);
return fileData;
};
class Database {
constructor(enforcer) {
if (enforcer !== singletonEnforcer) {
throw new Error('Cannot construct singleton');
}
this._uuid = uuidv4();
this._data = {};
this._references = {};
}
static get instance() {
if (!this[singleton]) {
this[singleton] = new Database(singletonEnforcer);
}
return this[singleton];
}
get uuid() {
return this._uuid;
}
_getData(dataPath) {
if (!dataPath) {
throw new Error('dataPath must be provided.');
}
const dataPathElements = dataPath.split('/');
if (!(dataPathElements[0] in this._data)) {
return null;
}
if (dataPathElements.length === 1) {
return this._data[dataPathElements[0]];
}
if (dataPathElements.length === 2) {
if (!(dataPathElements[1] in this._data[dataPathElements[0]])) {
return null;
}
return this._data[dataPathElements[0]][dataPathElements[1]];
}
return null;
}
_getReference(referencePath) {
return referencePath in this._references
? this._references[referencePath]
: null;
}
_setData(dataPath, value) {
if (!dataPath) {
throw new Error('dataPath must be provided.');
}
if (typeof value === 'undefined') {
throw new Error('value is undefined.');
}
const dataPathElements = dataPath.split('/');
if (dataPathElements.length !== 2) {
return;
}
if (!(dataPathElements[0] in this._data)) {
return;
}
if (!dataPathElements[1]) {
return;
}
if (value === null) {
delete this._data[dataPathElements[0]][dataPathElements[1]];
} else {
this._data[dataPathElements[0]][dataPathElements[1]] = value;
}
}
initializeData() {
const resumes = {};
const date = new Date('December 15, 2020 11:20:25');
const demoStateResume1 = readFile('../../../src/data/demoState.json');
demoStateResume1.updatedAt = date.valueOf();
date.setMonth(date.getMonth() - 2);
demoStateResume1.createdAt = date.valueOf();
demoStateResume1.user = DatabaseConstants.user1.uid;
resumes[DatabaseConstants.demoStateResume1Id] = demoStateResume1;
const demoStateResume2 = JSON.parse(JSON.stringify(demoStateResume1));
demoStateResume2.user = DatabaseConstants.user2.uid;
resumes[DatabaseConstants.demoStateResume2Id] = demoStateResume2;
const initialStateResume1 = readFile('../../../src/data/initialState.json');
initialStateResume1.updatedAt = date.valueOf();
initialStateResume1.createdAt = date.valueOf();
initialStateResume1.user = DatabaseConstants.user1.uid;
resumes[DatabaseConstants.initialStateResume1Id] = initialStateResume1;
const demoStateResume3 = readFile('../../../src/data/demoState.json');
demoStateResume3.updatedAt = date.valueOf();
date.setMonth(date.getMonth() - 2);
demoStateResume3.createdAt = date.valueOf();
demoStateResume3.user = DatabaseConstants.user3.uid;
resumes[DatabaseConstants.demoStateResume3Id] = demoStateResume3;
const initialStateResume2 = readFile('../../../src/data/initialState.json');
initialStateResume2.updatedAt = date.valueOf();
initialStateResume2.createdAt = date.valueOf();
initialStateResume2.user = DatabaseConstants.user3.uid;
resumes[DatabaseConstants.initialStateResume2Id] = initialStateResume2;
Object.keys(resumes).forEach((key) => {
const resume = resumes[key];
resume.id = key;
resume.name = `Test Resume ${key}`;
});
this._data[DatabaseConstants.resumesPath] = resumes;
const users = {};
users[DatabaseConstants.user1.uid] = DatabaseConstants.user1;
users[DatabaseConstants.user2.uid] = DatabaseConstants.user2;
users[DatabaseConstants.user3.uid] = DatabaseConstants.user3;
this._data[DatabaseConstants.usersPath] = users;
}
ref(referencePath) {
const newRef = new Reference(
referencePath,
(dataPath) => this._getData(dataPath),
(dataPath, value) => this._setData(dataPath, value),
(refPath) => this._getReference(refPath),
);
const existingRef = this._getReference(newRef.path);
if (existingRef) {
existingRef.initializeQueryParameters();
return existingRef;
}
this._references[newRef.path] = newRef;
return newRef;
}
}
export default Database;

View File

@ -1,215 +0,0 @@
/* eslint-disable no-underscore-dangle */
import { v4 as uuidv4 } from 'uuid';
import { delay } from '../../../src/utils/index';
import DataSnapshot from './dataSnapshot';
import DatabaseConstants from '../constants/database';
const parsePath = (path) => {
if (!path) {
throw new Error('path must be provided.');
} else if (typeof path !== 'string') {
throw new Error('path should be a string.');
} else {
let parsedPath = path.trim();
if (parsedPath[0] === '/') {
parsedPath = parsedPath.substring(1);
}
return parsedPath;
}
};
class Reference {
constructor(path, getDatabaseData, setDatabaseData, getReference) {
this._path = parsePath(path);
this._uuid = uuidv4();
if (this.path === DatabaseConstants.connectedPath) {
this._dataSnapshot = new DataSnapshot(() => {}, true);
} else {
this._dataSnapshot = new DataSnapshot(() => this._getData());
}
if (!getDatabaseData) {
throw new Error('getDatabaseData must be provided.');
} else if (typeof getDatabaseData !== 'function') {
throw new Error('getDatabaseData should be a function.');
}
this._getDatabaseData = getDatabaseData;
if (!setDatabaseData) {
throw new Error('setDatabaseData must be provided.');
} else if (typeof getDatabaseData !== 'function') {
throw new Error('setDatabaseData should be a function.');
}
this._setDatabaseData = setDatabaseData;
if (!getReference) {
throw new Error('getReference must be provided.');
} else if (typeof getDatabaseData !== 'function') {
throw new Error('getReference should be a function.');
}
this._getReference = getReference;
this._eventCallbacks = {};
this.initializeQueryParameters();
}
get path() {
return this._path;
}
get uuid() {
return this._uuid;
}
get eventCallbacks() {
return this._eventCallbacks;
}
get orderByChildPath() {
return this._orderByChildPath;
}
get equalToValue() {
return this._equalToValue;
}
_getData() {
const databaseData = this._getDatabaseData(this.path);
if (!databaseData) {
return null;
}
if (this.orderByChildPath && this.equalToValue) {
return Object.fromEntries(
Object.entries(databaseData).filter(
([, value]) => value[this.orderByChildPath] === this.equalToValue,
),
);
}
return databaseData;
}
_getParent() {
const pathElements = this.path.split('/');
let parent = null;
if (pathElements.length === 2) {
parent = this._getReference(pathElements[0]);
}
return parent;
}
_handleDataUpdate(value) {
if (typeof value === 'undefined') {
throw new Error('value must be provided.');
}
const currentData = this._getData();
const parentReference = this._getParent();
this._setDatabaseData(this.path, value);
if (value === null) {
if (parentReference) {
parentReference.triggerEventCallback(
DatabaseConstants.childRemovedEventType,
currentData,
);
}
} else {
this.triggerEventCallback(DatabaseConstants.valueEventType);
}
if (parentReference) {
parentReference.triggerEventCallback(DatabaseConstants.valueEventType);
}
}
triggerEventCallback(eventType, snapshotValue = undefined) {
if (!(eventType in this.eventCallbacks)) {
return;
}
const snapshot =
this.path === DatabaseConstants.connectedPath
? this._dataSnapshot
: new DataSnapshot(() => this._getData(), snapshotValue);
this.eventCallbacks[eventType](snapshot);
}
equalTo(value) {
this._equalToValue = value;
return this;
}
initializeQueryParameters() {
this._orderByChildPath = '';
this._equalToValue = '';
}
off() {
this._eventCallbacks = {};
}
on(eventType, callback) {
this.eventCallbacks[eventType] = callback;
if (eventType === DatabaseConstants.valueEventType) {
setTimeout(() => {
this.triggerEventCallback(eventType);
}, DatabaseConstants.defaultDelayInMilliseconds);
}
return callback;
}
async once(eventType) {
if (!eventType) {
throw new Error('eventType must be provided.');
} else if (typeof eventType !== 'string') {
throw new Error('eventType should be a string.');
}
await delay(DatabaseConstants.defaultDelayInMilliseconds);
return this._dataSnapshot;
}
orderByChild(path) {
this._orderByChildPath = path;
return this;
}
async update(value) {
await delay(DatabaseConstants.defaultDelayInMilliseconds);
this._handleDataUpdate(value);
}
async remove() {
await delay(DatabaseConstants.defaultDelayInMilliseconds);
this._handleDataUpdate(null);
}
async set(value) {
await delay(DatabaseConstants.defaultDelayInMilliseconds);
this._handleDataUpdate(value);
}
}
export default Reference;

View File

@ -1,53 +0,0 @@
/* eslint-disable no-underscore-dangle */
import { v4 as uuidv4 } from 'uuid';
import FunctionsConstants from '../constants/functions';
import HttpsCallableResult from './httpsCallableResult';
import { delay } from '../../../src/utils/index';
const singleton = Symbol('');
const singletonEnforcer = Symbol('');
const deleteUser = async () => {
await delay(FunctionsConstants.defaultDelayInMilliseconds);
return new HttpsCallableResult(true);
};
class Functions {
constructor(enforcer) {
if (enforcer !== singletonEnforcer) {
throw new Error('Cannot construct singleton');
}
this._uuid = uuidv4();
this._httpsCallables = {};
this._httpsCallables[FunctionsConstants.deleteUserFunctionName] =
deleteUser;
}
static get instance() {
if (!this[singleton]) {
this[singleton] = new Functions(singletonEnforcer);
}
return this[singleton];
}
get uuid() {
return this._uuid;
}
httpsCallable(name) {
if (!name) {
throw new Error('name must be provided.');
} else if (typeof name !== 'string') {
throw new Error('name should be a string.');
}
return this._httpsCallables[name];
}
}
export default Functions;

View File

@ -1,19 +0,0 @@
/* eslint-disable no-underscore-dangle */
import { v4 as uuidv4 } from 'uuid';
class HttpsCallableResult {
constructor(data) {
this._uuid = uuidv4();
this._data = data;
}
get data() {
return this._data;
}
get uuid() {
return this._uuid;
}
}
export default HttpsCallableResult;

View File

@ -1,71 +0,0 @@
import React from 'react';
import { delay } from '../src/utils/index';
const Gatsby = jest.requireActual('gatsby');
const imageData = {
images: {
fallback: {
src: `image_src.jpg`,
srcSet: `image_src_set.jpg 1x`,
},
},
layout: `fixed`,
width: 1,
height: 2,
};
const childImageSharp = { gatsbyImageData: imageData };
const useStaticQuery = () => ({
site: {
siteMetadata: {
title: 'Test title',
description: 'Test description',
author: 'Test author',
siteUrl: 'https://testsiteurl/',
},
},
file: {
childImageSharp,
},
onyx: {
childImageSharp,
},
pikachu: {
childImageSharp,
},
gengar: {
childImageSharp,
},
castform: {
childImageSharp,
},
glalie: {
childImageSharp,
},
celebi: {
childImageSharp,
},
});
const defaultDelayInMilliseconds = 100;
const navigate = async () => {
await delay(defaultDelayInMilliseconds);
return Promise.resolve();
};
module.exports = {
...Gatsby,
graphql: jest.fn(),
Link: jest.fn().mockImplementation(({ to, ...rest }) =>
React.createElement('a', {
...rest,
href: to,
}),
),
navigate: jest.fn(navigate),
useStaticQuery,
};

33
app/.gitignore vendored Normal file
View File

@ -0,0 +1,33 @@
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
google-services.json
# Android Profiling
*.hprof

8
app/app/.editorconfig Normal file
View File

@ -0,0 +1,8 @@
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

2
app/app/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/build
/release

46
app/app/build.gradle Normal file
View File

@ -0,0 +1,46 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "me.rxresu.app"
minSdk 21
targetSdk 32
versionCode 2
versionName "1.0"
resConfigs "en"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'com.google.android.material:material:1.5.0'
}

21
app/app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.rxresu.app">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ReactiveResume.NoActionBar">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.ReactiveResume.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,76 @@
package me.rxresu.app
import android.annotation.SuppressLint
import android.graphics.Bitmap
import android.os.Bundle
import android.view.KeyEvent
import android.webkit.WebResourceError
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
private lateinit var webView: WebView
private var isLoaded: Boolean = false
private var webURL = "https://rxresu.me"
@SuppressLint("SetJavaScriptEnabled")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
webView = findViewById(R.id.webview)
webView.settings.javaScriptEnabled = true
webView.settings.userAgentString = "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Mobile Safari/537.36"
}
override fun onResume() {
if (!isLoaded) loadWebView()
super.onResume()
}
private fun loadWebView() {
webView.loadUrl(webURL)
webView.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
val url = request?.url.toString()
view?.loadUrl(url)
return super.shouldOverrideUrlLoading(view, request)
}
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
super.onPageStarted(view, url, favicon)
}
override fun onPageFinished(view: WebView?, url: String?) {
isLoaded = true
super.onPageFinished(view, url)
}
override fun onReceivedError(view: WebView, request: WebResourceRequest, error: WebResourceError) {
isLoaded = false
super.onReceivedError(view, request, error)
}
}
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (event.action == KeyEvent.ACTION_DOWN) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (webView.canGoBack()) {
webView.goBack()
}
return true
}
}
return super.onKeyDown(keyCode, event)
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<include
layout="@layout/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/webview"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

View File

@ -0,0 +1,3 @@
<resources>
<string name="app_name">Reactive Resume</string>
</resources>

View File

@ -0,0 +1,12 @@
<resources>
<style name="Theme.ReactiveResume" parent="Theme.MaterialComponents.DayNight.DarkActionBar" />
<style name="Theme.ReactiveResume.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.ReactiveResume.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.ReactiveResume.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

9
app/build.gradle Normal file
View File

@ -0,0 +1,9 @@
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}

23
app/gradle.properties Normal file
View File

@ -0,0 +1,23 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true

Some files were not shown because too many files have changed in this diff Show More