Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2476c21
refactor: move mock data to separate files
EnricoBausenhart Jul 10, 2025
d0ac81b
feat: add team logo to drawer
EnricoBausenhart Jul 10, 2025
59d8964
feat: add userID context
EnricoBausenhart Jul 10, 2025
e22dd6a
refactor: optimize code regarding api requests
EnricoBausenhart Jul 10, 2025
368dace
Merge branch 'main' of github.com:AET-DevOps25/team-devoops into refa…
EnricoBausenhart Jul 10, 2025
d59e560
feat: add gateway port to dockerfile
EnricoBausenhart Jul 12, 2025
31205c6
fix: add temporary support for CORS
stark-cybertech Jul 12, 2025
c37114c
feat: disable mock data in deployment
EnricoBausenhart Jul 14, 2025
40a3a64
Merge branch 'main' into refactor/ui-cleanup
stark-cybertech Jul 15, 2025
20b6ab1
fix: add meetatmensa.com to CORS
stark-cybertech Jul 15, 2025
b1ce92e
feat: set address for gateway
stark-cybertech Jul 15, 2025
b748993
fix: add http
stark-cybertech Jul 15, 2025
6b42f31
fix: correct public address
stark-cybertech Jul 15, 2025
926e5f0
fix: correct CORS entry
stark-cybertech Jul 15, 2025
d33aaa3
feat: enable deployment to starnet rancher
stark-cybertech Jul 15, 2025
41a0ba4
feat: adapt subpage paths
EnricoBausenhart Jul 15, 2025
5ee3116
feat: improve requests to the gateway including mock data switch
EnricoBausenhart Jul 15, 2025
2d18fb4
feat: optimize code structure and fix minor issues
EnricoBausenhart Jul 15, 2025
cbcf879
fix: typescript errors in docker build
EnricoBausenhart Jul 15, 2025
fca5ef3
feat: dynamically inject api base url
EnricoBausenhart Jul 15, 2025
6938f03
feat: add config template for dynamically injected url
EnricoBausenhart Jul 15, 2025
7923379
feat: adapt base url in docker compose file
EnricoBausenhart Jul 15, 2025
2d37e1e
feat: use existing elastic ip in aws deployment to fix issue with dyn…
EnricoBausenhart Jul 15, 2025
b8a03b7
feat: use dynmaic api base url in helm deployment
EnricoBausenhart Jul 15, 2025
8789d60
feat: add aws url to allowed origins of gateway
EnricoBausenhart Jul 15, 2025
66d9fdd
fix: elastic ip allocation
EnricoBausenhart Jul 15, 2025
7c02f31
fix: remove duplicated api version path
EnricoBausenhart Jul 15, 2025
4d9c0d1
feat: add databases to aws setup and test new valu einjection
EnricoBausenhart Jul 15, 2025
96e7da7
fix: test injection
EnricoBausenhart Jul 15, 2025
70efaa9
fix: test with different image
EnricoBausenhart Jul 15, 2025
20c8ddc
fix: move back to latest client image
EnricoBausenhart Jul 15, 2025
ecbde90
feat: adapt container names
EnricoBausenhart Jul 15, 2025
cd2900e
feat: add database images
EnricoBausenhart Jul 15, 2025
f8d9f95
feat: set ansibl ehost
EnricoBausenhart Jul 15, 2025
38d68bb
fix: name of database images
EnricoBausenhart Jul 15, 2025
5040899
feat: test bigger ec2 instance
EnricoBausenhart Jul 16, 2025
80df6d7
feat: use smaller sized ec2 instace for cost reasons
EnricoBausenhart Jul 16, 2025
0159b48
feat: update compose file due to certificate limits in nip io
EnricoBausenhart Jul 16, 2025
a6a0a3d
fix: revert to t3.small
EnricoBausenhart Jul 16, 2025
ebab001
feat: add new allowed origin to gateway
EnricoBausenhart Jul 16, 2025
866da35
Feature/aws setup (#84)
EnricoBausenhart Jul 16, 2025
494cf6f
feat: update readme and adapt env example file
EnricoBausenhart Jul 16, 2025
8d7ba54
Merge branch 'refactor/ui-cleanup' of github.com:AET-DevOps25/team-de…
EnricoBausenhart Jul 16, 2025
2a9363b
docs: add local docker development instructions to the client readme
EnricoBausenhart Jul 16, 2025
193c011
pain: set CORS origin to * according to "best practices"
stark-cybertech Jul 16, 2025
c8076f2
feat: prototype networking for deployment
stark-cybertech Jul 16, 2025
13ebf19
fix: deploy SHA tag instead of latest
stark-cybertech Jul 16, 2025
c6da441
fix: propagate tags to subcharts
stark-cybertech Jul 16, 2025
9265a58
Merge branch 'refactor/ui-cleanup' into feature/networking
stark-cybertech Jul 17, 2025
f7df5f4
fix: move image tag back to latest
EnricoBausenhart Jul 17, 2025
2fea785
Merge branch 'refactor/ui-cleanup' into feature/networking
stark-cybertech Jul 17, 2025
1f032f8
Feature/networking (#86)
EnricoBausenhart Jul 17, 2025
b0de42d
fix: do not overwrite database images
stark-cybertech Jul 17, 2025
19addab
feat: esnure auth encoding and waiting for users/me request to finish
EnricoBausenhart Jul 17, 2025
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
12 changes: 11 additions & 1 deletion .github/workflows/cd_kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# Get current commit hash
- name: Get Tag
id: tag
run: echo "SHORT_SHA=sha-$(git rev-parse --short HEAD)" >> $GITHUB_ENV

# Use Azure's kubectl installation action
- name: Install Kubectl
uses: azure/setup-kubectl@v4
Expand All @@ -43,4 +48,9 @@ jobs:
# Run helm upgrade to upgrade deployment
- name: Upgrade Deployment with Helm
run: |
helm upgrade --install meetatmensa ./deployment/k8s -n devoops
helm upgrade --install meetatmensa ./deployment/k8s -n devoops \
--set client.image.tag=${SHORT_SHA} \
--set gateway.image.tag=${SHORT_SHA} \
--set genai.image.tag=${SHORT_SHA} \
--set matching.image.tag=${SHORT_SHA} \
--set user.image.tag=${SHORT_SHA} \
4 changes: 2 additions & 2 deletions .github/workflows/terraform-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: AWS
url: "https://client.${{ steps.terraform.outputs.public_ip }}.nip.io"
url: "https://client.${{ steps.terraform.outputs.public_ip }}.sslip.io"

steps:
- name: Checkout Code
Expand Down Expand Up @@ -71,4 +71,4 @@ jobs:
echo "=== Testing SSH Connection ==="
ssh -i vockey.pem -o StrictHostKeyChecking=no ubuntu@${{ steps.terraform.outputs.public_ip }} "echo 'SSH connection successful'"
echo "=== Running Ansible Playbook ==="
ANSIBLE_HOST_KEY_CHECKING=False ANSIBLE_DEBUG=1 ansible-playbook -i inventory.yml playbooks/deploy.yml -vvv --extra-vars "ansible_host=${{ steps.terraform.outputs.public_ip }}" --start-at-task="Test connection"
ANSIBLE_HOST_KEY_CHECKING=False ANSIBLE_DEBUG=1 ansible-playbook -i inventory.yml playbooks/deploy.yml -vvv --extra-vars "ansible_host=${{ steps.terraform.outputs.public_ip }} EC2_PUBLIC_IP=${{ steps.terraform.outputs.public_ip }}" --start-at-task="Test connection"
11 changes: 9 additions & 2 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ RUN npm install
# Copy source code
COPY . .

# Hardcode API URL for Docker deployment
ENV VITE_API_BASE_URL=http://localhost:8080
# Remove build-time VITE_API_BASE_URL and VITE_USE_MOCK_DATA
# ARG VITE_API_BASE_URL=https://api.meetatmensa.com
# ARG VITE_USE_MOCK_DATA=false
# ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
# ENV VITE_USE_MOCK_DATA=$VITE_USE_MOCK_DATA

RUN npm run build

FROM nginx:alpine

COPY --from=build /app/dist /usr/share/nginx/html
COPY public/config.template.js /usr/share/nginx/html/config.template.js
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 80

ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
37 changes: 37 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Then edit `.env.local` with your local settings:

```
VITE_API_BASE_URL=http://localhost:8080
VITE_USE_MOCK_DATA=false
```
If mock data usage is set to true, no requests will be sent to the Gateway.

### Docker Compose Deployment

Expand All @@ -48,6 +50,41 @@ env:
VITE_API_BASE_URL: 'http://gateway-service:80'
```

### AWS Deployment

Environment variables are configured in `deployment/compose.aws.yml`

```yaml
client:
image: ghcr.io/aet-devops25/team-devoops/client:latest
environment:
- API_BASE_URL=https://api.${EC2_PUBLIC_IP}.nip.io
```

---

## Local Deployment with Docker

```
# Build and tag the Docker image
docker build -t ghcr.io/aet-devops25/team-devoops/client .

# Push the image to GHCR (latest tag by default, access needed)
docker push ghcr.io/aet-devops25/team-devoops/client

# Run the Docker container on port 80
docker run --name client-service -p 80:80 ghcr.io/aet-devops25/team-devoops/client

# List running containers (if needed)
docker ps

# Stop the container
docker stop client-service

# Remove the container
docker rm client-service
```

## Build

```bash
Expand Down
5 changes: 5 additions & 0 deletions client/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e
API_BASE_URL=${API_BASE_URL:-https://api.meetatmensa.com/api/v2}
sed "s|__API_BASE_URL__|$API_BASE_URL|g" /usr/share/nginx/html/config.template.js > /usr/share/nginx/html/config.js
exec "$@"
7 changes: 2 additions & 5 deletions client/env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# API Configuration for local development
VITE_API_BASE_URL=http://localhost:8082

# Auth0 Configuration (if needed)
# VITE_AUTH0_DOMAIN=your-domain.auth0.com
# VITE_AUTH0_CLIENT_ID=your-client-id
VITE_API_BASE_URL=http://localhost:8080
VITE_USE_MOCK_DATA=false
1 change: 1 addition & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<div id="root"></div>
<script src="/config.js"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions client/public/config.template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
window.RUNTIME_CONFIG = {
API_BASE_URL: "__API_BASE_URL__"
};
143 changes: 73 additions & 70 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import MatchRequests from './components/MatchRequests';
import Matches from './components/Matches';
import { useAuth0 } from '@auth0/auth0-react';
import Profile from './components/Profile';
import { UserIDProvider } from './contexts/UserIDContext';

interface AppProps {
toggleColorMode: () => void;
Expand Down Expand Up @@ -40,79 +41,81 @@ const ProtectedRoute = ({ children }: { children: React.ReactNode }) => {

const App = ({ toggleColorMode, mode }: AppProps) => {
return (
<Router>
<Routes>
{/* Public routes */}
<Route path="/login" element={<Login />} />
<UserIDProvider>
<Router>
<Routes>
{/* Public routes */}
<Route path="/login" element={<Login />} />

{/* Protected routes - all require authentication */}
<Route
path="/"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Dashboard />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/dashboard"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Dashboard />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/preferences"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<MatchRequests />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/matches"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Matches />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/profile"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Profile />
</Layout>
</ProtectedRoute>
}
/>
{/* Protected routes - all require authentication */}
<Route
path="/"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Dashboard />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/dashboard"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Dashboard />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/matchrequests"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<MatchRequests />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/matches"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Matches />
</Layout>
</ProtectedRoute>
}
/>
<Route
path="/profile"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<Profile />
</Layout>
</ProtectedRoute>
}
/>

{/* Account settings route */}
<Route
path="/account"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<div>Account Settings (Coming Soon)</div>
</Layout>
</ProtectedRoute>
}
/>
{/* Account settings route */}
<Route
path="/account"
element={
<ProtectedRoute>
<Layout toggleColorMode={toggleColorMode} mode={mode}>
<div>Account Settings (Coming Soon)</div>
</Layout>
</ProtectedRoute>
}
/>

{/* Catch all route */}
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Router>
{/* Catch all route */}
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Router>
</UserIDProvider>
);
};

Expand Down
6 changes: 3 additions & 3 deletions client/src/__tests__/utils/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ export const mockMatchRequest = {
userID: 'user1',
groupID: 'group1',
date: '2024-01-15',
location: 'garching',
location: 'GARCHING',
preferences: {
degreePref: true,
agePref: false,
genderPref: true,
},
timeslots: [9, 10, 11],
timeslot: [9, 10, 11],
status: 'PENDING' as const,
};

Expand All @@ -25,7 +25,7 @@ export const mockMatchRequests = [
{
...mockMatchRequest,
requestID: '124',
location: 'arcisstr',
location: 'ARCISSTR',
status: 'MATCHED' as const,
},
];
Expand Down
Binary file added client/src/assets/devoops_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion client/src/components/CreateMatchRequestDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { de as deLocale } from 'date-fns/locale';
import { isSameDay, isBefore } from 'date-fns';
import { useUserID } from '../contexts/UserIDContext';

// Location options
const LOCATION_OPTIONS = [
Expand Down Expand Up @@ -61,6 +62,7 @@ const CreateMatchRequestDialog: React.FC<CreateMatchRequestDialogProps> = ({
onClose,
onSubmit,
}) => {
const userID = useUserID();
const [selectedLocation, setSelectedLocation] = useState('');
const [selectedDate, setSelectedDate] = useState<Date | null>(null);
const [selectedTimeslots, setSelectedTimeslots] = useState<number[]>([]);
Expand All @@ -70,6 +72,7 @@ const CreateMatchRequestDialog: React.FC<CreateMatchRequestDialogProps> = ({
genderPref: false,
});


const handleTimeslotToggle = (timeslot: number) => {
setSelectedTimeslots((prev) =>
prev.includes(timeslot)
Expand Down Expand Up @@ -124,13 +127,14 @@ const CreateMatchRequestDialog: React.FC<CreateMatchRequestDialogProps> = ({
};

const handleSubmit = () => {
if (!selectedLocation || !selectedDate || !areTimeslotsConsecutive(selectedTimeslots)) {
if (!selectedLocation || !selectedDate || !areTimeslotsConsecutive(selectedTimeslots) || !userID) {
return;
}

const formattedDate = selectedDate.toISOString().split('T')[0]; // YYYY-MM-DD format

onSubmit({
userID: userID,
date: formattedDate,
timeslot: selectedTimeslots,
location: selectedLocation.toUpperCase(),
Expand Down
Loading