https://github.com/rodrigogs/barracao-digital
Sistema de gerenciamento de fila virtual para os barracões de atendimento do COVID-19
https://github.com/rodrigogs/barracao-digital
backend coronavirus covid covid-19 frontend healthcare medical nodejs pandemic serverless serverless-framework vue
Last synced: 3 months ago
JSON representation
Sistema de gerenciamento de fila virtual para os barracões de atendimento do COVID-19
- Host: GitHub
- URL: https://github.com/rodrigogs/barracao-digital
- Owner: rodrigogs
- License: bsd-3-clause
- Created: 2020-03-23T03:29:30.000Z (about 6 years ago)
- Default Branch: development
- Last Pushed: 2023-01-27T02:15:18.000Z (about 3 years ago)
- Last Synced: 2024-04-14T11:09:23.088Z (almost 2 years ago)
- Topics: backend, coronavirus, covid, covid-19, frontend, healthcare, medical, nodejs, pandemic, serverless, serverless-framework, vue
- Language: Vue
- Homepage: https://barracaodigital.com
- Size: 12 MB
- Stars: 9
- Watchers: 6
- Forks: 1
- Open Issues: 65
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Barracão Digital](https://barracaodigital.com)
Estruturação rápida de “postos de triagem” virtuais descentralizados para redução de visitas desnecessárias às emergências
# Informações técnicas
### Status
| Production | Development |
|:----------:|:-----------:|
| [](https://travis-ci.com/rodrigogs/barracao-digital) | [](https://travis-ci.com/rodrigogs/barracao-digital) |
### Setup
**Make sure `bash` is available from your terminal**
```bash
$ npm install serverless -g
$ serverless login
$ npm install
```
### Deploying a new stage
*DANGER* you must know exactly what you are doing here!
- Log into your [Serverless Dashboard](https://dashboard.serverless.com/) and create a new app reflecting serverless.yml "service" field
- Deploy the frontend, it's needed to create the CloudFront distribution
```bash
$ NODE_ENV={stage_name} npm run deploy:frontend
```
- [Create a distribution](https://console.aws.amazon.com/cloudfront/home?region=sa-east-1#create-distribution) pointing to the frontend bucket
- Don't forget to create a custom error response for 404 and other errors
- Create a Route53 Hosted Zone with the api host
- Create the APIGateway domain
```bash
$ NODE_ENV={stage_name} sls create_domain
```
- Verify if the serverless.yml `provider.deploymentBucket.name` bucket exists. Create if needed.
- Deploy the service
```bash
$ serverless deploy
```
### Deploy
#### Frontend & backend
```bash
$ NODE_ENV=development|production npm run deploy
```
#### Frontend
```bash
$ NODE_ENV=development|production npm run deploy:frontend
```
#### Backend
```bash
$ NODE_ENV=development|production npm run deploy:backend
```
### Troubleshooting
#### Got `User is not authorized to access this resource` when using the API
* Open the [AWS Console](https://console.aws.amazon.com/console), open the [API Gateway](https://console.aws.amazon.com/apigateway) service and find your deployed service
* Navigate to `Authorizers` tab and you shall see the `authorizer`
* Click `Edit`, check `Authorization Caching` and click `Save`

* Click `Edit` again, uncheck `Authorization Caching` and click `Save`
* Redeploy the application
* Yes, it sucks!