-
Notifications
You must be signed in to change notification settings - Fork 12
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 #61 from ufosc/feature/refactor-nest
Feature/refactor nest
- Loading branch information
Showing
67 changed files
with
6,326 additions
and
620 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 |
---|---|---|
|
@@ -12,4 +12,6 @@ | |
!websocket/ | ||
!packages/ | ||
!src/ | ||
!nest-cli.json | ||
!nest-cli.json | ||
!api/ | ||
!proxy/ |
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 |
---|---|---|
|
@@ -18,47 +18,74 @@ services: | |
- BASE_URL=http://localhost:8080 | ||
- SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID} | ||
- SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET} | ||
- PROXY_URL=http://proxy:8080 | ||
- DB_HOST=jbx-network-db | ||
- DB_PORT=5432 | ||
- DB_USER=devuser | ||
- DB_PASS=devpass | ||
- DB_NAME=devdatabase | ||
ports: | ||
- 9000:9000 | ||
depends_on: | ||
- mongodb | ||
- postgres | ||
- pgadmin | ||
- kafka | ||
volumes: | ||
- ./src:/app/src | ||
- ./package.json:/app/package.json | ||
- ./generated:/app/generated | ||
# - api-spec:/app/generated | ||
command: npm run start:network | ||
|
||
proxy: | ||
build: | ||
context: ./proxy/ | ||
ports: | ||
- 8080:8080 | ||
- 8081:8081 | ||
networks: | ||
- cluster | ||
depends_on: | ||
- server | ||
|
||
volumes: | ||
- client-dist:/vol/client | ||
- club-static:/vol/static | ||
- ./proxy/api:/vol/apispec | ||
environment: | ||
- SERVER_URI=server-jbx:9000 | ||
- WEBSOCKET_URI=server-jbx:9000 | ||
- CLUB_MANAGER_URI=club-app-network:9000 | ||
|
||
# attach: false | ||
|
||
mongodb: | ||
image: mongo:6.0.9 | ||
postgres: | ||
image: postgres:13-alpine | ||
container_name: jbx-network-db | ||
volumes: | ||
- jukebox-network-pg-data:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_DB=devdatabase | ||
- POSTGRES_USER=devuser | ||
- POSTGRES_PASSWORD=devpass | ||
networks: | ||
- cluster | ||
|
||
pgadmin: | ||
image: dpage/pgadmin4 | ||
container_name: jbx-netork-pgadmin | ||
restart: always | ||
container_name: mongo-network-jbx | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- mongo-data:/data/db | ||
- "8888:80" | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=root | ||
- MONGO_INITDB_ROOT_PASSWORD=changeme | ||
command: mongod --quiet --logpath /dev/null --bind_ip_all | ||
- [email protected] | ||
- PGADMIN_DEFAULT_PASSWORD=changeme | ||
# - PGADMIN_SERVER_MODE=True | ||
- PGADMIN_CONFIG_DATABASE_URI="postgresql://devuser:devpass@jbx-network-db:5432/devdatabase" | ||
# - PGADMIN_SQLITE_PATH='/var/lib/sqlite' | ||
|
||
volumes: | ||
- pgadmin-network-data:/var/lib/pgadmin | ||
networks: | ||
- cluster | ||
|
||
|
@@ -113,10 +140,10 @@ services: | |
volumes: | ||
client-dist: | ||
name: client-dist | ||
mongo-data: | ||
jukebox-network-pg-data: | ||
club-static: | ||
name: club-static | ||
# external: true | ||
pgadmin-network-data: | ||
|
||
networks: | ||
cluster: | ||
|
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,10 +1,7 @@ | ||
# Project Conventions | ||
|
||
## Objects, Models, Schemas | ||
## Objects, Entities, DTOs | ||
|
||
When handling objects in typescript, often it is useful to know if the object represents minimum fields required for creation, or the full list of fields given from the model serialization process. When differentiating between the two, stick with this convention: | ||
|
||
For some model named `Model`, | ||
|
||
- Use `IModel` to describe all possible fields, including the ID field | ||
- Use `IModelFields` to describe fields needed when creating the model. | ||
1. Data Transfer Objects (DTOs) dictate shape of data on server ingres/egress (api requests, responses, kafka events, websockets, etc). DTOs determine **inter-service** data contracts. | ||
2. Entities dictate shape of data within the server, between controllers, services, etc. Entities determine **intra-service** data contracts. | ||
3. Use `snake_case` for fields of data objects that are stored inside a database, or passed into/out of the API. This keeps consistency with patterns used across other technologies like Django, Postgres, etc. |
Oops, something went wrong.