Skip to content

Commit 7706eb2

Browse files
authored
Merge pull request #37 from github-samples/geektrainer/restructure
Lab updates
2 parents 561dc25 + 4cb9d93 commit 7706eb2

15 files changed

+601
-520
lines changed

.github/copilot-instructions.md

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,70 @@
1-
# Tailspin Toys Crowd Funding
1+
# Tailspin Toys Crowd Funding Development Guidelines
22

3-
Website for crowd funding for games.
3+
This is a crowdfunding platform for games with a developer theme. The application uses a Flask backend API with SQLAlchemy ORM for database interactions, and an Astro/Svelte frontend with Tailwind CSS for styling. Please follow these guidelines when contributing:
44

5-
## Backend
5+
## Code standards
6+
7+
### Required Before Each Commit
8+
9+
- Run Python tests to ensure backend functionality
10+
- For frontend changes, run builds in the client directory to verify build success and the end-to-end tests, to ensure everything works correctly
11+
- When making API changes, update and run the corresponding tests to ensure everything works correctly
12+
- When updating models, ensure database migrations are included if needed
13+
- When adding new functionality, make sure you update the README
14+
- Make sure all guidance in the Copilot Instructions file is updated with any relevant changes, including to project structure and scripts, and programming guidance
15+
16+
### Global language guidance
17+
18+
- Use type hints for function parameters and return values for all languages which support them
619

7-
The backend is written using:
20+
### Python and Flask Patterns
821

9-
- Flask for the API
10-
- SQLAlchemy for the ORM
11-
- SQLite for the database
22+
- Use SQLAlchemy models for database interactions
23+
- Use Flask blueprints for organizing routes
24+
- Follow RESTful API design principles
1225

13-
## Frontend
26+
### Svelte and Astro Patterns
1427

15-
The frontend is written using:
28+
- Use Svelte for interactive components
29+
- Follow Svelte's reactive programming model
30+
- Create reusable components when functionality is used in multiple places
31+
- Use Astro for page routing and static content
1632

17-
- Astro for routing
18-
- Svelte for the components and interactivity
19-
- Tailwind CSS for styling
33+
### Styling
2034

21-
## GitHub Actions Workflows
35+
- Use Tailwind CSS classes for styling
36+
- Maintain dark mode theme throughout the application
37+
- Use rounded corners for UI elements
38+
- Follow modern UI/UX principles with clean, accessible interfaces
39+
40+
### GitHub Actions workflows
2241

2342
- Follow good security practices
24-
- Make sure to explicitly set the workflow permissions
43+
- Make sure to explicitly set the workflow permissions
44+
- Add comments to document what tasks are being performed
2545

26-
## Code standards
46+
## Scripts
47+
48+
- Several scripts exist in the `scripts` folder
49+
- Use existing scripts to perform tasks rather than performing them manually
50+
- Existing scripts:
51+
- `scripts/setup-env.sh`: Performs installation of all Python and Node dependencies
52+
- `scripts/run-server-tests.sh`: Calls setup-env, then runs all Python tests
53+
- `scripts/start-app.sh`: Calls setup-env, then starts both backend and frontend servers
54+
55+
## Repository Structure
2756

28-
- Use good variable names, avoiding abbreviations and single letter variables
29-
- Use the casing standard for the language in question (camelCasing for TypeScript, snake_casing for Python, etc.)
30-
- Use type hints in all languages which support them
57+
- `server/`: Flask backend code
58+
- `models/`: SQLAlchemy ORM models
59+
- `routes/`: API endpoints organized by resource
60+
- `tests/`: Unit tests for the API
61+
- `utils/`: Utility functions and helpers
62+
- `client/`: Astro/Svelte frontend code
63+
- `src/components/`: Reusable Svelte components
64+
- `src/layouts/`: Astro layout templates
65+
- `src/pages/`: Astro page routes
66+
- `src/styles/`: CSS and Tailwind configuration
67+
- `scripts/`: Development and deployment scripts
68+
- `data/`: Database files
69+
- `docs/`: Project documentation
70+
- `README.md`: Project documentation

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ jobs:
2222
cache: "pip"
2323

2424
- name: Install Python dependencies
25-
working-directory: ./server
26-
run: pip install -r requirements.txt
25+
run: ./scripts/setup-env.sh
2726

