Skip to content
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
8 changes: 8 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copying to .env local

# DB variables for the connection
DB_USER=root
DB_PASSWORD=root
DB_NAME=db
DB_HOST=postgres
DB_PORT=5432
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,11 @@ Build: Update Travis to only test Node 0.10 (refs #734)
Fix: Semi rule incorrectly flagging extra semicolon (fixes #840)
Upgrade: Esprima to 1.2, switch to using comment attachment (fixes #730)
```

## Branch naming convention

The branch should have a name that reflects it's purpose.

The convention is to prefix the branch name with feature-. All the words must be separated by a -.

Branch name example : feature-user-authentication

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour les noms de branch je proposerais plus un "/" après le type de branch (feature, fix etc.)
A voir l'avis général

Ex: feature/user-authentication

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for me i prefer the naming convention with "/"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moi ça me va si tout le monde est d'accord :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Et pour la séparation des mots - ou _ ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"-"

25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
test:
go test -v ./...

.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


init: ## Init environment and starts docker app
make copy-files
make start

copy-files: ## Copy files
bash -c "cp .env.dist .env"

start: ## start the app
docker-compose up --build -d

stop: ## stop the app
docker-compose stop

first-run: ## The command you run when you launch the project for the first time, creates your go mod and make init
go mod init
go mod tidy
make init
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# MT5 P2021 Framework 💀
Year project for MT5

## Requirements

To run this project you'll need to have docker and yarn installed on your machine.
If you want to develop on this project it's recommended to have `golang` and `docker` installed on your machine.

## Project setup

First time you run the project ? Run :

```sh
make first-run
```

This command creates the go mod and tidies dependencies and then call the make init command.

> If you want more informations about the available make commands, run `make help`

If you already have the go.mod and go.sum files you can run :

```sh
make init
# or
make start
```

## Contributing

Please read [CONTRIBUTING.md](https://github.com/HETIC-MT-P2021/framework_project/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
Expand Down
55 changes: 55 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: '3'
services:
api:
build:
context: .
dockerfile: docker/go/Dockerfile
ports:
- 8000:8000
restart: on-failure
volumes:
- ./:/go/src/github.com/HETIC-MT-P2021/framework_project
depends_on:
- postgres
networks:
- backend
environment:
- DB_USER=root
- DB_PASSWORD=root
- DB_NAME=db
- DB_HOST=postgres
- DB_PORT=5432

postgres:
image: postgres:latest
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=db
- DATABASE_HOST=postgres
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
networks:
- backend

adminer:
image: adminer
restart: always
ports:
- 8080:8080
depends_on:
- postgres
networks:
- backend
restart: unless-stopped

volumes:
api:
postgres:

# Networks to be created to facilitate communication between containers
networks:
backend:
driver: bridge