This Angular CLI project is the frontend for GlitchTip, an open source implementation of Sentry bug tracking software. It works with GlitchTip-Backend.
View our Contributing documentation here.
Run npm start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
To run a production-like build on a dev server, run npm run start-prod-no-static instead.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
To run a production build that works well with glitchtip-backend, run npm run build-prod. The build artifacts will be stored in the dist/ directory. Copy that into the glitchtip-backend folder, run collectstatic, serve the backend, and then navigate to http://localhost:8000.
Run ng test to execute the unit tests via Karma.
We define end to end testing as running both the Django backend and Angular frontend. We use Cypress to run end to end tests. Be aware the tests will seed the backend codebase with test data.
- Run the backend server. From the backend repo run
docker-compose up. Do not enable Stripe. - Run the frontend development server
npm start - Run Cypress
npm run cy:open
Angular Localize is used to manage i18n in GlitchTip. ng-extract-i18n-merge is used to update and merge translation files.
- Copy
src/locale/messages.xlftosrc/locale/messages.CODE.xlfwhere CODE is your language code. - Edit
angular.jsonand your language code and newly created file.
"i18n": {
"sourceLocale": "en-US",
"locales": {
"CODE": {
"translation": "src/locale/messages.CODE.xlf"
}
}
},
...
"extract-i18n": {
"options": {
"targetFiles": ["../locale/messages.CODE.xlf"]
}
},
- Add language code to src/main.ts
const availableLocales = ["en", "CODE"]; - Edit the messages.CODE.xlf file. Consider using a tool such as Poedit.
- Open a merge request.
npm run extract-i18n will update all message files with the latest extracted strings from the code.
To test out locally, run npm run i18n-create-json. Ensure that navigator.language returns the desired code.
Open an issue and say hello! If you use Sentry as a reference, make sure only to refer to open source Sentry which we forked here. Never copy code nor ideas from Sentry on GitHub as that would violate their proprietary license.