Skip to content

Commit

Permalink
- implement disable_email_auth env var
Browse files Browse the repository at this point in the history
- add sync crowdin translations github action
  • Loading branch information
AmruthPillai committed Nov 21, 2023
1 parent 635f743 commit 1825fc3
Show file tree
Hide file tree
Showing 84 changed files with 2,689 additions and 2,337 deletions.
9 changes: 6 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ REDIS_URL=redis://default:password@localhost:6379

# Crowdin (Optional)
CROWDIN_PROJECT_ID=
CROWDIN_ACCESS_TOKEN=
CROWDIN_PERSONAL_TOKEN=

# GitHub (OAuth, Optional) Uncomment to enable
# Email (Optional)
# DISABLE_EMAIL_AUTH=false

# GitHub (OAuth, Optional)
# GITHUB_CLIENT_ID=
# GITHUB_CLIENT_SECRET=
# GITHUB_CALLBACK_URL=http://localhost:5173/api/auth/github/callback

# Google (OAuth, Optional) Uncomment to enable
# Google (OAuth, Optional)
# GOOGLE_CLIENT_ID=
# GOOGLE_CLIENT_SECRET=
# GOOGLE_CALLBACK_URL=http://localhost:5173/api/auth/google/callback
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Close Stale Issues

on:
schedule:
- cron: 30 1 * * *
- cron: 0 0 * * * # every day at midnight (UTC)

permissions:
issues: write
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/sync-crowdin-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Sync Crowdin Translations

on:
workflow_dispatch:
push:
branches:
- v4

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4.1.1

