Skip to content

Commit f082621

Browse files
SindiBuklajidenizozturk95sindiibbcemsinan-tumrobertjndw
committed
Added cookie user identification and meal preference functionality (#1)
--------- Co-authored-by: Deniz Öztürk <750282004C4DEC44@mytum.de> Co-authored-by: Sindi Buklaji <ge43yif@mytum.de> Co-authored-by: Cem Sinan <cem.sinan@tum.de> Co-authored-by: Robert Jandow <robert.jandow@tum.de>
1 parent 7592a0a commit f082621

50 files changed

Lines changed: 1295 additions & 505 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy_docker.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.gitignore

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# IDE and Editor files
2+
.vscode/
3+
.idea/
4+
*.swp
5+
*.swo
6+
*~
7+
8+
# OS generated files
9+
.DS_Store
10+
.DS_Store?
11+
._*
12+
.Spotlight-V100
13+
.Trashes
14+
ehthumbs.db
15+
Thumbs.db
16+
17+
# Logs
18+
logs
19+
*.log
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
lerna-debug.log*
24+
25+
# Runtime data
26+
pids
27+
*.pid
28+
*.seed
29+
*.pid.lock
30+
31+
# Coverage directory used by tools like istanbul
32+
coverage/
33+
*.lcov
34+
35+
# nyc test coverage
36+
.nyc_output
37+
38+
# Dependency directories
39+
node_modules/
40+
41+
# Optional npm cache directory
42+
.npm
43+
44+
# Optional eslint cache
45+
.eslintcache
46+
47+
# Environment variables
48+
.env
49+
.env.local
50+
.env.development.local
51+
.env.test.local
52+
.env.production.local
53+
54+
# Docker
55+
.dockerignore
56+
57+
# Database
58+
*.db
59+
*.sqlite
60+
*.sqlite3
61+
62+
# Build outputs
63+
dist/
64+
build/
65+
target/
66+
out/
67+
*.jar
68+
*.war
69+
*.ear
70+
*.class
71+
72+
# Gradle
73+
.gradle/
74+
gradle-app.setting
75+
!gradle-wrapper.jar
76+
!gradle-wrapper.properties
77+
78+
# Maven
79+
.mvn/
80+
mvnw
81+
mvnw.cmd
82+
83+
# Python
84+
__pycache__/
85+
*.py[cod]
86+
*$py.class
87+
*.so
88+
.Python
89+
env/
90+
venv/
91+
ENV/
92+
env.bak/
93+
venv.bak/
94+
.pytest_cache/
95+
96+
# Helm
97+
*.tgz
98+
99+
# SSL certificates and keys
100+
*.pem
101+
*.key
102+
*.crt
103+
*.csr
104+
letsencrypt/
105+
106+
# Temporary files
107+
*.tmp
108+
*.temp
109+
temp/
110+
tmp/
111+
112+
# Backup files
113+
*.bak
114+
*.backup
115+
116+
# Local development overrides
117+
docker-compose.override.yml
118+
compose.override.yml
119+
120+
# Kubernetes secrets
121+
secrets/
122+
*.secret.yaml
123+
*.secret.yml

README.md

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
# DevOps W07 In-Class Exercise Template
1+
# DevOps W07 In-Class Exercise Solution
22

3-
This repository contains a full-stack application with a SvelteKit client and a Spring Boot server. It demonstrates modern web application architecture and DevOps practices.
3+
This repository contains a full-stack canteen application with a SvelteKit client, Spring Boot server, and LLM recommendation service. It demonstrates modern web application architecture and DevOps practices.
44

55
## Project Overview
66

77
This project includes:
8-
- **Client**: SvelteKit with TypeScript, TailwindCSS, and reusable UI components.
9-
- **Server**: Spring Boot Java application with RESTful APIs.
10-
- **DevOps**: Dockerized services, CI/CD pipelines, and production-ready deployment configurations.
8+
- **Client**: SvelteKit with TypeScript, TailwindCSS, and reusable UI components for browsing canteen meals.
9+
- **Server**: Spring Boot Java application with RESTful APIs, gRPC communication, and PostgreSQL integration.
10+
- **LLM Service**: Python FastAPI service for generating meal recommendations using AI.
11+
- **Database**: PostgreSQL for storing user preferences and application data.
12+
- **DevOps**: Dockerized services, CI/CD pipelines, Helm charts, and production-ready deployment configurations.
1113

1214
## Prerequisites
1315

1416
- Node.js (v22 or later)
1517
- Java JDK 21+
18+
- Python 3.x
1619
- Gradle
1720
- Docker and Docker Compose
1821
- Git
22+
- Kubernetes and Helm (for Kubernetes deployment)
1923

2024
## Setup Instructions
2125

@@ -48,8 +52,27 @@ cd w07-solution
4852
./gradlew build
4953
```
5054

55+
### LLM Service Setup
56+
57+
1. Navigate to the `llm` directory:
58+
```bash
59+
cd llm
60+
```
61+
2. Install dependencies:
62+
```bash
63+
python3 -m venv .venv
64+
source .venv/bin/activate
65+
pip3 install -r requirements.txt
66+
```
67+
5168
## Running the Application
5269

70+
### Start the Database
71+
72+
```bash
73+
docker compose up database -d
74+
```
75+
5376
### Start the Client
5477

5578
```bash
@@ -66,21 +89,39 @@ cd server
6689
```
6790
The server API will be available at [http://localhost:8080](http://localhost:8080).
6891

92+
### Start the LLM Service
93+
94+
```bash
95+
cd llm
96+
python main.py
97+
```
98+
The LLM service will be available at [http://localhost:5000](http://localhost:5000).
99+
69100
## Development Workflow
70101

71102
### Client Development
72103

73104
- Built with SvelteKit and TypeScript for a modern, reactive UI.
74105
- TailwindCSS for styling.
75106
- Components and routes are organized in the `src` directory.
107+
- Features meal browsing, favoriting, and user preferences.
76108

77109
### Server Development
78110

79111
- Built with Spring Boot for scalable and maintainable server services.
112+
- Includes gRPC communication with the LLM service.
113+
- PostgreSQL integration for user preferences storage.
114+
- RESTful APIs for canteen data and user management.
80115
- Gradle is used for dependency management and building.
81116
- Source code is in the `src/main/java` directory.
82117
- Tests are in the `src/test/java` directory.
83118

119+
### LLM Service Development
120+
121+
- Built with FastAPI for AI-powered meal recommendations.
122+
- Integrates with external LLM APIs for generating personalized suggestions.
123+
- Source code is in the `llm` directory.
124+
84125
## Building for Production
85126

86127
### Client Build
@@ -103,13 +144,31 @@ The project includes Docker configurations for containerized deployment.
103144

104145
### Build and Run with Docker Compose
105146

106-
1. Build and start the services:
147+
1. Build and start all services:
107148
```bash
108149
docker compose up --build
109150
```
110151
2. Access the application:
111152
- Client: [http://localhost:3000](http://localhost:3000)
112153
- Server: [http://localhost:8080](http://localhost:8080)
154+
- LLM Service: [http://localhost:5000](http://localhost:5000)
155+
- Database: PostgreSQL on port 5432
156+
157+
## Kubernetes Deployment
158+
159+
The project includes Helm charts for Kubernetes deployment.
160+
161+
### Deploy with Helm
162+
163+
1. Update the `tumid` value in [`helm/canteen-app/values.yaml`](helm/canteen-app/values.yaml):
164+
```yaml
165+
tumid: your-tum-id
166+
```
167+
168+
2. Install the Helm chart:
169+
```bash
170+
helm install canteen ./helm/canteen-app
171+
```
113172

114173
## CI/CD Pipeline
115174

@@ -122,18 +181,28 @@ The project includes GitHub Actions workflows for:
122181
```
123182
├── client/ # SvelteKit client
124183
│ ├── src/ # Source code
125-
│ ├── public/ # Static assets
184+
│ ├── static/ # Static assets
126185
│ └── package.json # Client dependencies
127186
128187
├── server/ # Spring Boot server
129-
│ ├── src/ # Source code
188+
│ ├── src/ # Source code including gRPC services
130189
│ ├── build.gradle # Gradle build file
131190
│ └── Dockerfile # Server Dockerfile
132191
192+
├── llm/ # Python LLM service
193+
│ ├── main.py # FastAPI application
194+
│ ├── requirements.txt # Python dependencies
195+
│ └── Dockerfile # LLM service Dockerfile
196+
197+
├── docs/ # API documentation (Bruno collection)
133198
├── compose.yml # Docker Compose for local development
134199
└── .github/workflows/ # CI/CD workflows
135200
```
136201

202+
## API Documentation
203+
204+
API documentation is available in the [`docs/CanteenApp Bruno`](docs/CanteenApp%20Bruno) directory as a Bruno collection for testing endpoints.
205+
137206
## License
138207

139208
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)