diff --git a/docker-compose.yml b/docker-compose.yml index eed407a..4fa72be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,8 +20,6 @@ services: - postgres env_file: - .env - environment: - SPRING_PROFILES_ACTIVE: dev volumes: - ${MEDIA_DATA}:/app/data/media ports: diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0c84db0..d648ade 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -7,6 +7,7 @@ import Home from './pages/Home'; import {useEffect} from "react"; import MyClips from './pages/MyClips'; import VideoPlayer from "./pages/VideoPlayer.tsx"; +import Profile from "./pages/Profile.tsx"; import { GoogleOAuthProvider } from '@react-oauth/google'; @@ -25,6 +26,7 @@ function App() { } /> } /> } /> + } /> diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 4e6e272..0c9c121 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; import SidebarButton from "./buttons/SidebarButton.tsx"; -import { Plus, Film, Home } from 'lucide-react'; +import { Plus, Film, Home, User as UserIcon } from 'lucide-react'; import Box from "./Box.tsx"; import type {User} from "../utils/types.ts"; @@ -30,11 +30,18 @@ const Sidebar = ({user, className}: props) => { /> { user && ( - } - label={"My Clips"} - /> + <> + } + label={"My Clips"} + /> + } + label={"Profile"} + /> + )} ); diff --git a/frontend/src/components/Topbar.tsx b/frontend/src/components/Topbar.tsx index 9026186..8fdef00 100644 --- a/frontend/src/components/Topbar.tsx +++ b/frontend/src/components/Topbar.tsx @@ -70,6 +70,8 @@ const Topbar = ({ /> + navigate("/profile")} /> handleLogout()} className={"text-red-500 font-medium"} /> diff --git a/frontend/src/utils/types.ts b/frontend/src/utils/types.ts index 287a561..04cc9f6 100644 --- a/frontend/src/utils/types.ts +++ b/frontend/src/utils/types.ts @@ -17,8 +17,11 @@ type APIResponse = { type User = { name: string, + username: string, email: string, - profilePictureUrl: string + profilePictureUrl: string, + streamKey: string, + createdAt: string, } type Clip = { diff --git a/src/main/Dockerfile b/src/main/Dockerfile index 3b0af77..328e231 100644 --- a/src/main/Dockerfile +++ b/src/main/Dockerfile @@ -15,6 +15,12 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +ENV POSTGRES_DATA=/app/db +ENV MEDIA_DATA=/app/data/media +ENV STREAM_DATA=/app/data/media/streams + +VOLUME ["app/db", "app/data/media/streams", "/app/data/media"] + WORKDIR /app COPY --from=builder /app/target/*.jar app.jar EXPOSE 8080 diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties deleted file mode 100644 index f9ba019..0000000 --- a/src/main/resources/application-dev.properties +++ /dev/null @@ -1,10 +0,0 @@ -spring.docker.compose.enabled=false - -spring.datasource.url=jdbc:postgresql://postgres:5432/vodSystem -spring.datasource.username=${POSTGRES_USER} -spring.datasource.password=${POSTGRES_PASSWORD} -spring.datasource.driver-class-name=org.postgresql.Driver -spring.jpa.hibernate.ddl-auto=update -spring.jpa.show-sql=true -spring.sql.init.mode=always -spring.sql.init.schema-locations=classpath:db/schema.sql \ No newline at end of file diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index fd79b55..7b02d27 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -1,15 +1 @@ -# Database -spring.datasource.url=jdbc:postgresql://localhost:5432/vodSystem -spring.datasource.username=${POSTGRES_USER} -spring.datasource.password=${POSTGRES_PASSWORD} -spring.datasource.driver-class-name=org.postgresql.Driver -spring.jpa.hibernate.ddl-auto=update -spring.jpa.show-sql=true -spring.sql.init.mode=always -spring.sql.init.schema-locations=classpath:db/schema.sql - -# Frontend -frontend.url=http://localhost:5173 - -# Docker -spring.docker.compose.file=docker-compose.dev.yml +spring.docker.compose.file=docker-compose.dev.yml \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index c5811af..2f9acc6 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,4 @@ spring.application.name=vodSystem -spring.profiles.default=local # VODs spring.servlet.multipart.max-file-size=2GB @@ -8,6 +7,16 @@ storage.temp.inputs=videos/inputs/ storage.temp.outputs=videos/outputs/ storage.outputs=${MEDIA_DATA} +# Database +spring.datasource.url=${POSTGRES_URL} +spring.datasource.username=${POSTGRES_USER} +spring.datasource.password=${POSTGRES_PASSWORD} +spring.datasource.driver-class-name=org.postgresql.Driver +spring.jpa.hibernate.ddl-auto=update +spring.jpa.show-sql=true +spring.sql.init.mode=always +spring.sql.init.schema-locations=classpath:db/schema.sql + ## Security spring.security.oauth2.client.registration.google.client-id=${GOOGLE_CLIENT_ID} spring.security.oauth2.client.registration.google.client-secret=${GOOGLE_CLIENT_SECRET} @@ -16,5 +25,8 @@ spring.security.oauth2.client.registration.google.scope=profile,email jwt.secret.key=${JWT_SECRET_KEY} jwt.expiration=3600000 +# Frontend +frontend.url=${FRONTEND_URL} + ## Server Configuration server.servlet.session.timeout=30m \ No newline at end of file