Skip to content

Commit 24f963b

Browse files
brunoborgesCopilot
andcommitted
Replace .NET solutions with Java/Spring Boot equivalents
Convert all workshop step solutions from .NET/Blazor WASM to Java 21/Spring Boot 3.4.2/Thymeleaf to match the workshop's target audience of Java developers. Each step progressively builds on the previous: - step-00: Java baseline (socops project + .github) - step-01: Add copilot-instructions.md for Java/Spring Boot - step-02: Add .editorconfig with Java-specific rules - step-03: Enhanced README with Java commands and stack - step-04: Cyberpunk neon UI theme (game.html + app.css) - step-05: Tech-life themed icebreaker questions - step-06: Scavenger Hunt mode (new model, endpoint, template) - step-07: Card Deck mode (3D flip cards, match tracking) - finished: Complete solution (identical to step-07) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 668b649 commit 24f963b

File tree

870 files changed

+14938
-548559
lines changed

Some content is hidden

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

870 files changed

+14938
-548559
lines changed

.solutions/finished/.editorconfig

Lines changed: 21 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# EditorConfig for C# projects
1+
# EditorConfig for Java projects
22
# https://editorconfig.org
33

44
root = true
@@ -11,82 +11,31 @@ charset = utf-8
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
1313

14-
[*.cs]
15-
# Organize usings
16-
dotnet_sort_system_directives_first = true
17-
dotnet_separate_import_directive_groups = false
18-
19-
# this. and Me. preferences
20-
dotnet_style_qualification_for_field = false:suggestion
21-
dotnet_style_qualification_for_property = false:suggestion
22-
dotnet_style_qualification_for_method = false:suggestion
23-
dotnet_style_qualification_for_event = false:suggestion
24-
25-
# Language keywords vs BCL types preferences
26-
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
27-
dotnet_style_predefined_type_for_member_access = true:suggestion
28-
29-
# Parentheses preferences
30-
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
31-
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
32-
33-
# Modifier preferences
34-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
35-
36-
# Expression-level preferences
37-
dotnet_style_object_initializer = true:suggestion
38-
dotnet_style_collection_initializer = true:suggestion
39-
dotnet_style_prefer_auto_properties = true:suggestion
40-
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
41-
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
42-
43-
# Null-checking preferences
44-
dotnet_style_coalesce_expression = true:suggestion
45-
dotnet_style_null_propagation = true:suggestion
46-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
47-
48-
# var preferences
49-
csharp_style_var_for_built_in_types = true:suggestion
50-
csharp_style_var_when_type_is_apparent = true:suggestion
51-
csharp_style_var_elsewhere = true:suggestion
52-
53-
# Expression-bodied members
54-
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
55-
csharp_style_expression_bodied_constructors = false:suggestion
56-
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
57-
csharp_style_expression_bodied_properties = true:suggestion
58-
csharp_style_expression_bodied_indexers = true:suggestion
59-
csharp_style_expression_bodied_accessors = true:suggestion
60-
csharp_style_expression_bodied_lambdas = true:suggestion
61-
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
62-
63-
# Pattern matching preferences
64-
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
65-
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
66-
67-
# Null-checking preferences
68-
csharp_style_throw_expression = true:suggestion
69-
csharp_style_conditional_delegate_call = true:suggestion
70-
71-
# Code block preferences
72-
csharp_prefer_braces = true:suggestion
14+
[*.java]
15+
# Java code style enforcement via EditorConfig
16+
# Indent with 4 spaces (standard Java convention)
17+
indent_size = 4
7318

74-
# Unused parameters
75-
dotnet_code_quality_unused_parameters = all:warning
19+
# Max line length (Google Java Style = 100, Oracle = 120)
20+
max_line_length = 120
7621

77-
# Async/await preferences
78-
csharp_style_prefer_async_over_sync = true:warning
22+
[*.xml]
23+
indent_size = 4
7924

80-
# IDE warnings
81-
dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member
82-
dotnet_diagnostic.IDE0052.severity = warning # Remove unread private member
83-
dotnet_diagnostic.IDE0059.severity = warning # Unnecessary assignment
84-
dotnet_diagnostic.IDE0060.severity = warning # Remove unused parameter
85-
dotnet_diagnostic.CS1998.severity = warning # Async method lacks await
86-
dotnet_diagnostic.CS4014.severity = warning # Call not awaited
25+
[*.{yml,yaml}]
26+
indent_size = 2
8727