2827
# Frontend setup - Node.js
2928
- name: Set up Node.js
@@ -36,12 +35,3 @@ jobs:
3635
- name: Install JavaScript dependencies
3736
working-directory: ./client
3837
run: npm ci
39-
40-
# .NET setup
41-
- name: Setup .NET
42-
uses: actions/setup-dotnet@v3
43-
with:
44-
dotnet-version: '9.0.x'
45-
46-
- name: Display .NET version
47-
run: dotnet --version

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This repository contains the project for a 1 hour guided workshop to explore GitHub Copilot Agent Mode and related features in Visual Studio Code. The project is a website for a fictional game crowd-funding company, with a [Flask](https://flask.palletsprojects.com/en/stable/) backend using [SQLAlchemy](https://www.sqlalchemy.org/) and [Astro](https://astro.build/) frontend using [Svelte](https://svelte.dev/) for dynamic pages.
44

5+
To begin the workshop, start at [docs/README.md](./docs/README.md)
6+
7+
Or, if just want to run the app...
8+
59
## Launch the site
610

711
A script file has been created to launch the site. You can run it by:

docs/0-prereqs.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
# Exercise 0: Prerequisites
22

3-
Before we get started on the lab, there's a few tasks we need to complete to get everything ready. We need to get a copy of the repository which includes the code, then spin up a [codespace](https://github.com/features/codespaces) to create our code.
3+
Before we get started on the lab, there's a few tasks we need to complete to get everything ready. We need to get a copy of the repository which includes the code, then spin up a [codespace](https://github.com/features/codespaces) to use to create our code.
44

55
## Setting up the Lab Repository
66

77
To create a copy of the repository for the code you'll create an instance from the [template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository). The new instance will contain all of the necessary files for the lab, and you'll use it as you work through the exercises.
88

9-
1. Navigate to the GitHub repository for this lab: `https://github.com/github-samples/agents-in-sdlc`.
9+
1. In a new browser window, navigate to the GitHub repository for this lab: `https://github.com/github-samples/agents-in-sdlc`.
1010
2. Create your own copy of the repository by selecting the **Use this template** button on the lab repository page. Then select **Create a new repository**.
1111

1212
![Use this template button](images/use-template.png)
1313

14-
3. For labs at Microsoft build, choose **Microsoft-Build-2025** as the GitHub organization. Set the repository name to **310-<YOUR_GITHUB_HANDLE>**, replacing **<YOUR_GITHUB_HANDLE>** with your GitHub handle. So if your handle was Mona, you'd use **310-Mona**.
14+
> [!IMPORTANT]
15+
> If you are completing the workshop as part of an event being led by GitHub or Microsoft, follow the instructions provided by the mentors for naming the repository.
16+
17+
3. If you are completing the workshop as part of an event being led by GitHub or Microsoft, follow the instructions provided by the mentors. Otherwise, you can create the new repository in an organization where you have access to either GitHub Copilot Pro+ or GitHub Copilot Enterprise.
1518

1619
![Input the repository template settings](images/repository-template-settings.png)
1720

18-
4. Make a note of the repository path you created, which will be **Microsoft-Build-2025/310-<YOUR_GITHUB_HANDLE>**, as you will be referring to this later in the lab.
21+
4. Make a note of the repository path you created (`organization-or-user-name/repository-name`), as you will be referring to this later in the lab.
1922

2023
## Creating a codespace
2124

@@ -30,22 +33,12 @@ Next up, we will be using a codespace to complete the lab exercises. [GitHub Cod
3033

3134
![Create a new codespace](images/create-codespace.png)
3235

33-
4. Wait for the codespace to be created. This may take a few minutes depending on the container image size, the number of extensions being installed and any post install scripts that are being run. Please be patient while the codespace is being created.
34-
35-
![Screenshot showing the codespace when ready](images/codespace-startup.png)
36-
37-
## Update and restart extensions
38-
39-
The setup process for the codespace will install and setup [VS Code extensions](https://code.visualstudio.com/docs/configure/extensions/extension-marketplace). As with any software, updates may be needed. When your codespace is created we'll need to ensure everything is up-to-date.
40-
41-
1. Select **Extensions** on the workbench on the left side of your codespace.
36+
The creation of the codespace will take several minutes, although it's still far quicker than having to manually install all the services! That said, we can use this time to take advantage of our ability to assign tasks to GitHub Copilot which it can perform asynchronously, which we'll turn our attention to next!
4237

43-
![Screenshot of the extensions window with multiple extensions showing either Update or Reload Window buttons](images/extensions-updates.png)
38+
## Summary
4439

45-
2. Select **Update** on any extensions with an **Update** button. Repeat as necessary.
46-
3. Select **Reload Window** on any extensions with a **Reload Window** button to reload the codespace.
47-
4. When prompted by a dialog, select **Reload** to reload the window. This will ensure the latest version is being used.
40+
Congratulations, you have created a copy of the lab repository! You also began the creation process of your codespace, which you'll use when you begin writing code. We're going to return back to this after the next lesson, so don't worry.
4841

49-
## Setup Complete
42+
## Next step
5043

51-
Congratulations, you have created a copy of the lab repository! Now, let's move on to the [next step](./1-mcp.md), utilizing Model Context Protocol (MCP) to provide GitHub Copilot Agent Mode access to a suite of tools.
44+
Since we've got a few minutes, let's get Copilot working on some tasks asynchronously for us! We can do this by [creating issues and assigning them ot Copilot coding agent](./1-copilot-coding-agent.md).

0 commit comments

Comments
 (0)