Skip to content

Commit

Permalink
v1.2.0 (#50)
Browse files Browse the repository at this point in the history
* linting and formatting implementation

* fixing glob-parent dependency vulnerability

* Bugs from linting/formatting fixed, grammar page begun

* grammar cards, fixed logging, EFK stack working, monitoring

* Bug fixing, adding Google analytics, beginning on custom literature implementation

* Google analytics, improving search performance

* Improving SEO with title and meta tags

* fixing local bookmarks bug, fixing literature fallback bug, attempting performance improvements

* adding translation search

* updating package number and database infra

* progressing lint action
  • Loading branch information
JimmyPaolini authored Jul 14, 2021
1 parent c2d24cc commit fa7e200
Show file tree
Hide file tree
Showing 208 changed files with 42,133 additions and 9,374 deletions.
19 changes: 19 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
**/.DS_Store
**/.vscode
**/.idea

**/node_modules
**/dist

**/.next/
**/out/

**/database_volume
**/elasticsearch_volume

**/data/wiktionary
**/assets

**/ingestion/src/dictionary
**/README.md
**/LICENSE.md
34 changes: 34 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"rules": {
"no-extra-parens": ["off"],
"react/react-in-jsx-scope": ["off"],
"react/prop-types": ["off"],
// "@typescript-eslint/no-non-null-assertion": ["off"],
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/no-var-requires": ["off"]
},
"settings": {
"react": {
"version": "17"
}
},
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["react", "@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
}
}
15 changes: 15 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: lint
on: pull_request

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
- name: Install Dependencies
run: npm install
- name: Lint
run: yarn lint
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
**/.DS_Store
**/.vscode
**/.idea

**/node_modules
**/dist
**/*.env*

# next.js
**/.next/
**/out/

Expand All @@ -14,5 +14,4 @@

**/data/wiktionary

**/*kubeconfig.yaml
.DS_Store
19 changes: 19 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
**/.DS_Store
**/.vscode
**/.idea

**/node_modules
**/dist

**/.next/
**/out/

**/database_volume
**/elasticsearch_volume

**/data/wiktionary
**/assets

**/package.json

server/**/schema.graphql
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"trailingComma": "all",
"jsxBracketSameLine": true
}
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,43 @@

<!-- Generate icon link list from the tools variable in ToolIconGrid.tsx: tools.map((tool) => `<a href="${tool.url}"><img width="64" height="64" alt="${tool.name}" src="web/public/icon/tool/${tool.name}.png"></a>`, "").join("\n") -->

