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

Renamed webrtc service to multimedia #3

Merged
merged 1 commit into from
Nov 20, 2023
Merged
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
6 changes: 3 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ USERS_SERVICE_NAME=users
USERS_SERVICE_PORT=3000
USERS_SERVICE_URI=http://${USERS_SERVICE_NAME}:${USERS_SERVICE_PORT}

WEBRTC_SERVICE_NAME=webrtc
WEBRTC_SERVICE_PORT=3000
WEBRTC_SERVICE_URI=http://${WEBRTC_SERVICE_NAME}:${WEBRTC_SERVICE_PORT}
MULTIMEDIA_SERVICE_NAME=MULTIMEDIA
MULTIMEDIA_SERVICE_PORT=3000
MULTIMEDIA_SERVICE_URI=http://${MULTIMEDIA_SERVICE_NAME}:${MULTIMEDIA_SERVICE_PORT}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ COPY ./services/ ./services/
RUN ["rm", "-rf", "services/*/dist"]
COPY ./tsconfig.json ./tsconfig.json
RUN [ "npm", "install" ]
RUN [ "npm", "run", "--workspace", "services/frontend", "build", "--if-present" ]
# RUN [ "npm", "run", "--workspace", "services/frontend", "build", "--if-present" ]
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ docker compose \
-f ./services/notifications/docker-compose.yaml \
-f ./services/piperchat/docker-compose.yaml \
-f ./services/users/docker-compose.yaml \
-f ./services/webrtc/docker-compose.yaml \
-f ./services/multimedia/docker-compose.yaml \
-f ./dev/inspector.docker-compose.yaml \
up
2 changes: 1 addition & 1 deletion dev/inspector.docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ services:
notifications-network:
piperchat-network:
users-network:
webrtc-network:
multimedia-network:
backend:
frontend:
4,394 changes: 3,012 additions & 1,382 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"services/notifications",
"services/piperchat",
"services/users",
"services/webrtc"
"services/multimedia"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
GetChannelSessionIdApi,
GetDirectSessionIdApi,
GetUsersInSession
} from '@api/webrtc/session'
} from '@api/multimedia/session'
import type { Ref } from 'vue'

Check warning on line 10 in services/frontend/src/controllers/session/session-controller.ts

View workflow job for this annotation

GitHub Actions / style-and-lint

'Ref' is defined but never used

Check warning on line 10 in services/frontend/src/controllers/session/session-controller.ts

View workflow job for this annotation

GitHub Actions / style-and-lint

