Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .example.client.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SERVER_URL=http://localhost:3000
CLIENT_HOST=0.0.0.0
CLIENT_PORT=3001
23 changes: 23 additions & 0 deletions .example.docker.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
DEVELOPMENT_DB_HOST=db-dev
DEVELOPMENT_DB_PORT=5432
DEVELOPMENT_DB_USER=dev_user
DEVELOPMENT_DB_PASSWORD=dev_password
DEVELOPMENT_DB_DATABASE=gh_db_dev

TEST_DB_HOST=db-test
TEST_DB_PORT=5432
TEST_DB_USER=test_user
TEST_DB_PASSWORD=test_password
TEST_DB_DATABASE=gh_db_test

PRODUCTION_DB_HOST=db-prod
PRODUCTION_DB_PORT=5432
PRODUCTION_DB_USER=prod_user
PRODUCTION_DB_PASSWORD=prod_password
PRODUCTION_DB_DATABASE=gh_db_prod

E2E_DB_HOST=db-e2e
E2E_DB_PORT=5432
E2E_DB_USER=e2e_user
E2E_DB_PASSWORD=e2e_password
E2E_DB_DATABASE=gh_db_e2e
26 changes: 26 additions & 0 deletions .example.server.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SERVER_HOST=http://localhost
SERVER_PORT=3000

DEVELOPMENT_DB_HOST=db-dev
DEVELOPMENT_DB_PORT=5432
DEVELOPMENT_DB_USER=dev_user
DEVELOPMENT_DB_PASSWORD=dev_password
DEVELOPMENT_DB_DATABASE=gh_db_dev

TEST_DB_HOST=db-test
TEST_DB_PORT=5432
TEST_DB_USER=test_user
TEST_DB_PASSWORD=test_password
TEST_DB_DATABASE=gh_db_test

PRODUCTION_DB_HOST=db-prod
PRODUCTION_DB_PORT=5432
PRODUCTION_DB_USER=prod_user
PRODUCTION_DB_PASSWORD=prod_password
PRODUCTION_DB_DATABASE=gh_db_prod

E2E_DB_HOST=db-e2e
E2E_DB_PORT=5432
E2E_DB_USER=e2e_user
E2E_DB_PASSWORD=e2e_password
E2E_DB_DATABASE=gh_db_e2e
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
node_modules
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,69 @@ Alguns requisitos:
Quando terminar, faça um Pull Request neste repo e avise-nos por email.

**IMPORTANTE:** se você não conseguir finalizar o teste, por favor nos diga o motivo e descreva quais foram as suas dificuldades. Você pode também sugerir uma outra abordagem para avaliarmos seus skills técnicos, vender seu peixe, mostrar-nos do que é capaz.

# Livesite

https://gmtc.com.br

# Stack utilizada

* Client: Nuxt.js
* Server: Express.js
* Database: PostgreSQL
* Testes: Mocha + Chai + Cypress

# Inicializar projeto localmente

**Requisitos:** docker e docker-compose instalados

- Carregar as envs de exemplo

```sh
sh load-envs.sh
```

## Modo dev

```sh
docker-compose -f docker-compose-dev.yml up
```

## Modo test

```sh
docker-compose -f docker-compose-test.yml up
```

## Modo production

```sh
docker-compose -f docker-compose-build.yml up
docker-compose -f docker-compose-prod.yml up
```

## Testes e2e com cypress

- Instalar cypress na pasta raiz do projeto

```sh
npm i
```

- Ligar projeto com:

```sh
docker-compose -f docker-compose-e2e.yml up -d && npx cypress open
```

ou

```sh
docker-compose -f docker-compose-e2e.yml up
```

e em outro terminal

```sh
npx cypress open
```
13 changes: 13 additions & 0 deletions client/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
90 changes: 90 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE / Editor
.idea

# Service worker
sw.*

# macOS
.DS_Store

# Vim swap files
*.swp
69 changes: 69 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# dev-hiring-challenge-client

## Build Setup

```bash
# install dependencies
$ npm install

# serve with hot reload at localhost:3000
$ npm run dev

# build for production and launch server
$ npm run build
$ npm run start

# generate static project
$ npm run generate
```

For detailed explanation on how things work, check out the [documentation](https://nuxtjs.org).

## Special Directories

You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality.

### `assets`

The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets).

### `components`

The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components).

### `layouts`

Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts).


### `pages`

This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing).

### `plugins`

The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins).

### `static`

This directory contains your static files. Each file inside this directory is mapped to `/`.

Example: `/static/robots.txt` is mapped as `/robots.txt`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static).

### `store`

This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/store).
5 changes: 5 additions & 0 deletions client/assets/scss/colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$blue: #3B65FC;
$light-gray: #f8faff;
$gray: #e5eaf8;
$dark-gray: #aaaaaa;
$darker-gray: #636363;
1 change: 1 addition & 0 deletions client/assets/scss/fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url('https://fonts.googleapis.com/css2?family=Sora');
17 changes: 17 additions & 0 deletions client/assets/scss/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@import 'mixins.scss';
@import 'colors.scss';
@import 'fonts.scss';

body {
margin: 0px;
}

a {
color: black;
text-decoration: none;
font-size: 1rem;
}

.loading {
@include loading-component;
}
34 changes: 34 additions & 0 deletions client/assets/scss/mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@mixin loading-component {
display: flex;
.loading-text {
margin-right: 1rem;
}
.loader {
width: 1rem;
height: 1rem;
border: 2px solid black;
border-top-color: lightgray;
border-radius: 50%;
animation: rotate ease 1s infinite;
}
@keyframes rotate {
to {
transform: rotate(360deg);
}
}
}

@mixin button-component {
background-color: $blue;
height: 3rem;
border: 1px solid $gray;
border-radius: .3rem;
color: white;
transition: .1s;
font-size: 1rem;
&:hover {
cursor: pointer;
background-color: lighten($blue, 10%);
font-size: 1.02rem;
}
}
Loading