<a href="https://www.typescriptlang.org/"><img width="64" height="64" alt="typescript" src="web/public/icon/tool/typescript.png"></a>
<a href="https://nodejs.org/"><img width="64" height="64" alt="nodejs" src="web/public/icon/tool/nodejs.png"></a>
<a href="https://www.postgresql.org/"><img width="64" height="64" alt="postgres" src="web/public/icon/tool/postgres.png"></a>
<a href="https://expressjs.com/"><img width="64" height="64" alt="expressjs" src="web/public/icon/tool/expressjs.png"></a>
<a href="https://typeorm.io/"><img width="64" height="64" alt="typeorm" src="web/public/icon/tool/typeorm.png"></a>
<a href="https://graphql.org/"><img width="64" height="64" alt="graphql" src="web/public/icon/tool/graphql.png"></a>
<a href="https://www.apollographql.com/"><img width="64" height="64" alt="apollo" src="web/public/icon/tool/apollo.png"></a>
<a href="https://typegraphql.com/"><img width="64" height="64" alt="type-graphql" src="web/public/icon/tool/type-graphql.png"></a>
<a href="https://www.elastic.co/"><img width="64" height="64" alt="elk" src="web/public/icon/tool/elk.png"></a>
<a href="https://www.typescriptlang.org"><img width="64" height="64" alt="typescript" src="web/public/icon/tool/typescript.png"></a>
<a href="https://nodejs.org"><img width="64" height="64" alt="nodejs" src="web/public/icon/tool/nodejs.png"></a>
<a href="https://www.postgresql.org"><img width="64" height="64" alt="postgres" src="web/public/icon/tool/postgres.png"></a>
<a href="https://expressjs.com"><img width="64" height="64" alt="expressjs" src="web/public/icon/tool/expressjs.png"></a>
<a href="https://typeorm.io"><img width="64" height="64" alt="typeorm" src="web/public/icon/tool/typeorm.png"></a>
<a href="https://graphql.org"><img width="64" height="64" alt="graphql" src="web/public/icon/tool/graphql.png"></a>
<a href="https://www.apollographql.com"><img width="64" height="64" alt="apollo" src="web/public/icon/tool/apollo.png"></a>
<a href="https://typegraphql.com"><img width="64" height="64" alt="type-graphql" src="web/public/icon/tool/type-graphql.png"></a>
<a href="https://www.elastic.co"><img width="64" height="64" alt="elk" src="web/public/icon/tool/elk.png"></a>
<a href="https://fluentbit.io"><img width="64" height="64" alt="fluentbit" src="web/public/icon/tool/fluentbit.png"></a>
<a href="https://sendgrid.com"><img width="64" height="64" alt="sendgrid" src="web/public/icon/tool/sendgrid.png"></a>
<a href="https://fluentbit.io/"><img width="64" height="64" alt="fluentbit" src="web/public/icon/tool/fluentbit.png"></a>
<a href="https://jwt.io/"><img width="64" height="64" alt="jwt" src="web/public/icon/tool/jwt.png"></a>
<a href="https://nextjs.org/"><img width="64" height="64" alt="nextjs" src="web/public/icon/tool/nextjs.png"></a>
<a href="https://reactjs.org/"><img width="64" height="64" alt="react" src="web/public/icon/tool/react.png"></a>
<a href="https://material-ui.com/"><img width="64" height="64" alt="materialui" src="web/public/icon/tool/materialui.png"></a>
<a href="https://react-query.tanstack.com/"><img width="64" height="64" alt="react-query" src="web/public/icon/tool/react-query.png"></a>
<a href="https://formik.org/"><img width="64" height="64" alt="formik" src="web/public/icon/tool/formik.png"></a>
<a href="https://eslint.org/"><img width="64" height="64" alt="eslint" src="web/public/icon/tool/eslint.png"></a>
<a href="https://prettier.io/"><img width="64" height="64" alt="prettier" src="web/public/icon/tool/prettier.png"></a>
<a href="https://jwt.io"><img width="64" height="64" alt="jwt" src="web/public/icon/tool/jwt.png"></a>
<a href="https://nextjs.org"><img width="64" height="64" alt="nextjs" src="web/public/icon/tool/nextjs.png"></a>
<a href="https://reactjs.org"><img width="64" height="64" alt="react" src="web/public/icon/tool/react.png"></a>
<a href="https://material-ui.com"><img width="64" height="64" alt="materialui" src="web/public/icon/tool/materialui.png"></a>
<a href="https://storybook.js.org"><img width="64" height="64" alt="storybook" src="web/public/icon/tool/storybook.png"></a>
<a href="https://react-query.tanstack.com"><img width="64" height="64" alt="react-query" src="web/public/icon/tool/react-query.png"></a>
<a href="https://formik.org"><img width="64" height="64" alt="formik" src="web/public/icon/tool/formik.png"></a>
<a href="https://eslint.org"><img width="64" height="64" alt="eslint" src="web/public/icon/tool/eslint.png"></a>
<a href="https://prettier.io"><img width="64" height="64" alt="prettier" src="web/public/icon/tool/prettier.png"></a>
<a href="https://github.com/features/actions"><img width="64" height="64" alt="github-actions" src="web/public/icon/tool/github-actions.png"></a>
<a href="https://www.docker.com/"><img width="64" height="64" alt="docker" src="web/public/icon/tool/docker.png"></a>
<a href="https://kubernetes.io/"><img width="64" height="64" alt="kubernetes" src="web/public/icon/tool/kubernetes.png"></a>
<a href="https://www.docker.com"><img width="64" height="64" alt="docker" src="web/public/icon/tool/docker.png"></a>
<a href="https://kubernetes.io"><img width="64" height="64" alt="kubernetes" src="web/public/icon/tool/kubernetes.png"></a>
<a href="https://helm.sh"><img width="64" height="64" alt="helm" src="web/public/icon/tool/helm.png"></a>
<a href="https://bitnami.com/stacks/helm"><img width="64" height="64" alt="bitnami" src="web/public/icon/tool/bitnami.png"></a>
<a href="https://helm.sh/"><img width="64" height="64" alt="helm" src="web/public/icon/tool/helm.png"></a>
<a href="https://www.nginx.com/"><img width="64" height="64" alt="nginx" src="web/public/icon/tool/nginx.png"></a>
<a href="https://www.linode.com/"><img width="64" height="64" alt="linode" src="web/public/icon/tool/linode.png"></a>
<a href="https://www.cloudflare.com/"><img width="64" height="64" alt="cloudflare" src="web/public/icon/tool/cloudflare.png"></a>
<a href="https://prometheus.io"><img width="64" height="64" alt="prometheus" src="web/public/icon/tool/prometheus.png"></a>
<a href="https://grafana.com"><img width="64" height="64" alt="grafana" src="web/public/icon/tool/grafana.png"></a>
<a href="https://k8slens.dev"><img width="64" height="64" alt="lens" src="web/public/icon/tool/lens.png"></a>
<a href="https://www.nginx.com"><img width="64" height="64" alt="nginx" src="web/public/icon/tool/nginx.png"></a>
<a href="https://www.linode.com"><img width="64" height="64" alt="linode" src="web/public/icon/tool/linode.png"></a>
<a href="https://www.cloudflare.com"><img width="64" height="64" alt="cloudflare" src="web/public/icon/tool/cloudflare.png"></a>
<a href="https://stackoverflow.com/questions/201323/how-to-validate-an-email-address-using-a-regular-expression"><img width="64" height="64" alt="stackoverflow" src="web/public/icon/tool/stackoverflow.png"></a>
<a href="https://www.figma.com/"><img width="64" height="64" alt="figma" src="web/public/icon/tool/figma.png"></a>
<a href="https://code.visualstudio.com/"><img width="64" height="64" alt="vscode" src="web/public/icon/tool/vscode.png"></a>
<a href="https://www.figma.com"><img width="64" height="64" alt="figma" src="web/public/icon/tool/figma.png"></a>
<a href="https://code.visualstudio.com"><img width="64" height="64" alt="vscode" src="web/public/icon/tool/vscode.png"></a>
<a href="https://www.patreon.com/lexico"><img width="64" height="64" alt="patreon" src="web/public/icon/tool/patreon.png"></a>
<a href="https://lexico-group.slack.com/archives/C01SN2QN2BF"><img width="64" height="64" alt="slack" src="web/public/icon/tool/slack.png"></a>
<a href="https://www.wiktionary.org/"><img width="64" height="64" alt="wikipedia" src="web/public/icon/tool/wikipedia.png"></a>
<a href="https://www.wiktionary.org"><img width="64" height="64" alt="wikipedia" src="web/public/icon/tool/wikipedia.png"></a>
<a href="https://github.com/JimmyPaolini/Lexico"><img width="64" height="64" alt="github" src="web/public/icon/tool/github.png"></a>

