-
Notifications
You must be signed in to change notification settings - Fork 127
Simplify client: remove Svelte, use pure Astro with SSR data fetching #179
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5e2adb4
Simplify client: remove Svelte, use pure Astro with SSR data fetching
GeekTrainer 7cfff68
Initial plan
Copilot 5006a9b
Create mock API server, update e2e tests for SSR, remove unused esbui…
Copilot 9a5fed4
Update workshop content to reflect pure Astro app (remove Svelte refe…
Copilot 28e1ba4
Replace mock API with real Flask server using seeded test database fo…
Copilot a2e5bb1
Move DATABASE_PATH resolution into seed_test_database() function
Copilot dd43328
Remove Google Fonts, use system font stack instead
Copilot 7b19f3b
Disable Astro telemetry via ASTRO_TELEMETRY_DISABLED env var in config
Copilot 74bc88a
Merge pull request #178 from github-samples/copilot/simplify-client-app
GeekTrainer ab3e09f
Fix content alignment with simplified app
GeekTrainer 6f610c0
Restructure project into app/ directory
GeekTrainer 1d58a16
Add pagination to dogs API and homepage
GeekTrainer f2d26f5
Fix Vite serving errors for symlinked node_modules
GeekTrainer d84b9ae
Remove old client/, server/, scripts/ directories
GeekTrainer 4d9a59c
Add dev tooling for Copilot sandbox environment
GeekTrainer 042df81
Genericize sandbox script with external config
GeekTrainer 1ec9322
Update content/1-hour/README.md
GeekTrainer 314144e
Update PLAN.md
GeekTrainer f83547f
Initial plan
Copilot b091dc6
Merge main, resolve conflicts, fix content path references
Copilot d11f050
Reset actions-workshop content to main, remove .dev/ and PLAN.md
GeekTrainer b278230
Fix GitHub Actions workshop content issues
GeekTrainer b56c68a
Fix 1-hour and full-day workshop content issues
GeekTrainer decf271
Merge pull request #190 from github-samples/copilot/sub-pr-179
GeekTrainer 368d84f
Update npm dependencies to latest major versions
GeekTrainer f304509
Remove adoption-site duplicate and .github/skills, gitignore .playwri…
GeekTrainer bb2575c
Address Copilot code review feedback
GeekTrainer ce14043
Merge main into simplify-client-app
GeekTrainer fa026fb
Fix working-directory paths in GitHub Actions content
GeekTrainer fdaa14a
Use platform-aware Python executable in test server script
GeekTrainer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // @ts-check | ||
| process.env.ASTRO_TELEMETRY_DISABLED = '1'; | ||
| import { defineConfig } from 'astro/config'; | ||
| import tailwindcss from '@tailwindcss/vite'; | ||
| import node from '@astrojs/node'; | ||
| import fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
|
|
||
| // Allow Vite to serve files from the real node_modules path when it is symlinked | ||
| const nodeModulesPath = path.resolve('node_modules'); | ||
| const realNodeModulesPath = fs.realpathSync(nodeModulesPath); | ||
| const fsAllow = ['..']; | ||
| if (realNodeModulesPath !== nodeModulesPath) { | ||
| fsAllow.push(path.dirname(realNodeModulesPath)); | ||
| } | ||
|
|
||
| // https://astro.build/config | ||
| export default defineConfig({ | ||
| output: 'server', | ||
| vite: { | ||
| plugins: [tailwindcss()], | ||
| server: { | ||
| fs: { | ||
| allow: fsAllow, | ||
| }, | ||
| }, | ||
| }, | ||
| adapter: node({ | ||
| mode: 'standalone' | ||
| }), | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.describe('API Integration', () => { | ||
| test('should render dogs from the API on the homepage', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| const dogCards = page.getByTestId('dog-card'); | ||
| await expect(dogCards).toHaveCount(6); | ||
|
|
||
| await expect(page.getByTestId('dog-name').nth(0)).toHaveText('Buddy'); | ||
| await expect(page.getByTestId('dog-breed').nth(0)).toHaveText('Golden Retriever'); | ||
|
|
||
| await expect(page.getByTestId('dog-name').nth(1)).toHaveText('Luna'); | ||
| await expect(page.getByTestId('dog-breed').nth(1)).toHaveText('Husky'); | ||
|
|
||
| await expect(page.getByTestId('dog-name').nth(2)).toHaveText('Max'); | ||
| await expect(page.getByTestId('dog-breed').nth(2)).toHaveText('German Shepherd'); | ||
| }); | ||
|
|
||
| test('should render dog details from the API', async ({ page }) => { | ||
| await page.goto('/dog/1'); | ||
|
|
||
| await expect(page.getByTestId('dog-details')).toBeVisible(); | ||
| await expect(page.getByTestId('dog-name')).toHaveText('Buddy'); | ||
| await expect(page.getByTestId('dog-breed')).toContainText('Golden Retriever'); | ||
| await expect(page.getByTestId('dog-age')).toContainText('3'); | ||
| await expect(page.getByTestId('dog-gender')).toContainText('Male'); | ||
| await expect(page.getByTestId('dog-status')).toHaveText('Available'); | ||
| }); | ||
|
|
||
| test('should return 404 details for non-existent dog', async ({ page }) => { | ||
| await page.goto('/dog/99999'); | ||
|
|
||
| await expect(page.getByTestId('error-message')).toBeVisible(); | ||
| await expect(page.getByTestId('error-message')).toContainText('not found'); | ||
| }); | ||
|
|
||
| test('should link from dog card to detail page', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| const firstCard = page.getByTestId('dog-card').first(); | ||
| await firstCard.click(); | ||
|
|
||
| await expect(page).toHaveURL(/\/dog\/1$/); | ||
| await expect(page.getByTestId('dog-details')).toBeVisible(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.describe('Dog Details', () => { | ||
| test('should navigate to dog details from homepage', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| const firstDogCard = page.getByTestId('dog-card').first(); | ||
| const dogName = await page.getByTestId('dog-name').first().textContent(); | ||
|
|
||
| await firstDogCard.click(); | ||
|
|
||
| await expect(page).toHaveURL(/\/dog\/\d+/); | ||
| await expect(page).toHaveTitle(/Dog Details - Tailspin Shelter/); | ||
| await expect(page.getByTestId('dog-details')).toBeVisible(); | ||
| await expect(page.getByTestId('dog-name')).toHaveText(dogName!); | ||
| }); | ||
|
|
||
| test('should display full dog details for Buddy', async ({ page }) => { | ||
| await page.goto('/dog/1'); | ||
|
|
||
| await expect(page.getByTestId('dog-details')).toBeVisible(); | ||
| await expect(page.getByTestId('dog-name')).toHaveText('Buddy'); | ||
| await expect(page.getByTestId('dog-breed')).toContainText('Golden Retriever'); | ||
| await expect(page.getByTestId('dog-age')).toContainText('3'); | ||
| await expect(page.getByTestId('dog-gender')).toContainText('Male'); | ||
| await expect(page.getByTestId('dog-status')).toHaveText('Available'); | ||
| await expect(page.getByTestId('dog-description')).toContainText('friendly and loyal'); | ||
| }); | ||
|
|
||
| test('should navigate back to homepage from dog details', async ({ page }) => { | ||
| await page.goto('/dog/1'); | ||
|
|
||
| await page.getByTestId('back-link').click(); | ||
|
|
||
| await expect(page).toHaveURL('/'); | ||
| await expect(page.getByRole('heading', { name: 'Welcome to Tailspin Shelter' })).toBeVisible(); | ||
| }); | ||
|
|
||
| test('should handle invalid dog ID gracefully', async ({ page }) => { | ||
| await page.goto('/dog/99999'); | ||
|
|
||
| await expect(page).toHaveTitle(/Dog Details - Tailspin Shelter/); | ||
| await expect(page.getByTestId('error-message')).toBeVisible(); | ||
| await expect(page.getByTestId('back-link')).toBeVisible(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.describe('Tailspin Shelter Homepage', () => { | ||
| test('should load homepage and display title', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| await expect(page).toHaveTitle(/Tailspin Shelter - Find Your Forever Friend/); | ||
|
|
||
| await expect(page.getByRole('heading', { name: 'Welcome to Tailspin Shelter' })).toBeVisible(); | ||
|
|
||
| await expect(page.getByText('Find your perfect companion from our wonderful selection')).toBeVisible(); | ||
| }); | ||
|
|
||
| test('should display dog list', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| await expect(page.getByRole('heading', { name: 'Available Dogs' })).toBeVisible(); | ||
|
|
||
| const dogList = page.getByTestId('dog-list'); | ||
| await expect(dogList).toBeVisible(); | ||
|
|
||
| const dogCards = page.getByTestId('dog-card'); | ||
| await expect(dogCards).toHaveCount(6); | ||
| }); | ||
|
|
||
| test('should display dog names and breeds', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| await expect(page.getByTestId('dog-name').nth(0)).toHaveText('Buddy'); | ||
| await expect(page.getByTestId('dog-breed').nth(0)).toHaveText('Golden Retriever'); | ||
|
|
||
| await expect(page.getByTestId('dog-name').nth(1)).toHaveText('Luna'); | ||
| await expect(page.getByTestId('dog-breed').nth(1)).toHaveText('Husky'); | ||
|
|
||
| await expect(page.getByTestId('dog-name').nth(2)).toHaveText('Max'); | ||
| await expect(page.getByTestId('dog-breed').nth(2)).toHaveText('German Shepherd'); | ||
| }); | ||
|
|
||
| test('should display pagination controls', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| const pagination = page.getByTestId('pagination'); | ||
| await expect(pagination).toBeVisible(); | ||
| await expect(page.getByTestId('pagination-info')).toContainText('Page 1 of 2'); | ||
| await expect(page.getByTestId('pagination-next')).toBeVisible(); | ||
| }); | ||
|
|
||
| test('should navigate to page 2', async ({ page }) => { | ||
| await page.goto('/'); | ||
|
|
||
| await page.getByTestId('pagination-next').click(); | ||
| await expect(page).toHaveURL(/page=2/); | ||
|
|
||
| const dogCards = page.getByTestId('dog-card'); | ||
| await expect(dogCards).toHaveCount(4); | ||
| await expect(page.getByTestId('dog-name').nth(0)).toHaveText('Rocky'); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description mentions adding
PLAN.md, but this change set doesn’t include aPLAN.mdfile (and there are no references to it in the repo). Either add the file or update the PR description so it matches the delivered changes.