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 makefile #118

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cf6d152
Makefile
ppastorf May 10, 2024
eed5cb3
usando diretivas de Makefile no workflow de deploy
ppastorf May 10, 2024
df1909b
Makefile: rebase com alteracoes no readme
ppastorf May 11, 2024
33c16ae
doc: adicionando make para inclui comandos para facilitar o setup da …
HelioDantas May 15, 2024
f6eed88
build: add-makefile - instalar makefile para usos dentro do container…
HelioDantas May 15, 2024
fc75fd2
doc: removendo descrição duplicada
HelioDantas May 15, 2024
5e72d2f
docs: improve readme file with discord link
RogerioPiatek May 12, 2024
e5148ff
docs: updated to the link 'discord.gg/sosrs'
RogerioPiatek May 13, 2024
9380c9c
docs: changed discord link position
filipepacheco May 13, 2024
1210f82
docs: add templeate for PR
LeoFC97 May 11, 2024
f1416e5
feat: only show contact on shelter public routes on authorized roles
kelvinsb May 11, 2024
e2c6242
fix: remove unused and unauthorized contact field on list route
kelvinsb May 11, 2024
e23440c
feat: return contact when user logged, instead of some Roles
kelvinsb May 12, 2024
1bd35da
fix: suggestions about separation
kelvinsb May 13, 2024
6f8b860
Criação do endpoint para busca de cidades dos abrigos (#82)
AndersonCRocha May 13, 2024
391607a
feat: add shelter filter by geolocation radius (#93)
AndersonCRocha May 14, 2024
e8e3607
Fixing discord link on Readme (#95)
filipepacheco May 14, 2024
a81c9b6
feat: added default updated at in new shelter to avoid null field in …
fagundesjg May 14, 2024
ce67813
hotfix: login issue
fagundesjg May 14, 2024
9732790
Fix tests (#78)
giggio May 14, 2024
0e1a7a1
feat: added partners endpoint (#106)
fagundesjg May 15, 2024
b62302d
fix: Correção da issue #146 do frontend. (#105)
kevinpiske May 15, 2024
591eca2
feat: Add description and including a bearer token in swagger in user…
w-araujo May 15, 2024
037479c
fix: city filter (#116)
fagundesjg May 15, 2024
e18bbfa
doc: adicionando make para inclui comandos para facilitar o setup da …
HelioDantas May 15, 2024
d418b27
build: add-makefile - instalar makefile para usos dentro do container…
HelioDantas May 15, 2024
9d2c144
doc: removendo descrição duplicada
HelioDantas May 15, 2024
0199bcc
Merge branch 'feat/add-makefile' of https://github.com/HelioDantas/ba…
HelioDantas May 16, 2024
c743a8c
doc: colocando comandos makes no formato de tabela
HelioDantas May 18, 2024
fe4816b
fix: corrigindo comando make para rodar as migrations
HelioDantas May 18, 2024
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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:18.18-alpine as node

RUN apk add --no-cache make

WORKDIR /usr/app

COPY package.json package-lock.json ./
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ autenticação de usuários, gerenciamento de abrigos e suprimentos, e muito mai
Se você quiser discutir ideias, problemas ou contribuições, sinta-se à vontade para se juntar ao nosso servidor do
Discord [aqui](https://discord.gg/vjZS6BQXvM).

## Workspace Dependencies
- [Node 18.18](https://nodejs.org/)
- [Docker](https://www.docker.com/get-started/)
- Make
- [Windows](https://gnuwin32.sourceforge.net/packages/make.htm)
- Linux
```bash
sudo apt update
sudo apt install make
```

## 🛠 Tecnologias Utilizadas

- **🟢 Node.js**: Ambiente de execução para JavaScript.
Expand Down Expand Up @@ -50,6 +61,11 @@ ports:
- '5432:5432'
- '4000:4000'
```
Usando make:

```bash
make setupDocker
```

## 🚀 Configuração Inicial Local

Expand All @@ -58,14 +74,23 @@ ports:
git clone https://github.com/seuusuario/projeto-enchentes-backend.git
```
2. Instale as dependências:

```bash
make setup

# ou sem make

npm install
npx prisma generate
npx prisma migrate dev
npm run start:dev
```
3. Inicie o servidor:
```bash
make up

# ou sem make

npm start
```
A API estará disponível em `http://localhost:4000`.
Expand Down Expand Up @@ -100,6 +125,14 @@ ports:
- **📝 POST /supply-categories** - Registra uma nova categoria de suprimentos.
- **🔧 PUT /supply-categories/:categoryId** - Atualiza uma categoria.

## Make commands
### Using Docker
- Inicia Projeto sem docker: `make setup`.
- Inicia Projeto com docker: `make setupDocker`.
- Start Projeto sem docker: `make up`
- Start Projeto com docker: `make upDockerDev`
- Acessar container bash: `make bash`

## 🤝 Contribuição

Contribuições são muito bem-vindas! Se deseja ajudar, faça um fork do repositório, crie uma branch com suas
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
- PORT=${PORT}
command: >
sh -c "npm install &&
apk add --no-cache make &&
npx prisma generate &&
npx prisma migrate dev &&
npm run start:dev -- --preserveWatchOutput"
Expand Down
42 changes: 42 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

CONTAINER_BACKEND = sos-rs-api

fileMode:
@echo "Configuring git fileMode to false"
git config core.fileMode false

create.env.file:
if [ ! -f .env ]; then \
cp .env.local .env; \
fi

upDockerDev:
docker-compose -f docker-compose.dev.yml up

setupDocker:
make fileMode
make create.env.file
make upDockerDev

settingsWithoutDocker:
make fileMode
make create.env.file
npm install
npx prisma generate
npx prisma migrate dev

upDev:
npm run start:dev

setup:
make settingsWithoutDocker
make upDev

bash:
docker exec -it ${CONTAINER_BACKEND} sh

.PHONY: up
up:
npm start