### Database Schema
Expand Down
Binary file removed data/backup/2021-04-18T16:12:10.584Z_ingested.zip
Binary file not shown.
Binary file removed data/backup/2021-04-18T16:46:23.126Z_literature.zip
Binary file not shown.
Binary file removed data/backup/2021-04-24T14:12:00.716Z_ingested.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions entity/dictionary/word/PrincipalPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Field, ObjectType } from "type-graphql"

@ObjectType()
export default class PrincipalPart {
@Field()
name: string = ""
@Field(() => String)
name = ""

@Field(() => [String])
text: string[] = []
Expand Down
12 changes: 6 additions & 6 deletions entity/dictionary/word/Pronunciation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Field, ObjectType } from "type-graphql"

@ObjectType()
export class PronunciationParts {
@Field()
phonemes: string = ""
@Field(() => String)
phonemes = ""

@Field()
phonemic: string = ""
@Field(() => String)
phonemic = ""

@Field()
phonetic: string = ""
@Field(() => String)
phonetic = ""
}

@ObjectType()
Expand Down
2 changes: 1 addition & 1 deletion entity/dictionary/word/forms/AdverbForms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class AdverbForms {
if (superlative) this.superlative = superlative
}

get __typename() {
get __typename(): string {
return "AdverbForms"
}
}
2 changes: 1 addition & 1 deletion entity/dictionary/word/inflection/AdjectiveInflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class AdjectiveInflection {
constructor(
declension: AdjectiveDeclension = "",
degree: AdjectiveDegree = "positive",
other: string = "",
other = "",
) {
this.declension = declension
this.degree = degree
Expand Down
4 changes: 2 additions & 2 deletions entity/dictionary/word/inflection/NounInflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class NounInflection {
constructor(
declension: NounDeclension = "",
gender: NounGender = "",
other: string = "",
other = "",
) {
this.declension = declension
this.gender = gender
Expand All @@ -32,5 +32,5 @@ export type NounDeclension =
export const nounDeclensionRegex = new RegExp(
/(first)|(second)|(third)|(fourth)|(fifth)/,
)
export type NounGender = "masculine" | "feminine" | "neuter" | ""
export type NounGender = "masculine" | "feminine" | "masc/fem" | "neuter" | ""
export const genderRegex = new RegExp(/(masculine)|(feminine)|(neuter)/)
5 changes: 1 addition & 4 deletions entity/dictionary/word/inflection/PrepositionInflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export default class PrepositionInflection {
@Field()
other?: string = ""

constructor(
prepositionCase: PrepositionCase = "accusative",
other: string = "",
) {
constructor(prepositionCase: PrepositionCase = "accusative", other = "") {
this.case = prepositionCase
this.other = other
}
Expand Down
2 changes: 1 addition & 1 deletion entity/dictionary/word/inflection/Uninflected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { Field, ObjectType } from "type-graphql"
@ObjectType()
export default class Uninflected {
@Field(() => String)
other: string = "uninflected"
other = "uninflected"
}
2 changes: 1 addition & 1 deletion entity/dictionary/word/inflection/VerbInflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class VerbInflection {
@Field()
other?: string = ""

constructor(conjugation: VerbConjugation = "", other: string = "") {
constructor(conjugation: VerbConjugation = "", other = "") {
this.conjugation = conjugation
this.other = other
}
Expand Down
1 change: 1 addition & 0 deletions entity/literature/Text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default class Text {

@Field(() => [Line])
linesSlice(
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
@Arg("start", { defaultValue: 0 }) start: number = 0,
@Arg("end", { defaultValue: Number.MAX_VALUE })
end: number = Number.MAX_VALUE,
Expand Down
40 changes: 20 additions & 20 deletions entity/user/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@ export default class Settings {
@Field({ defaultValue: "dark" })
theme: "dark" | "light" = "dark"

@Field({ defaultValue: 24 })
fontSize: number = 24
@Field(() => Number, { defaultValue: 24 })
fontSize = 24

@Field({ defaultValue: false })
formsExpandedDefault: boolean = false
@Field(() => Boolean, { defaultValue: false })
formsExpandedDefault = false

@Field({ defaultValue: false })
translationsExpandedDefault: boolean = false
@Field(() => Boolean, { defaultValue: false })
translationsExpandedDefault = false

@Field({ defaultValue: true })
dictionaryMacronized: boolean = true
@Field(() => Boolean, { defaultValue: true })
dictionaryMacronized = true

@Field({ defaultValue: false })
literatureMacronized: boolean = false
@Field(() => Boolean, { defaultValue: false })
literatureMacronized = false
}

@InputType()
export class SettingsInput implements Partial<Settings> {
@Field({ defaultValue: "dark" })
theme: "dark" | "light" = "dark"

@Field({ defaultValue: 24 })
fontSize: number = 24
@Field(() => Number, { defaultValue: 24 })
fontSize = 24

@Field({ defaultValue: false })
formsExpandedDefault: boolean = false
@Field(() => Boolean, { defaultValue: false })
formsExpandedDefault = false

@Field({ defaultValue: false })
translationsExpandedDefault: boolean = false
@Field(() => Boolean, { defaultValue: false })
translationsExpandedDefault = false

@Field({ defaultValue: true })
dictionaryMacronized: boolean = true
@Field(() => Boolean, { defaultValue: true })
dictionaryMacronized = true

@Field({ defaultValue: false })
literatureMacronized: boolean = false
@Field(() => Boolean, { defaultValue: false })
literatureMacronized = false
}
16 changes: 16 additions & 0 deletions infra/docker/docker-compose.database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3"
services:
database:
image: postgres:13
container_name: database
ports:
- 5432:5432
env_file: ../../.env
volumes:
- ../../data/database_volume:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]

volumes:
database_volume:
driver: local
Loading

0 comments on commit fa7e200

Please sign in to comment.