88-
[*.{json,yml,yaml}]
28+
[*.{json,properties}]
8929
indent_size = 2
9030

9131
[*.md]
9232
trim_trailing_whitespace = false
33+
34+
[pom.xml]
35+
indent_size = 4
36+
37+
[*.html]
38+
indent_size = 4
39+
40+
[*.css]
41+
indent_size = 4

.solutions/finished/.github/copilot-instructions.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,58 @@
44

55
Before committing any changes, ensure:
66

7-
- [ ] `dotnet build` passes with no errors
8-
- [ ] `dotnet test` passes (when tests exist)
9-
- [ ] Code follows C# conventions (PascalCase for public members)
7+
- [ ] `./mvnw clean package` passes with no errors
8+
- [ ] `./mvnw test` passes (when tests exist)
9+
- [ ] Code follows Java conventions (camelCase for methods/fields, PascalCase for classes)
1010
- [ ] No unused variables or imports
1111

1212
## Project Overview
1313

14-
**Soc Ops** is a Social Bingo game built with Blazor WebAssembly (.NET 10). Players find people who match questions to mark squares and get 5 in a row.
14+
**Soc Ops** is a Social Bingo game built with Spring Boot 3.4.2, Thymeleaf, and vanilla JavaScript. Players find people who match questions to mark squares and get 5 in a row.
1515

1616
## Architecture
1717

1818
```
19-
SocOps/
20-
├── Components/ # Reusable Blazor components
21-
│ ├── BingoBoard.razor
22-
│ ├── BingoSquare.razor
23-
│ ├── BingoModal.razor
24-
│ ├── GameScreen.razor
25-
│ └── StartScreen.razor
26-
├── Models/ # Data models (BingoSquareData, GameState)
27-
├── Services/ # Business logic
28-
│ ├── BingoGameService.cs # State management
29-
│ └── BingoLogicService.cs # Game logic
30-
├── Data/ # Static data (Questions.cs)
31-
├── Pages/ # Routable pages (Home.razor)
32-
└── wwwroot/ # Static assets & CSS
19+
socops/
20+
├── src/main/java/com/socops/
21+
│ ├── SocOpsApplication.java # Spring Boot entry point
22+
│ ├── web/
23+
│ │ └── BingoRestController.java # Serves pages & REST endpoints
24+
│ ├── model/
25+
│ │ ├── BingoCell.java # Single tile record
26+
│ │ ├── PlayPhase.java # Game phase enum
27+
│ │ └── WinningStreak.java # Winning line record
28+
│ ├── service/
29+
│ │ └── BoardAssembler.java # Board generation & game logic
30+
│ └── data/
31+
│ └── IcebreakerPrompts.java # Static question bank
32+
├── src/main/resources/
33+
│ ├── templates/game.html # Thymeleaf template (all UI)
34+
│ ├── static/css/app.css # Tailwind-like utility CSS
35+
│ └── application.properties # Server config (port 8080)
36+
└── src/test/java/com/socops/
37+
└── service/BoardAssemblerTests.java # Unit tests
3338
```
3439

3540
## Key Commands
3641

3742
```bash
38-
dotnet build SocOps/SocOps.csproj # Build
39-
dotnet run --project SocOps # Run dev server (port 5166)
40-
dotnet test # Run tests
43+
cd socops
44+
./mvnw clean package # Build
45+
./mvnw spring-boot:run # Run dev server (port 8080)
46+
./mvnw test # Run tests
4147
```
4248

4349
## Styling
4450

45-
Uses custom CSS utility classes (Tailwind-like) in `wwwroot/css/app.css`:
51+
Uses custom CSS utility classes (Tailwind-like) in `src/main/resources/static/css/app.css`:
4652
- Layout: `.flex`, `.grid`, `.items-center`
4753
- Spacing: `.p-4`, `.mb-2`, `.mx-auto`
4854
- Colors: `.bg-accent`, `.bg-marked`, `.text-gray-700`
4955

5056
## State Management
5157

