Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from floriaaan/gateway
Browse files Browse the repository at this point in the history
add gateway to dev branch
  • Loading branch information
floriaaan authored Oct 18, 2023
2 parents ecbf6e9 + cb8658d commit b6ab7a7
Show file tree
Hide file tree
Showing 267 changed files with 49,001 additions and 836 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/gateway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Gateway CI/CD

on:
push:
branches: [gateway]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: pnpm/action-setup@v2
with:
version: latest
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "pnpm"
cache-dependency-path: services/gateway/pnpm-lock.yaml
- name: Install dependencies
run: |
cd ./services/gateway
pnpm install --frozen-lockfile
- name: Build protos
run: |
cd ./services/gateway
pnpm build:proto
- name: Build
run: |
cd ./services/gateway
pnpm build
# test:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - uses: actions/checkout@master
# - uses: pnpm/action-setup@v2
# with:
# version: latest
# - uses: actions/setup-node@v3
# with:
# node-version: "18.x"
# cache: "pnpm"
# cache-dependency-path: services/gateway/pnpm-lock.yaml
# - name: Install dependencies
# run: |
# cd ./services/gateway
# pnpm install --frozen-lockfile
# - name: Execute tests
# run: |
# cd ./services/gateway
# pnpm test

publish:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./services/
file: ./services/gateway/Dockerfile
push: true
tags: floriaaan/goodfood-gateway:latest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,7 @@ terraform.rc

# expo cache files
/apps/mobile/.expo

# next.js
/apps/web/.next
/apps/web/next-env.d.ts
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ a high volume of concurrent users, up to several thousand.

| Service | Port | Language | Database | Status | Assignee |
| ------------ | ----- | ----------- | ---------- | ------ | --------------- |
| Gateway | 50000 | Go || | @Anatole-Godard |
| Gateway | 50000 | Go || ⚠️ | @Anatole-Godard |
| User (auth) | 50001 | Go | PostgreSQL | ⚠️ | @Anatole-Godard |
| Basket | 50002 | NodeJS (ts) | Redis | ⚠️ | @Anatole-Godard |
| Payment | 50003 | NodeJS (ts) | PostgreSQL || @floriaaan |
| Product | 50004 | NodeJS (ts) | PostgreSQL | | @PierreLbg |
| Restaurant | 50005 | NodeJS (ts) | PostgreSQL | | @floriaaan |
| Promotion | 50006 | NodeJS (ts) | PostgreSQL | | @PierreLbg |
| Product | 50004 | NodeJS (ts) | PostgreSQL | ⚠️ | @PierreLbg |
| Restaurant | 50005 | NodeJS (ts) | PostgreSQL | | @floriaaan |
| Promotion | 50006 | NodeJS (ts) | PostgreSQL | ⚠️ | @PierreLbg |
| Order | 50007 | NodeJS (ts) | PostgreSQL || @floriaaan |
| Delivery | 50008 | NodeJS (ts) | PostgreSQL || @floriaaan |
| Stock | 50009 | NodeJS (ts) | PostgreSQL | ⚠️ | @floriaaan |
Expand Down Expand Up @@ -67,6 +67,20 @@ The file hierarchy for this project is as follows:

## Installation & usage

### Docker

You can use Docker to run the microservices and the gateway.

To do so, you will need to have Docker installed on your system.

You can then run the following command to start the microservices and the gateway:

```shell
docker-compose up -f services/docker-compose.yml -d --build
```

### Development

Each service has its own README.md file with installation and usage instructions.

Please refer to the README.md file of the service you want to install and use.
Expand Down
11 changes: 11 additions & 0 deletions requests/allergen/delete allergen :id.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: delete allergen by id
type: http
seq: 2
}

delete {
url: {{baseUrl}}/api/allergen/:id
body: none
auth: none
}
21 changes: 21 additions & 0 deletions requests/allergen/post allergen.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
meta {
name: create allergen
type: http
seq: 1
}

post {
url: {{baseUrl}}/api/allergen
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"label": "<string>"
}
}
11 changes: 11 additions & 0 deletions requests/basket/get basket.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: get basket
type: http
seq: 1
}

get {
url: {{baseUrl}}/api/basket/
body: none
auth: none
}
22 changes: 22 additions & 0 deletions requests/basket/post basket.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
meta {
name: create basket
type: http
seq: 2
}

post {
url: {{baseUrl}}/api/basket
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"productId": "<string>",
"restaurantId": "<string>"
}
}
11 changes: 11 additions & 0 deletions requests/basket/post reset.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: reset basket
type: http
seq: 1
}

post {
url: {{baseUrl}}/api/basket/reset
body: none
auth: none
}
21 changes: 21 additions & 0 deletions requests/basket/put change restaurant.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
meta {
name: change selected restaurant
type: http
seq: 1
}

put {
url: {{baseUrl}}/api/basket/restaurant
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"restaurantId": "<string>"
}
}
22 changes: 22 additions & 0 deletions requests/basket/put remove product.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
meta {
name: remove product from basket
type: http
seq: 1
}

put {
url: {{baseUrl}}/api/basket/remove-product
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"productId": "<string>",
"restaurantId": "<string>"
}
}
5 changes: 5 additions & 0 deletions requests/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": "1",
"name": "Goodfood",
"type": "collection"
}
11 changes: 11 additions & 0 deletions requests/category/delete category :id.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: delete category by id
type: http
seq: 3
}

delete {
url: {{baseUrl}}/api/category/:id
body: none
auth: none
}
23 changes: 23 additions & 0 deletions requests/category/post category.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
meta {
name: create category
type: http
seq: 2
}

post {
url: {{baseUrl}}/api/category
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"label": "<string>",
"icon": "<string>",
"hexaColor": "<string>"
}
}
11 changes: 11 additions & 0 deletions requests/delivery-person/delete delivery-person :id.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: delete delivery person by id
type: http
seq: 3
}

delete {
url: {{baseUrl}}/api/delivery-person/:id
body: none
auth: none
}
11 changes: 11 additions & 0 deletions requests/delivery-person/get by-user.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: get delivery person by user token
type: http
seq: 1
}

get {
url: {{baseUrl}}/api/delivery-person/by-user
body: none
auth: none
}
16 changes: 16 additions & 0 deletions requests/delivery-person/get near.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: list near delivery persons
type: http
seq: 1
}

get {
url: {{baseUrl}}/api/delivery-person/near?lat=<integer>&lng=<integer>
body: none
auth: none
}

query {
lat: <integer>
lng: <integer>
}
27 changes: 27 additions & 0 deletions requests/delivery-person/post delivery-person.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
meta {
name: create delivery person
type: http
seq: 2
}

post {
url: {{baseUrl}}/api/delivery-person
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"locationList": [
"<number>",
"<number>"
]
}
}
11 changes: 11 additions & 0 deletions requests/delivery/delete delivery :id.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: delete delivery by id
type: http
seq: 3
}

delete {
url: {{baseUrl}}/api/delivery/:id
body: none
auth: none
}
11 changes: 11 additions & 0 deletions requests/delivery/get by-restaurant :id.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: list deliveries by restaurant id
type: http
seq: 1
}

get {
url: {{baseUrl}}/api/delivery/by-restaurant/:id
body: none
auth: none
}
11 changes: 11 additions & 0 deletions requests/delivery/get by-user :id.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: list deliveries by user
type: http
seq: 1
}

get {
url: {{baseUrl}}/api/delivery/by-user
body: none
auth: none
}
Loading

0 comments on commit b6ab7a7

Please sign in to comment.