Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat add description in english #14

Merged
merged 74 commits into from
Sep 20, 2023
Merged
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e4607af
build: setup deploy homologation
viniciuscosmome Aug 29, 2023
556d69f
Merge pull request #3 from viniciuscosmome/build/deploy-homologation
Daaaiii Aug 29, 2023
bc42c5e
chore: changes jest root dir
viniciuscosmome Aug 29, 2023
9bf09a6
test: creates services tests
viniciuscosmome Aug 29, 2023
6c25559
build: setup husky
viniciuscosmome Aug 29, 2023
56009d3
chore(deps): includes husky
viniciuscosmome Aug 29, 2023
513ef4d
chore: uses pre-push event
viniciuscosmome Aug 29, 2023
d078f9d
Merge pull request #4 from viniciuscosmome/tests/initial-setup
Daaaiii Aug 29, 2023
7f44d65
feat(submodule): includes mail-templates submodule
viniciuscosmome Sep 2, 2023
9d92e59
chore: specify what JSX code is generated
viniciuscosmome Sep 2, 2023
f6d06a6
chore(deps): install @react-email/render and submodule dependencies
viniciuscosmome Sep 2, 2023
5a4b472
chore(deps): install resend dependencies
viniciuscosmome Sep 2, 2023
17e276a
chore(dev-deps): install ` dotenv-cli ` and ` @types-react ` packages
viniciuscosmome Sep 2, 2023
c2d5c89
feat: creates mail service
viniciuscosmome Sep 2, 2023
1fca763
docs: updates swagger documentation and example files
viniciuscosmome Sep 2, 2023
db6f0e1
chore(onerror): shows error when trying to load html
viniciuscosmome Sep 2, 2023
d75d66c
styles: variable destructuring
viniciuscosmome Sep 2, 2023
0091e88
chore(deps): install ` class-validator ` and ` class-transformer ` pa…
viniciuscosmome Sep 4, 2023
6c794f9
refactor: renames properties
viniciuscosmome Sep 4, 2023
ee3aa3c
feat: creates new account method
viniciuscosmome Sep 4, 2023
0db0c4b
chore(dev-deps): install the faker-js package to generate test values
viniciuscosmome Sep 4, 2023
e7688a8
test: creates simple tests for newAccountPropsProcessing method
viniciuscosmome Sep 4, 2023
6334342
chore: changes container name
viniciuscosmome Sep 5, 2023
5eb52c8
chore: shows the port on which the server is running
viniciuscosmome Sep 5, 2023
dfe82bd
Merge pull request #5 from viniciuscosmome/feature/email-service
Daaaiii Sep 5, 2023
02e9f08
Merge branch 'develop' of https://github.com/loryblu/loryblu-api into…
viniciuscosmome Sep 6, 2023
085da59
docs: updates description
viniciuscosmome Sep 6, 2023
40fc1ed
Merge pull request #6 from viniciuscosmome/feature/register-parent
Daaaiii Sep 6, 2023
58f46c9
build(`ci-cd`): configure testing.yml for unit tests
viniciuscosmome Sep 6, 2023
3bf4faf
docs: updates api description
viniciuscosmome Sep 6, 2023
d0960df
Merge pull request #8 from viniciuscosmome/test/ci-unit-tests
viniciuscosmome Sep 10, 2023
33ee731
chore(submodule): updates email-templates
viniciuscosmome Sep 10, 2023
dadbd87
refactor: changes file name
viniciuscosmome Sep 10, 2023
4bd1c46
chore: updates mail loader
viniciuscosmome Sep 10, 2023
9465cdf
chore: sync submodule
viniciuscosmome Sep 10, 2023
ea5ef6a
chore: updates templates
viniciuscosmome Sep 10, 2023
b8173d8
chore: updates validation messages
viniciuscosmome Sep 11, 2023
1e8f36a
chore: creates encryptData method
viniciuscosmome Sep 11, 2023
247843b
refactor: updates prisma known errors
viniciuscosmome Sep 11, 2023
e8c353f
chore: encrypt password and hash email
viniciuscosmome Sep 11, 2023
e5bb0fc
docs: add new environment variable descrition
viniciuscosmome Sep 11, 2023
8a8a6cf
chore: import bcrypt
viniciuscosmome Sep 11, 2023
2c65309
chore: updates create account expect
viniciuscosmome Sep 11, 2023
9c43f6c
chore: changes messages and examples
viniciuscosmome Sep 11, 2023
cf8a1a5
feat: creates reset password information scheme
viniciuscosmome Sep 11, 2023
eb2d810
chore: log known errors
viniciuscosmome Sep 11, 2023
4fa7674
refactor: change log type
viniciuscosmome Sep 11, 2023
449b02f
chore: includes default error
viniciuscosmome Sep 11, 2023
57dd4e0
chore: removes prismaKnownValidationErrors
viniciuscosmome Sep 11, 2023
bbbf604
chore: updates error messages
viniciuscosmome Sep 11, 2023
6ef4874
Merge pull request #9 from viniciuscosmome/chore/updates-mail-service
viniciuscosmome Sep 12, 2023
59a4326
feat: creates and saves token to reset password
viniciuscosmome Sep 12, 2023
9760d1c
Merge branch 'develop' of https://github.com/loryblu/loryblu-api into…
viniciuscosmome Sep 12, 2023
c96ec0c
chore: await send mail
viniciuscosmome Sep 12, 2023
525d4bf
feat: send link to reset password
viniciuscosmome Sep 12, 2023
3d63f9c
chore: changes description
viniciuscosmome Sep 12, 2023
040726a
test: create reset password tests
viniciuscosmome Sep 12, 2023
98bec0b
chore: changes setup
viniciuscosmome Sep 12, 2023
f6f54a2
chore: await save token
viniciuscosmome Sep 12, 2023
963f9d3
Merge pull request #10 from loryblu/LOR-116-feature-reset-password
viniciuscosmome Sep 13, 2023
7285f7d
styles: changes file name
viniciuscosmome Sep 14, 2023
ee9622b
styles: rename folders
viniciuscosmome Sep 14, 2023
87f29b2
feat: creates set password route
viniciuscosmome Sep 15, 2023
48f1f06
feat: saves the new password and deletes the old recovery token
viniciuscosmome Sep 15, 2023
5279ce1
refactor: changes the way errors are handled
viniciuscosmome Sep 15, 2023
b01b65e
refactor: move files
viniciuscosmome Sep 15, 2023
e16dc22
fix: sets 5 minutes to expires the token
viniciuscosmome Sep 15, 2023
843dfff
Merge pull request #11 from viniciuscosmome/feature/set-new-password
viniciuscosmome Sep 16, 2023
eb5c2f2
chore: update config (#12)
viniciuscosmome Sep 19, 2023
226b0d1
Update README.md
lauanegcsilva Sep 20, 2023
0f8a5d6
Update README.md
lauanegcsilva Sep 20, 2023
22de532
Merge branch 'develop' of https://github.com/loryblu/loryblu-api into…
lauanegcsilva Sep 20, 2023
dcd75fc
Update README.md
lauanegcsilva Sep 20, 2023
4b610eb
Update README.md
lauanegcsilva Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 138 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ MAIL_TEST_BOUNCED=[Email para teste : erro]
MAIL_TEST_COMPLAINED=[Email para teste : marcado como spam]
# ex: [email protected]

POSTGRES_USER=[Nome de usuário do baco de dados]
POSTGRES_USER=[Nome de usuário do banco de dados]

# ex: admin

POSTGRES_PASSWORD=[Senha do banco de dados]
Expand Down Expand Up @@ -87,7 +88,8 @@ $ git submodule update --init --recursive

### Dependências

Depois de clonar e semple que atualizar o repositório, execute o comando abaixo para manter as dependências atualizadas.
Depois de clonar e sempre que atualizar o repositório, execute o comando abaixo para manter as dependências atualizadas.

```bash
$ yarn
```
Expand Down Expand Up @@ -138,3 +140,137 @@ $ yarn test
LoryBlu tem [licença MIT](LICENSE).

</details>


Description in <b>en</b>

### Requirements
1. [Node.js 18.x LTS](https://nodejs.org/en) Installed.
1. [PostgreSQL](https://www.postgresql.org/) or [docker + docker-compose](https://docs.docker.com/compose/) installed.
1. [Resend](https://resend.com/home) Email service used in the application.

> ⚠ If you have `docker` and `docker-compose` intalled, you do not need to install `PostgreSQL` (database), there is a configured file to use PostgreSQL in docker, `docker-compose.dev.yml`

## Clone the repository

Testes unitários
```bash

# git clone <repo-url> <dist>
git clone https://github.com/loryblu/loryblu-api.git loryblu-api
```

This comamnd will clone the repository to the specified destination. You can omit the destination.

## Set up the enviroment
1. Duplicate the `.env.example` file from the main project;
1. Rename it to `.env`;

Update the new `.env` with the following instructions:
```md
# Replace the examples inside square brackets "[Database username]" with the final value "root"

PORT=[Port that the server exposes]
# e.g.: 8080

NODE_ENV=[Current environment]
# e.g.: development

SALT_DATA_HASH=[Secret key to merge with the sensitive data hash]
# e.g.: secret.salt.data

SALT_DATA_PASS=[Secret key to randomize the password]
# e.g.: 8

MAIL_API_KEY=[Resend service key]
# e.g.: re_123456789

MAIL_FROM=[Application contact email]
# e.g.: [email protected]

MAIL_TEST_DELIVERED=[Test email : success]
# e.g.: [email protected]

MAIL_TEST_BOUNCED=[Test email : error]
# e.g.: [email protected]

MAIL_TEST_COMPLAINED=[Test email: marked as spam]
# e.g.: [email protected]

POSTGRES_USER=[Database username]
# e.g.: admin

POSTGRES_PASSWORD=[Database password]
# e.g.: strongPass

POSTGRES_DB=[Database name]
# e.g.: loryblu-clone-api

POSTGRES_HOST=[Database host]
# e.g.: localhost

POSTGRES_PORT=[Database port]
# e.g.: 5432

DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public"
# ! This value does not need to be changed, use it as is.
```

## Installation
### Submodules
After cloning this repository, and if one of the submodules is added or updated, run the following command to update and initialize all submodules.
```bash
$ git submodule update --init --recursive
```

### Dependencies

After cloning and whenever you update the repository, run the following command to keep the dependencies up to date.
```bash
$ yarn
```

## Running the application

<details>
<summary><b>Are you using Docker?</b></summary>

Use the command below to download the PostgreSQL:14-alpine image and configure the credentials.
```bash
docker-compose -f docker-compose.dev.yml up -d
```

If you prefer, there is a script configured to perform this command and all other development commands. It also starts the application:
```bash
yarn docker:dev
```

</details>

---

This command performs everything necessary to set up the development database.
```bash
$ yarn dev
```

This command only starts the application in development mode.
```bash
$ yarn start:dev
```

This command starts the application in production mode.
```bash
$ yarn run start:prod
```

## Tests

Unit tests
```bash
$ yarn test
```

## License

LoryBlu has [licença MIT](LICENSE).
Loading