GithubHelp home page GithubHelp logo

henrytsz / earthworm-new Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cuixueshe/earthworm

0.0 0.0 0.0 53.47 MB

Learning English through the method of constructing sentences with conjunctions

Home Page: https://earthworm.cuixueshe.com

License: GNU Affero General Public License v3.0

JavaScript 0.56% TypeScript 69.10% CSS 0.62% Vue 29.63% HTML 0.09%

earthworm-new's Introduction

Earthworm

Earthworm

English | 中文

⚡ Introduction

By constructing sentences with conjunctions, it helps you learn English better~ 😊

🚀 How To Start ?

⚠️ Requirements

  • pnpm version >= 8
  • Node.js version >= v20
  • MySQL version >= 8.0.0
  • Redis version >= 5.0.0
  • Docker. please make sure it is installed and running successfully on your local machine.
  • The mentioned operations below are based on the root directory of the current project, please be attentive to ensure there are no errors.
docker --version # Docker version 24.0.7, build afdd53b

node --version # v20+

pnpm -v # 8+

1. Install Dependencies

pnpm install

2. Copy the Contents of .env.example to the ./apps/api/.env File

If the file doesn't exist, you need to create it manually. Linux users can perform the operation with the following command.

It primarily stores environmental variable information for the main storage system, such as database connection addresses, usernames, passwords, ports, keys, and so on. The backend service will read configuration from this file. Of course, you can also customize it with your own configuration information.

cp .env.example ./apps/api/.env

3. Start/Stop/Delete Docker Compose Service

The backend relies on MySQL and Redis services. Start and stop these services using the commands configured in package.json below.

# start
pnpm docker:start
# stop
pnpm docker:stop
# delete
pnpm docker:delete

If you prefer manual, you can use the commands below.

docker compose up -d
docker compose stop
docker compose down

# commands compatible with older versions of Docker
docker-compose up -d

4. Initialize Database

When executing the current command, try to wait for a short interval after the previous command, as we are using the -d parameter, which runs the services in the background. They might still be in a 'running' state. If you encounter an error, try running the command again.

pnpm db:init

5. Create and Upload Course Data (Only Execute This During the Initial Database Initialization)

pnpm db:upload

6. Start the Backend Service

pnpm dev:serve

7. Start the Frontend Service

pnpm dev:client

FAQ

How To Correctly Update Course Data ?

when you identify incorrect course data and make modifications, you should use the following command to update the course data in the database.

pnpm db:update

pnpm Install Error?

Some dependencies require compilation during installation, necessitating the presence of relevant build environments. If these environments are not available, the compilation process may fail. Additionally, different modules may require different build environments, so specific issues need to be analyzed individually. Below are specific problems encountered along with their solutions.

First try the following command to update pnpm

pnpm i -g
# or
pnpm i -g pnpm
# or
npx pnpm i -g pnpm@latest

Error Installing the argon2 Module On Windows

  • Install Visual Studio 2015 or later, specifically the "Desktop development with C++" component. (In practice, any component containing C++ development tools and libraries will suffice.)
  • If you encounter Chinese characters display issues during compilation, execute chcp 437 in the command prompt, then rerun the install command.

Docker Permission Denied in Docker?

When using WSL2 as a development environment in Windows, the following error occurs when starting Docker with docker compose up -d :

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied

Solution

Add the current user to the docker group

# Add docker user group
sudo groupadd docker
# Add the logged-in user to the docker user group
sudo gpasswd -a $USER docker
# Update user group
newgrp docker
# Test if docker command is working properly
docker images

Frontend Development Guideline

  1. Do not Destructure Pinia store.
    • The readability will be better when using store
    • Destructuring can lead to reactivity loss and using storeToRefs is also quite cumbersome
  2. Avoid including UI logic in composables.
    1. Such as useMessage
    2. We categorize the router as UI logic, and for ease of testing, avoid including routerrelated logic in there

Contributing

Thanks to everyone who has already contributed to Earthworm! 🎉

earthworm-new's People

Contributors

cuixiaorui avatar nauxscript avatar fengstats avatar hildxd avatar zclsx avatar hazel-lin avatar vampirewy avatar zuowendong avatar zhuzhux avatar juntingl avatar singlepoi avatar lhn3464893441 avatar pkc918 avatar masterjiyuhang avatar yaolifeng0629 avatar sadanspace avatar reinerlau avatar baboon-king avatar lttztt3 avatar bsuooo avatar myltx avatar shellingfordly avatar holinwang avatar coderlfm avatar yunzhou2022 avatar yoosonchan avatar mynameszhazh avatar wwlight avatar torstentjh avatar seyeel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.