52-
- `BingoGameService` manages game state with event-driven updates
53-
- State persisted to localStorage via JSInterop
54-
- Components subscribe to `OnStateChanged` event
58+
- Server generates board via REST API (`/api/bingo/fresh-board`)
59+
- Client-side JavaScript manages game state with localStorage persistence
60+
- Single-page app with lobby, active game, and victory views
61+
- Thymeleaf renders the initial HTML; JS handles all interactivity

.solutions/finished/.github/instructions/css-utilities.instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
description: CSS utility classes and styling practices for this Blazor project.
2+
description: CSS utility classes and styling practices for this Spring Boot project.
33
---
44

55
# CSS Styling Practices
66

77
## Overview
8-
This project uses custom CSS utility classes (similar to Tailwind) defined in `wwwroot/css/app.css`. These provide consistent, composable styling without external dependencies.
8+
This project uses custom CSS utility classes (similar to Tailwind) defined in `src/main/resources/static/css/app.css`. These provide consistent, composable styling without external dependencies.
99

1010
## Available Utilities
1111

@@ -74,7 +74,7 @@ This project uses custom CSS utility classes (similar to Tailwind) defined in `w
7474
4. **Keep specificity low**: Utility classes should be single-purpose
7575

7676
## Example Component Styling
77-
```razor
77+
```html
7878
<div class="flex flex-col items-center justify-center min-h-full bg-gray-50">
7979
<button class="px-6 py-3 bg-accent text-white rounded-lg font-semibold">
8080
Start Game

.solutions/finished/.github/instructions/frontend-design.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You tend to converge toward generic, "on distribution" outputs. In frontend desi
88
Focus on:
99
- Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics.
1010
- Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw from IDE themes and cultural aesthetics for inspiration.
11-
- Motion: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for Blazor components. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions.
11+
- Motion: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for Thymeleaf templates. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions.
1212
- Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer CSS gradients, use geometric patterns, or add contextual effects that match the overall aesthetic.
1313

1414
Avoid generic AI-generated aesthetics:

.solutions/finished/.github/prompts/setup.prompt.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ tools: ['vscode/openSimpleBrowser', 'execute/runTask', 'execute/runInTerminal',
77
Your goal is to successfully build and run the workspace as local development environment.
88

99
## Checklist
10-
- [ ] Required dependencies (.NET 10 SDK) installed and verified
11-
- [ ] Build task functional
12-
- [ ] Dev server running (dotnet run)
10+
- [ ] Required dependencies (Java 21 JDK) installed and verified
11+
- [ ] Build task functional (Maven build)
12+
- [ ] Dev server running (./mvnw spring-boot:run)
1313
- [ ] Site open in browser preview
1414
- [ ] Short engaging welcome tour for the workspace

.solutions/finished/.github/workflows/deploy.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches: [main]
6+
workflow_dispatch:
67

78
permissions:
89
contents: read
@@ -22,25 +23,32 @@ jobs:
2223
steps:
2324
- uses: actions/checkout@v4
2425

25-
- uses: actions/setup-dotnet@v4
26+
- name: Setup Java 21
27+
uses: actions/setup-java@v4
2628
with:
27-
dotnet-version: '10.0.x'
29+
distribution: 'temurin'
30+
java-version: '21'
2831

29-
- name: Restore dependencies
30-
run: dotnet restore SocOps/SocOps.csproj
31-
32-
- name: Build
33-
run: dotnet publish SocOps/SocOps.csproj -c Release -o release --nologo
32+
- name: Build Spring Boot App
33+
run: |
34+
cd socops
35+
./mvnw clean package -DskipTests -q
3436
35-
- name: Change base-tag in index.html
37+
- name: Prepare deployment
3638
run: |
37-
sed -i 's/<base href="\/" \/>/<base href="\/${{ github.event.repository.name }}\/" \/>/g' release/wwwroot/index.html
39+
mkdir -p ./_site
40+
41+
# Copy docs (workshop guide) to deployment root
42+
cp -r docs/* ./_site/
43+
44+
# Prevent Jekyll processing
45+
touch ./_site/.nojekyll
3846
3947
- uses: actions/configure-pages@v4
4048

4149
- uses: actions/upload-pages-artifact@v3
4250
with:
43-
path: release/wwwroot
51+
path: _site
4452

4553
- name: Deploy to GitHub Pages
4654
id: deployment

.solutions/finished/README.md

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,77 @@
44
55
Soc Ops is an interactive social bingo game designed for in-person mixers, team events, and conferences. Find people who match the prompts, mark your card, and race to get 5 in a row!
66

7-
<p align="center">
8-
<img src="https://github.com/user-attachments/assets/2c6d0c33-72ec-47e8-b6bc-20837e7d830b" alt="Start Screen" width="300" />
9-
<img src="https://github.com/user-attachments/assets/4785afd4-c22a-4b1c-9b78-64d426c599e9" alt="Game Board" width="300" />
10-
</p>
11-
127
## ✨ Features
138

149
- 🎲 **Randomized boards** — Every player gets a unique arrangement
15-
- 💾 **Auto-save progress** — Pick up where you left off
10+
- 💾 **Auto-save progress** — Pick up where you left off (localStorage)
1611
- 🏆 **Bingo detection** — Automatic win detection for rows, columns, and diagonals
1712
- 🎉 **Celebration modal** — Confetti-worthy victory screen
1813
- 📱 **Mobile-first** — Works great on phones at events
1914

2015
## 🚀 Quick Start
2116

2217
### Prerequisites
23-
- [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0)
18+
- [Java 21 JDK](https://adoptium.net/) or higher
19+
- [Apache Maven 3.9+](https://maven.apache.org/) (or use the included Maven Wrapper)
2420

2521
### Run Locally
2622
```bash
27-
cd SocOps
28-
dotnet run
29-
# Open http://localhost:5166
23+
cd socops
24+
./mvnw spring-boot:run
25+
# Open http://localhost:8080
3026
```
3127

3228
### Build
3329
```bash
34-
dotnet build SocOps/SocOps.csproj
30+
cd socops
31+
./mvnw clean package
32+
```
33+
34+
### Test
35+
```bash
36+
cd socops
37+
./mvnw test
3538
```
3639

3740
## 🎨 Customize Your Game
3841

3942
### Change Questions
40-
Edit `SocOps/Data/Questions.cs` to add your own icebreaker prompts:
41-
```csharp
42-
public static readonly List<string> QuestionsList = new()
43-
{
43+
Edit `socops/src/main/java/com/socops/data/IcebreakerPrompts.java` to add your own icebreaker prompts:
44+
```java
45+
public static final List<String> ALL_PROMPTS = List.of(
4446
"has a pet",
4547
"speaks more than 2 languages",
4648
"your custom question here",
47-
// ... 24+ questions for a full board
48-
};
49+
// ... 24 questions for a full board
50+
);
4951
```
5052

5153
### Workshop Guide
5254
👉 Follow the [Lab Guide](.lab/GUIDE.md) for a hands-on workshop experience with GitHub Copilot agents.
5355

5456
## 🛠️ Tech Stack
5557

56-
- **Framework**: Blazor WebAssembly (.NET 10)
58+
- **Runtime**: Java 21
59+
- **Framework**: Spring Boot 3.4.2 with Thymeleaf
5760
- **Styling**: Custom CSS utilities (Tailwind-inspired)
58-
- **State**: Scoped services with localStorage persistence
61+
- **State**: Client-side JavaScript with localStorage persistence
62+
- **Build**: Apache Maven with Maven Wrapper
5963
- **Deployment**: GitHub Pages via Actions
6064

6165
## 📁 Project Structure
6266

6367
```
64-
SocOps/
65-
├── Components/ # BingoBoard, BingoSquare, Modals
66-
├── Models/ # Game state & data models
67-
├── Services/ # Game logic & state management
68-
├── Data/ # Question bank
69-
└── wwwroot/ # Static assets
68+
socops/
69+
├── src/main/java/com/socops/
70+
│ ├── web/ # Controllers & REST endpoints
71+
│ ├── model/ # Game records & enums
72+
│ ├── service/ # Board assembly & game logic
73+
│ └── data/ # Question bank
74+
├── src/main/resources/
75+
│ ├── templates/ # Thymeleaf templates
76+
│ └── static/ # CSS & static assets
77+
└── src/test/ # Unit tests
7078
```
7179

7280
## 🚢 Deployment

.solutions/finished/SocOps/App.razor

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

0 commit comments

Comments
 (0)