-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from isd-sgcu/user
User Svc
- Loading branch information
Showing
18 changed files
with
721 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
APP_PORT=3001 | ||
APP_ENV=development | ||
APP_MAX_FILE_SIZE_MB=10 | ||
|
||
SERVICE_AUTH=auth:3002 | ||
SERVICE_BACKEND=backend:3003 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,5 @@ coverage.out | |
coverage.html | ||
|
||
tmp | ||
staff.json | ||
staff.json | ||
docker-compose.qa.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,49 @@ | ||
# rpkm67-gateway | ||
|
||
## Stack | ||
|
||
- golang | ||
- gRPC | ||
- postgresql | ||
- redis | ||
- minio | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
- 💻 | ||
- golang 1.22 or [later](https://go.dev) | ||
- docker | ||
- makefile | ||
- [Go Air](https://github.com/air-verse/air) | ||
|
||
### Installation | ||
|
||
1. Clone this repo | ||
2. Run `go mod download` to download all the dependencies. | ||
|
||
### Running only this service | ||
1. Copy `.env.template` and paste it in the same directory as `.env`. Fill in the appropriate values. | ||
2. Run `make docker`. | ||
3. Run `make server` or `air` for hot-reload. | ||
|
||
### Running all RPKM67 services (all other services are run as containers) | ||
1. Copy `docker-compose.qa.template.yml` and paste it in the same directory as `docker-compose.qa.yml`. Fill in the appropriate values. | ||
2. Run `make pull-latest-mac` or `make pull-latest-windows` to pull the latest images of other services. | ||
1. Run `make docker-qa`. | ||
2. Run `make server` or `air` for hot-reload. | ||
|
||
### Unit Testing | ||
1. Run `make test` | ||
|
||
## Other microservices/repositories of RPKM67 | ||
- [gateway](https://github.com/isd-sgcu/rpkm67-gateway): Routing and request handling | ||
- [auth](https://github.com/isd-sgcu/rpkm67-auth): Authentication and user service | ||
- [backend](https://github.com/isd-sgcu/rpkm67-backend): Group, Baan selection and Stamp, Pin business logic | ||
- [checkin](https://github.com/isd-sgcu/rpkm67-checkin): Checkin for events service | ||
- [store](https://github.com/isd-sgcu/rpkm67-store): Object storage service for user profile pictures | ||
- [model](https://github.com/isd-sgcu/rpkm67-model): SQL table schema and models | ||
- [proto](https://github.com/isd-sgcu/rpkm67-proto): Protobuf files generator | ||
- [go-proto](https://github.com/isd-sgcu/rpkm67-go-proto): Generated protobuf files for golang | ||
- [frontend](https://github.com/isd-sgcu/firstdate-rpkm67-frontend): Frontend web application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package constant | ||
|
||
var AllowedContentType = map[string]struct{}{ | ||
"image/jpeg": {}, | ||
"image/jpg": {}, | ||
"image/png": {}, | ||
"image/gif": {}, | ||
"image/webp": {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
version: "3.9" | ||
|
||
services: | ||
# gateway: | ||
# image: ghcr.io/isd-sgcu/rpkm67-gateway:latest | ||
# container_name: gateway | ||
# restart: unless-stopped | ||
# environment: | ||
# APP_PORT: 3001 | ||
# APP_ENV: development | ||
# APP_MAX_FILE_SIZE_MB: 10 | ||
# CORS_ORIGINS: http://localhost:3000 | ||
# SERVICE_AUTH: http://localhost:3002 | ||
# SERVICE_BACKEND: backend:3003 | ||
# SERVICE_CHECKIN: checkin:3004 | ||
# SERVICE_STORE: store:3005 | ||
# networks: | ||
# - rpkm67 | ||
# ports: | ||
# - "3001:3001" | ||
|
||
auth: | ||
image: ghcr.io/isd-sgcu/rpkm67-auth:latest | ||
container_name: auth | ||
restart: unless-stopped | ||
environment: | ||
APP_PORT: 3002 | ||
APP_ENV: development | ||
DB_URL: postgres://root:1234@db:5432/rpkm67_db | ||
REDIS_HOST: localhost | ||
REDIS_PORT: 6379 | ||
REDIS_PASSWORD: 5678 | ||
JWT_SECRET: secret | ||
JWT_ACCESS_TTL: 3600 | ||
JWT_REFRESH_TTL: 259200 | ||
JWT_ISSUER: rpkm67.sgcu.in.th | ||
JWT_RESET_TOKEN_TTL: 900 | ||
networks: | ||
- rpkm67 | ||
ports: | ||
- "3002:3002" | ||
|
||
backend: | ||
image: ghcr.io/isd-sgcu/rpkm67-backend:latest | ||
container_name: backend | ||
restart: unless-stopped | ||
environment: | ||
APP_PORT: 3003 | ||
APP_ENV: development | ||
DB_URL: postgres://root:1234@db:5432/rpkm67_db | ||
REDIS_HOST: cache | ||
REDIS_PORT: 6379 | ||
REDIS_PASSWORD: 5678 | ||
PIN_WORKSHOP_CODE: workshop | ||
PIN_WORKSHOP_COUNT: 5 | ||
PIN_LANDMARK_CODE: landmark | ||
PIN_LANDMARK_COUNT: 4 | ||
networks: | ||
- rpkm67 | ||
ports: | ||
- "3003:3003" | ||
|
||
checkin: | ||
image: ghcr.io/isd-sgcu/rpkm67-checkin:latest | ||
container_name: checkin | ||
restart: unless-stopped | ||
environment: | ||
APP_PORT: 3004 | ||
APP_ENV: development | ||
DB_URL: postgres://root:1234@db:5432/rpkm67_db | ||
networks: | ||
- rpkm67 | ||
ports: | ||
- "3004:3004" | ||
|
||
store: | ||
image: ghcr.io/isd-sgcu/rpkm67-store:latest | ||
container_name: store | ||
restart: unless-stopped | ||
environment: | ||
APP_PORT: 3005 | ||
APP_ENV: development | ||
APP_MAX_FILE_SIZE_MB: 20 | ||
STORE_ENDPOINT: endpoint | ||
STORE_ACCESS_KEY: access_key | ||
STORE_SECRET_KEY: secret_key | ||
STORE_USE_SSL: true | ||
STORE_BUCKET_NAME: rpkm67-local | ||
networks: | ||
- rpkm67 | ||
ports: | ||
- "3005:3005" | ||
|
||
db: | ||
image: postgres:15.1-alpine3.17 | ||
container_name: db | ||
restart: unless-stopped | ||
environment: | ||
POSTGRES_USER: root | ||
POSTGRES_PASSWORD: "1234" | ||
POSTGRES_DB: rpkm67_db | ||
networks: | ||
- rpkm67 | ||
volumes: | ||
- ./volumes/postgres:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
|
||
cache: | ||
image: redis:7.2.3-alpine | ||
container_name: cache | ||
restart: unless-stopped | ||
environment: | ||
REDIS_HOST: localhost | ||
REDIS_PASSWORD: "5678" | ||
networks: | ||
- rpkm67 | ||
ports: | ||
- "6379:6379" | ||
|
||
networks: | ||
rpkm67: | ||
name: rpkm67 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.