- name: Sync Translations
uses: crowdin/github-action@v1.15.2
with:
upload_sources: true
upload_translations: true
download_translations: true
create_pull_request: true
localization_branch_name: "l10n"
pull_request_base_branch_name: "v4"
pull_request_title: "New Translations from Crowdin"
pull_request_body: "You've got new translations to be merged into the app from contributors on Crowdin.\n_This pull request was automatically created by the [Crowdin Action](https://github.com/marketplace/actions/crowdin-action)._"
env:
GITHUB_TOKEN: ${{ github.token }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ COPY --chown=node:node --from=build /app/dist ./dist
COPY --chown=node:node --from=build /app/tools/prisma ./tools/prisma
RUN pnpm run prisma:generate

ENV TZ=UTC
ENV NODE_ENV=production

EXPOSE 3000

CMD [ "dumb-init", "pnpm", "run", "start" ]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ Start creating your standout resume with Reactive Resume today!

## Built With

- React (Vite), for the frontend
- NestJS, for the backend
- Postgres (primary database)
- DigitalOcean (infrastructure)
- Prisma ORM, which frees you to switch to any other relational database with a few minor changes in the code
- Redis (for caching, session storage and resume statistics)
- Minio (for object storage: to store avatars, resume PDFs and previews)
Expand Down
2 changes: 2 additions & 0 deletions apps/artboard/src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
@tailwind utilities;

* {
font-variant-ligatures: none;

@apply border-current;
}

Expand Down
Binary file added apps/client/public/screenshots/builder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/client/public/screenshots/builder.png
Binary file not shown.
25 changes: 17 additions & 8 deletions apps/client/src/components/ai-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { cn } from "@reactive-resume/utils";
import { useState } from "react";

import { toast } from "../hooks/use-toast";
import { changeTone } from "../services/openai/change-tone";
import { fixGrammar } from "../services/openai/fix-grammar";
import { improveWriting } from "../services/openai/improve-writing";
Expand All @@ -39,17 +40,25 @@ export const AiActions = ({ value, onChange, className }: Props) => {
if (!aiEnabled) return null;

const onClick = async (action: Action, mood?: Mood) => {
setLoading(action);
try {
setLoading(action);

let result = value;
let result = value;

if (action === "improve") result = await improveWriting(value);
if (action === "fix") result = await fixGrammar(value);
if (action === "tone" && mood) result = await changeTone(value, mood);
if (action === "improve") result = await improveWriting(value);
if (action === "fix") result = await fixGrammar(value);
if (action === "tone" && mood) result = await changeTone(value, mood);

onChange(result);

setLoading(false);
onChange(result);
} catch (error) {
toast({
variant: "error",
title: t`Oops, the server returned an error.`,
description: (error as Error)?.message,
});
} finally {
setLoading(false);
}
};

return (
Expand Down
5 changes: 5 additions & 0 deletions apps/client/src/constants/helmet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { HelmetData } from "react-helmet-async";

export const helmetData = new HelmetData({});

export const helmetContext = helmetData.context;
3 changes: 3 additions & 0 deletions apps/client/src/constants/query-keys.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { QueryKey } from "@tanstack/react-query";

export const USER_KEY: QueryKey = ["user"];
export const AUTH_PROVIDERS_KEY: QueryKey = ["auth", "providers"];

export const LANGUAGES_KEY: QueryKey = ["translation", "languages"];

export const RESUME_KEY: QueryKey = ["resume"];
export const RESUMES_KEY: QueryKey = ["resumes"];
Expand Down
49 changes: 49 additions & 0 deletions apps/client/src/libs/dayjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,52 @@ import relativeTime from "dayjs/plugin/relativeTime";

dayjs.extend(localizedFormat);
dayjs.extend(relativeTime);

export const dayjsLocales: Record<string, () => Promise<ILocale>> = {
"af-ZA": () => import("dayjs/locale/af"),
"am-ET": () => import("dayjs/locale/am"),
"ar-SA": () => import("dayjs/locale/ar-sa"),
"bg-BG": () => import("dayjs/locale/bg"),
"bn-BD": () => import("dayjs/locale/bn"),
"ca-ES": () => import("dayjs/locale/ca"),
"cs-CZ": () => import("dayjs/locale/cs"),
"da-DK": () => import("dayjs/locale/da"),
"de-DE": () => import("dayjs/locale/de"),
"el-GR": () => import("dayjs/locale/el"),
"en-US": () => import("dayjs/locale/en"),
"es-ES": () => import("dayjs/locale/es"),
"fa-IR": () => import("dayjs/locale/fa"),
"fi-FI": () => import("dayjs/locale/fi"),
"fr-FR": () => import("dayjs/locale/fr"),
"he-IL": () => import("dayjs/locale/he"),
"hi-IN": () => import("dayjs/locale/hi"),
"hu-HU": () => import("dayjs/locale/hu"),
"id-ID": () => import("dayjs/locale/id"),
"it-IT": () => import("dayjs/locale/it"),
"ja-JP": () => import("dayjs/locale/ja"),
"km-KH": () => import("dayjs/locale/km"),
"kn-IN": () => import("dayjs/locale/kn"),
"ko-KR": () => import("dayjs/locale/ko"),
"lt-LT": () => import("dayjs/locale/lt"),
"ml-IN": () => import("dayjs/locale/ml"),
"mr-IN": () => import("dayjs/locale/mr"),
"ne-NP": () => import("dayjs/locale/ne"),
"nl-NL": () => import("dayjs/locale/nl"),
"no-NO": () => import("dayjs/locale/en"),
"or-IN": () => import("dayjs/locale/en"),
"pl-PL": () => import("dayjs/locale/pl"),
"pt-BR": () => import("dayjs/locale/pt-br"),
"pt-PT": () => import("dayjs/locale/pt"),
"ro-RO": () => import("dayjs/locale/ro"),
"ru-RU": () => import("dayjs/locale/ru"),
"sr-SP": () => import("dayjs/locale/sr"),
"sv-SE": () => import("dayjs/locale/sv"),
"ta-IN": () => import("dayjs/locale/ta"),
"te-IN": () => import("dayjs/locale/te"),
"th-TH": () => import("dayjs/locale/th"),
"tr-TR": () => import("dayjs/locale/tr"),
"uk-UA": () => import("dayjs/locale/uk"),
"vi-VN": () => import("dayjs/locale/vi"),
"zh-CN": () => import("dayjs/locale/zh-cn"),
"zh-TW": () => import("dayjs/locale/zh-tw"),
};
18 changes: 16 additions & 2 deletions apps/client/src/libs/lingui.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { i18n } from "@lingui/core";
import dayjs from "dayjs";

import { dayjsLocales } from "./dayjs";

export const defaultLocale = "en-US";

export async function dynamicActivate(locale: string) {
const { messages } = await import(`../locales/${locale}/messages.po`);
i18n.loadAndActivate({ locale, messages });
try {
const { messages } = await import(`../locales/${locale}/messages.po`);

if (messages) {
i18n.loadAndActivate({ locale, messages });
}

if (dayjsLocales[locale]) {
dayjs.locale(await dayjsLocales[locale]());
}
} catch (error) {
console.error(error);
}
}
32 changes: 16 additions & 16 deletions apps/client/src/locales/af-ZA/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: af\n"
"Project-Id-Version: reactive-resume\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-19 08:49\n"
"PO-Revision-Date: 2023-11-20 17:59\n"
"Last-Translator: \n"
"Language-Team: Afrikaans\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down Expand Up @@ -120,7 +120,7 @@ msgstr ""
msgid "Add New Page"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:70
#: apps/client/src/components/ai-actions.tsx:79
msgid "AI"
msgstr ""

Expand Down Expand Up @@ -238,8 +238,8 @@ msgstr ""
msgid "Cancel"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:94
#: apps/client/src/components/ai-actions.tsx:97
#: apps/client/src/components/ai-actions.tsx:103
#: apps/client/src/components/ai-actions.tsx:106
msgid "Casual"
msgstr ""

Expand All @@ -252,7 +252,7 @@ msgstr ""
msgid "Change Password"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:88
#: apps/client/src/components/ai-actions.tsx:97
msgid "Change Tone"
msgstr ""

Expand Down Expand Up @@ -288,8 +288,8 @@ msgstr ""
msgid "Company"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:106
#: apps/client/src/components/ai-actions.tsx:109
#: apps/client/src/components/ai-actions.tsx:115
#: apps/client/src/components/ai-actions.tsx:118
msgid "Confident"
msgstr ""

Expand Down Expand Up @@ -539,7 +539,7 @@ msgstr ""
msgid "Finally,"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:81
#: apps/client/src/components/ai-actions.tsx:90
msgid "Fix Spelling & Grammar"
msgstr ""

Expand Down Expand Up @@ -588,8 +588,8 @@ msgstr ""
msgid "Free, forever"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:112
#: apps/client/src/components/ai-actions.tsx:115
#: apps/client/src/components/ai-actions.tsx:121
#: apps/client/src/components/ai-actions.tsx:124
msgid "Friendly"
msgstr ""

Expand All @@ -605,7 +605,7 @@ msgstr ""
msgid "Get Started"
msgstr ""

#: apps/client/src/pages/auth/_components/social-auth.tsx:10
#: apps/client/src/pages/auth/_components/social-auth.tsx:18
msgid "GitHub"
msgstr ""

Expand All @@ -622,7 +622,7 @@ msgstr ""
msgid "Go to Dashboard"
msgstr ""

#: apps/client/src/pages/auth/_components/social-auth.tsx:17
#: apps/client/src/pages/auth/_components/social-auth.tsx:31
msgid "Google"
msgstr ""

Expand Down Expand Up @@ -704,7 +704,7 @@ msgstr ""
msgid "Import an existing resume"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:76
#: apps/client/src/components/ai-actions.tsx:85
msgid "Improve Writing"
msgstr ""

Expand Down Expand Up @@ -949,6 +949,7 @@ msgstr ""
msgid "One-Time Password"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:56
#: apps/client/src/libs/axios.ts:34
#: apps/client/src/pages/dashboard/resumes/_dialogs/import.tsx:188
#: apps/client/src/services/resume/print.tsx:34
Expand Down Expand Up @@ -1068,8 +1069,8 @@ msgstr ""
msgid "Primary Color"
msgstr ""

#: apps/client/src/components/ai-actions.tsx:100
#: apps/client/src/components/ai-actions.tsx:103
#: apps/client/src/components/ai-actions.tsx:109
#: apps/client/src/components/ai-actions.tsx:112
msgid "Professional"
msgstr ""

Expand Down Expand Up @@ -1672,4 +1673,3 @@ msgstr ""
#: apps/client/src/pages/builder/_components/toolbar.tsx:77
msgid "Zoom Out"
msgstr ""

Loading

0 comments on commit 1825fc3

Please sign in to comment.