'Ref' is defined but never used
export interface SessionController {
getUsersInSession(sessionId: string): Promise<string[]>
getChannelSessionId(serverId: string, channelId: string): Promise<string>
Expand Down
2 changes: 1 addition & 1 deletion services/gateway/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
- notifications-service
- piperchat-service
- users-service
- webrtc-service
- multimedia-service
networks:
- frontend

Expand Down
2 changes: 1 addition & 1 deletion services/monitoring/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
- 'PORT=${MONITORING_SERVICE_PORT}'
- 'AMQP_URI=${BROKER_URI}'
- 'MONGO_URI=mongodb://db-monitoring-service:27017/monitoring'
- 'SERVICES_URI=${USERS_SERVICE_URI},${MESSAGES_SERVICE_URI},${PIPERCHAT_SERVICE_URI},${WEBRTC_SERVICE_URI},${NOTIFICATIONS_SERVICE_URI}'
- 'SERVICES_URI=${USERS_SERVICE_URI},${MESSAGES_SERVICE_URI},${PIPERCHAT_SERVICE_URI},${MULTIMEDIA_SERVICE_URI},${NOTIFICATIONS_SERVICE_URI}'
labels:
- |
traefik.http.routers.monitoring-service.rule=
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
services:
webrtc-service:
multimedia-service:
image: piperchat
command: ['npm', 'run', '--workspace', './services/webrtc', 'start']
command: ['npm', 'run', '--workspace', './services/multimedia', 'start']
expose:
- '${WEBRTC_SERVICE_PORT}'
- '${MULTIMEDIA_SERVICE_PORT}'
depends_on:
db-webrtc-service:
db-multimedia-service:
condition: service_healthy
broker:
condition: service_healthy
coturn:
condition: service_started
networks:
webrtc-network:
multimedia-network:
backend:
aliases:
- ${WEBRTC_SERVICE_NAME}
- ${MULTIMEDIA_SERVICE_NAME}
frontend:
environment:
- 'PORT=${WEBRTC_SERVICE_PORT}'
- 'PORT=${MULTIMEDIA_SERVICE_PORT}'
- 'AMQP_URI=${BROKER_URI}'
- 'MONGO_URI=mongodb://db-webrtc-service:27017/webrtc'
- 'MONGO_URI=mongodb://db-multimedia-service:27017/multimedia'
labels:
- |
traefik.http.routers.webrtc-service.rule=
traefik.http.routers.multimedia-service.rule=
(Method(`GET`) && PathPrefix(`/webrtc`)) ||
(Method(`GET`) && Path(`/users/{username:[^/]+}/session`))||
(Method(`GET`) && Path(`/servers/{serverId:[^/]+}/channels/{channelId:[^/]+}/session`))||
(Method(`GET`) && Path(`/sessions/{sessionId:[^/]+}`))

db-webrtc-service:
db-multimedia-service:
image: mongo
expose:
- '27017'
volumes:
- './.docker/db-webrtc:/data/db'
- './.docker/db-multimedia:/data/db'
healthcheck:
test: |
host=`hostname --ip-address || echo '127.0.0.1'`;
mongo --quiet $${host}/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
networks:
- webrtc-network
- multimedia-network

coturn:
image: flaviostutz/coturn
Expand All @@ -54,4 +54,4 @@ services:
- TURN_PASSWORD=coturn-password

networks:
webrtc-network:
multimedia-network:
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "webrtc",
"name": "@piperchat/multimedia",
"version": "1.0.0",
"description": "",
"main": "./src/app.ts",
Expand Down
5 changes: 5 additions & 0 deletions services/multimedia/src/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Microservice } from '@commons/service'
import { MultimediaServiceConfiguration } from './configuration'

const service = new Microservice(MultimediaServiceConfiguration)
service.start()
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DefaultMiddlewares, MicroserviceConfiguration } from '@commons/service'
import { WebRtcServiceEventsConfiguration } from './events-configuration'
import { MultimediaServiceEventsConfiguration } from './events-configuration'
import { WebRTCSocketServer } from './webrtc-socket-server'
import http from 'http'
import { serviceRouter } from './routes/router'
Expand All @@ -8,11 +8,11 @@ const WebRTCService = (server: http.Server) => {
new WebRTCSocketServer(server)
}

export const WebRtcServiceConfiguration: MicroserviceConfiguration = {
export const MultimediaServiceConfiguration: MicroserviceConfiguration = {
port: Number.parseInt(process.env.PORT!) || 3000,
amqpUri: process.env.AMQP_URI || 'amqp://localhost:5672',
mongoUri: process.env.MONGO_URI || 'mongodb://localhost:27017/webrtc',
eventsConfiguration: new WebRtcServiceEventsConfiguration(),
mongoUri: process.env.MONGO_URI || 'mongodb://localhost:27017/multimedia',
eventsConfiguration: new MultimediaServiceEventsConfiguration(),
expressConfiguration: {
middlewares: DefaultMiddlewares,
serviceRouter: serviceRouter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
ChannelRepository,
ChannelRepositoryImpl,
} from './repositories/channel-repository'
export class WebRtcServiceEventsConfiguration extends EventsConfiguration {

export class MultimediaServiceEventsConfiguration extends EventsConfiguration {
private sessionRepository: SessionRepository = new SessionRepositoryImpl()
private friendshipRepository: FriendshipRepository = new FriendshipRepositoryImpl()
private channelRepository: ChannelRepository = new ChannelRepositoryImpl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
GetChannelSessionIdApi,
GetDirectSessionIdApi,
GetUsersInSession,
} from '@api/webrtc/session'
} from '@piperchat/api/src/multimedia/session'

import {
FriendshipRepository,
FriendshipRepositoryImpl,
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions services/webrtc/src/app.ts

This file was deleted.

Loading