Skip to content

Commit

Permalink
添加多語言支援和其他重構
Browse files Browse the repository at this point in the history
  • Loading branch information
igncp committed Jun 16, 2024
1 parent d2d9631 commit 17eb257
Show file tree
Hide file tree
Showing 126 changed files with 8,325 additions and 17,504 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target-dir = "target"
5 changes: 1 addition & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#NEXT_PUBLIC_BACKEND_URL=http://localhost:9000
NEXT_PUBLIC_BACKEND_URL=https://api.learn-languages-writing.com
NEXT_PUBLIC_GOOGLE_CLIENT_ID=128663644139-o8phiqm9vbn3onkrj0ehircqi59sm319.apps.googleusercontent.com

GOOGLE_CLIENT_SECRET=YOUR_GOOGLE_CLIENT_SECRET
LOGGER_LEVEL=debug
JWT_SECRET=some_secret
TOKEN_MAXAGE=3600
TOKEN_EXPIRED_IN=3600
CLIENT_ORIGIN=http://localhost:3000
BACKEND_URL=http://localhost:9000
DATABASE_URL=writing-trainer.db
OPENAI_API_KEY=...
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
gh_pages
storybook-static
coverage
coverage-ts
.next
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/debug.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/deploy-frontend.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/deploy-to-ghpages.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Deploy Backend
name: Deploy
on:
push:
branches:
- main
paths:
- '.github/workflows/deploy-backend.yml'
- '.github/workflows/deploy.yml'
- 'packages.json'
- 'package-lock.json'
- 'src/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'scripts/ci/build_docker.sh'
- 'src/backend/**'
workflow_dispatch:

jobs:
Expand All @@ -31,13 +32,17 @@ jobs:

- name: Install 🚧
run: |
touch ./is-ci-rust
touch ./is-ci
nix develop path:$(pwd) -c rustup install stable
nix develop path:$(pwd) -c cargo build --release # This speeds up the next steps
nix develop path:$(pwd) -c npm install
- name: Check 🔧
run: |
nix develop path:$(pwd) -c bash -c 'cargo clippy --release'
cp .env.example .env
nix develop path:$(pwd) -c bash scripts/check.sh
- name: Build and publish docker image
run: |
nix develop path:$(pwd) -c bash -c scripts/ci/build_docker_backend.sh
cp .env.example .env
nix develop path:$(pwd) -c bash -c scripts/ci/build_docker.sh
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
node_modules
gh_pages
storybook-static
coverage
coverage-ts
.next
out
Expand Down
84 changes: 0 additions & 84 deletions .storybook/main.js

This file was deleted.

16 changes: 0 additions & 16 deletions .storybook/preview.js

This file was deleted.

14 changes: 6 additions & 8 deletions Dockerfile.backend → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ USER root
# Required for using the correct GLIBC (v2.38)
RUN echo 'deb http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y libssl-dev ca-certificates sqlite3 glibc-doc
&& apt-get install -y libssl-dev ca-certificates sqlite3 glibc-doc nginx

RUN useradd -m -s /bin/bash rust \
&& mkdir -p /app \
&& chown -R rust:rust /app

USER rust
WORKDIR /app

COPY --chown=rust:rust target/release/writing-trainer-backend .
COPY target/release/writing-trainer-backend .
COPY scripts/docker_run.sh scripts/docker_run.sh
COPY out out
COPY nginx.conf /etc/nginx/nginx.conf

CMD ./writing-trainer-backend
CMD bash scripts/docker_run.sh
12 changes: 0 additions & 12 deletions Dockerfile.frontend

This file was deleted.

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

我用來練習語言學習的應用程式。 欲了解更多信息:

- [storybook](https://igncp.github.io/writing-trainer/storybook)
- [types-coverage](https://igncp.github.io/writing-trainer/types-coverage)
- [tests-coverage](https://igncp.github.io/writing-trainer/core-tests-coverage)

## 設定

要求:
Expand Down
3 changes: 2 additions & 1 deletion docs/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Tasks

- Convert UI handler type to class
- Add tooltip
- Add simplified chinese script
- Pass manager via context
- Persist config in records (which subpanels are displayed)
- Support pronunciation with tones better
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17eb257

Please sign in to comment.