-
-
Notifications
You must be signed in to change notification settings - Fork 354
Development
The backend is written in Kotlin and in Spring Boot. To run it, you will need:
- Java 11
- Docker
./gradlew server-app:bootRun -Dspring.active.profile=dev
You can use
server-app:bootRun -Dspring.active.profile=dev
- Open the root dir in Idea CE
- Click Edit configurations button in top right corner
- Add new configuration with plus button
- Select
Gradle - Set run command to
server-app:bootRun -Dspring.active.profile=dev
- Click run/debug button in top right corner with the newly created configuration
- Open the root dir in Idea Ultimate
- Edit run configurations in top right corner
- Duplicate Spring Boot auto created configuration
- Rename to "Application Dev"
- Set
Active profilesinput to "dev" - Save by click OK
- Select the "Application Dev" configuration in the dropdown.
- Run it with Run/Debug button
- node.js v14 or newer
- go to webapp folder
cd webapp - Install npm packages "npm ci"
- Run it
npm run dev
For frontend there are npm tasks prettier and eslint, which you should run before every commit, otherwise "Frontend static check" workflow will fail. You can also use prettier plugins for VS Code, Idea or WebStorm.
To fix prettier issues and check everything is fine, run these commands in webapp dir:
npm run prettier
npm run tsc
npm run eslint
On backennd, there is gradle task ktlint format, which helps you to format Kotlin code.
./gradlew ktlintFormat
Backend of Tolgee is tested with unit and integration tests. UI and it's interaction with backend is tested using E2E cypress tests.
To run backend tests, you can run gradle test task
./gradlew test
Or you can select any integration test the code and run it via Idea CE or Idea Ultimate. It should just work out of box.
Running E2E tests can be a bit more complicated.
To just run it, you can execute runE2e Gradle task.
./gradlew runE2e
However, when developing you would probably also want to modify the frontend code or debug the backend. To do so, you have to run 4 different tasks at the same time.
- Run the web app with E2e settings
./gradlew runWebAppNpmStartE2eDev
- Run the E2e Docker services like fake smtp server
./gradlew runDockerE2eDev
To be continued...
- Run