https://github.com/hexlet/hexlet-correction
Typo Reporter
https://github.com/hexlet/hexlet-correction
hacktoberfest
Last synced: 9 months ago
JSON representation
Typo Reporter
- Host: GitHub
- URL: https://github.com/hexlet/hexlet-correction
- Owner: Hexlet
- License: agpl-3.0
- Created: 2019-09-02T20:45:10.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-27T20:11:23.000Z (over 1 year ago)
- Last Synced: 2025-03-28T17:09:48.700Z (about 1 year ago)
- Topics: hacktoberfest
- Language: Java
- Homepage: https://fixit.hexlet.io/
- Size: 2.86 MB
- Stars: 54
- Watchers: 13
- Forks: 86
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Hexlet Typo Reporter
A service to notify site owners of errors and typos. After integrating with the site, visitors are able to highlight an error or typo and report it to the administrator. The project works in Java.
Tasks can be discussed in the [Telegram community](https://t.me/hexletcommunity/12).
## Example
Go to: https://hexlet.github.io/hexlet-correction/index.html
Highlight text and press Ctrl+Enter
## Development
Before you can build this project, you must install and configure the following dependencies on your machine:
1. Java 21
2. Docker, Docker Compose
### Yandex authorization
To enable Yandex authorization, you need to register on [Yandex ID OAuth](https://oauth.yandex.ru/) and create your web application,
add `ClientID` and `Client secret` in your secret
```bash
YANDEX_CLIENT_ID=your_yadex_client_id_values
YANDEX_CLIENT_SECRET=your_yandex_client_secret_values
```
### Registration/Authorization with GitHub
For registration or/and authorization account with GitHub:
- Create OAuth app https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app.
- Get values the `Client ID` and `Client Secret` and add to environment variables in any known way.
For example, you can create an `.env` file in the root of the project, where you can enter the names of variables
and their values as shown below:
```bash
GITHUB_CLIENT_ID=your_github_client_id_values
GITHUB_CLIENT_SECRET=your_github_client_secret_values
```
A `.env.example` file has been created in the root of the project, which specifies the variables as they should be specified. For these variables, you need to specify the values you received.
You can copy this file and rename to `.env`, change and use.
```
### Packaging as uber-jar
To build the final jar:
```bash
make build
```
### Development with vagrant
Install Vagrant and VM provider (Virtualbox).
Run commands:
```bash
make vagrant-build
make vagrant-run
```
or just `vagrant ssh`, then `cd /vagrant` to run commands inside vm
## Testing
To launch your application's tests, run:
```bash
make test
```
## Using Docker to simplify development (optional)
For example, to start a postgresql database in a docker container, run:
```bash
make docker-infra-start
```
## Run application with database in docker
```bash
make run-dev
```
## Build and run application with database in docker
```bash
make run-dev-docker-db # make start
```
## Clear config (database, app build)
```bash
make clear
```
## Typo API calls
For creating new `typo`:
```plaintext
POST http://localhost:8080/api/workspaces/{workspaceId}/typos
Content-Type: application/json
Authorization: Basic base64(workspaceId:api-token)
Referer: (workspaceId:allowed-url)
{
"pageUrl": "https://mysite.com/page/with/typo",
"reporterName": "reporterName",
"reporterComment": "reporterComment",
"textBeforeTypo": "textBeforeTypo",
"textTypo": "textTypo",
"textAfterTypo": "textAfterTypo"
}
```
---
[](https://hexlet.io/?utm_source=github&utm_medium=link&utm_campaign=hexlet-correction)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io/?utm_source=github&utm_medium=link&utm_campaign=hexlet-correction).
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).