Welcome to the comprehensive GitHub Copilot Workshop! This hands-on workshop will teach you to leverage AI-powered development through a real NBA sports application built with Next.js 14 (Frontend) and Python Flask (Backend).
βNote: No mastery of JavaScript, Python, or Next.js is needed - AI will generate most of the code for you in this exercise. Even if you are not very familiar, it's a great opportunity to leverage AI to quickly learn popular frameworks.
By the end of this workshop, you'll master:
- Core Copilot Features: Chat interactions, completions, and role prompting
- Advanced Workflows: Agent mode, Vision capabilities, and code optimization
- Specialized Integration: MCP servers and automated workflows
- Best Practices: Error handling, testing, and documentation with AI assistance
- GitHub Copilot License: Active GitHub Copilot license (paid tier, not the free version)
- IDE Setup: Install and update GitHub Copilot & GitHub Copilot Chat extensions in your IDE
- Authentication: Login to GitHub Copilot and verify both code completions and chat work
- Frontend Runtime: Install Node.js & npm. Verify with:
node -v npm -v
- Backend Runtime: Install Python 3.8+ & pip. Verify with:
python --version pip --version
- Docker (for MCP server tasks)
- GitHub Personal Access Token (for MCP integration)
This section provides a quick overview. For detailed setup, see Task 0.
-
Clone the repository
git clone <repository-url> cd GitHubCopilotWorkshop
-
Set up the Backend (Python Flask)
cd backend python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate pip install -r requirements.txt python app.py
Backend will run on http://localhost:8080
-
Set up the Frontend (Next.js) - In a new terminal
# From the root directory cd frontend npm install # Create .env.local file with: echo "NEXT_PUBLIC_API_URL=http://localhost:8080" > .env.local npm run dev
Frontend will run on http://localhost:3000
-
Open the application Navigate to http://localhost:3000 in your browser
GitHub Copilot NBA Companion - Your dedicated NBA companion! This app brings you:
- π Live NBA Results: Real-time game scores and statistics
- π― Player Information: Comprehensive player stats and profiles
- ποΈ Stadium Information: NBA venues and facility details
- π¨βπ« Coach Management: NBA coaches and their achievements
- β‘ Performance Optimization: Examples for code optimization exercises
- π§ Error Handling: Debugging and error resolution practice
This application follows a microservices architecture with separated frontend and backend:
- Port: 8080
- Purpose: RESTful API service providing all data endpoints
- Key Features:
- CORS-enabled for frontend communication
- JSON-based data storage
- Comprehensive error handling
- Health check endpoint
- Port: 3000
- Purpose: User interface and client-side logic
- Key Features:
- Server-side rendering (SSR)
- TypeScript for type safety
- Responsive design with Tailwind CSS
- Component library (shadcn/ui)
Browser (localhost:3000)
β HTTP Requests
Next.js Frontend
β API Calls (fetch)
Flask Backend (localhost:8080)
β JSON Response
Frontend renders data
- Framework: Next.js 14 with App Router
- Language: TypeScript for type safety
- Styling: Tailwind CSS with shadcn/ui components
- Testing: Jest and React Testing Library
- State Management: React Query (TanStack Query)
- Framework: Python Flask 3.0.0
- CORS: Flask-CORS for cross-origin requests
- Data Storage: JSON files (for workshop purposes)
- API Design: RESTful API endpoints
βββ backend/ # Python Flask Backend
β βββ app.py # Main Flask application
β βββ requirements.txt # Python dependencies
β βββ data/ # JSON data files
β β βββ nba-games.json
β β βββ stadiums.json
β β βββ player-info.json
β β βββ coaches.json
β βββ README.md # Backend documentation
βββ frontend/ # Next.js Frontend
β βββ src/ # Source code
β β βββ app/ # Next.js 14 App Router
β β β βββ (dashboard)/ # Dashboard layout group
β β β β βββ nba-scores/ # NBA game results
β β β β βββ stadiums/ # Stadium information
β β β β βββ optimization/ # Performance examples
β β β β βββ errors/ # Error handling examples
β β β βββ layout.tsx # Root layout
β β βββ components/ # Reusable UI components
β β β βββ ui/ # shadcn/ui components
β β βββ lib/ # Utility functions
β β βββ hooks/ # Custom React hooks
β βββ public/ # Static assets
β βββ __tests__/ # Test files
β βββ package.json # Node.js dependencies
β βββ tsconfig.json # TypeScript configuration
βββ .github/ # GitHub configuration
β βββ copilot-instructions.md # Custom Copilot instructions
β βββ chatmodes/ # Custom chat modes
β βββ prompts/ # Reusable prompt templates
βββ image/ # Workshop assets and screenshots
npm run dev # Start development server (port 3000)
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run test # Run Jest tests
npm run test:watch # Run tests in watch mode# From backend/ directory
python app.py # Start Flask server (port 8080)
# Note: Activate virtual environment first-
Navigate to the backend directory:
cd backend -
Create and activate a virtual environment:
python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install Python dependencies:
pip install -r requirements.txt
-
Start the Flask server:
python app.py
The backend will be available at http://localhost:8080
-
Verify the backend is running:
curl http://localhost:8080/api/health
-
Open a new terminal and navigate to the frontend directory:
cd frontend -
Install Node.js dependencies:
npm install
-
Create environment configuration:
# Create .env.local file echo "NEXT_PUBLIC_API_URL=http://localhost:8080" > .env.local
-
Start the development server:
npm run dev
The frontend will be available at http://localhost:3000
-
Open the application: Navigate to http://localhost:3000 in your browser
Select the appropriate AI model based on your task:
- GPT-4.1: Best for general development, UI components, basic API routes, code documentation, and bug fixes
- Claude Sonnet 4.5: Excellent for code optimization, complex problem-solving, agent mode tasks, and performance improvements
How to Switch Models:
- Open GitHub Copilot Chat
- Look for the model selector dropdown (usually shows current model)
- Click to see available options and select your preferred model
Imagine you are a new developer who just joined the team. You need to explore the project and understand its main components
- Open the github.com platform and access your repository (you can also use @workspace (#project in VS/Jetbrains) or #codebase in your IDE to query the whole project)
- Click on the GitHub Copilot icon to open a chat
- Explore the app by asking questions like:
- Can you tell me about this repository?
- What is the architecture of this application?
- Where is the backend API located and what framework is it using?
- Where is the frontend located and what framework is it using?
- How do the frontend and backend communicate?
- Which API endpoints are available in the backend?
- Where are the main UI components in the frontend?
- What packages does each service use?
Use GitHub Copilot's web search capabilities to learn about the technologies used in this project:
Instructions:
- Open GitHub Copilot Chat in Ask mode
- Ask these prompts one by one (don't copy-paste):
@github How do I create API endpoints in Flask?@github How does Next.js 14 App Router work?@github How do I fetch data from a backend API in Next.js 14?@github How do I configure CORS in Flask for a Next.js frontend?@github What is the difference between server and client components in Next.js 14?
By using @github you are: Getting answers grounded in web search, code search, and your enterprise's knowledge bases. You can tell that Copilot chat used bing search if you see bing as search resource:
Troubleshoot: If you don't see Bing in references, try prompting with "@github search the web, how do I..."
GitHub Copilot Chat role prompting allows you to define a specific role for Copilot, guiding it to provide more relevant and context-aware assistance. Additionally, you can enhance Copilot's responses by setting up custom instructions.
Setup Instructions:
- Copy and paste the following combined prompt into the
.github/copilot-instructions.mdfile:
You are a full-stack developer working on a modern web application with a separated architecture:
- **Frontend**: Next.js 14 with TypeScript, Tailwind CSS, and shadcn/ui components
- **Backend**: Python Flask API providing RESTful endpoints
Your expertise includes:
Frontend Development:
- **Framework Mastery**: Deep knowledge of Next.js 14 App Router, routing conventions, layouts, and server/client components
- **TypeScript Excellence**: Write type-safe code with proper interfaces, generics, and error handling
- **Modern Styling**: Use Tailwind CSS with shadcn/ui components for consistent, responsive design patterns
- **API Integration**: Fetch data from backend APIs with proper error handling and loading states
- **Performance Focus**: Implement lazy loading, code splitting, caching strategies, and Core Web Vitals optimization
Backend Development:
- **API Design**: Create secure, performant Flask REST APIs with proper validation and error handling
- **CORS Configuration**: Ensure proper cross-origin resource sharing for frontend communication
- **Data Management**: Work with JSON data files and implement CRUD operations
- **Python Best Practices**: Follow PEP 8, use type hints, and implement proper error handling
Code Generation Guidelines:
- Always include comprehensive comments explaining complex logic
- Implement robust error handling with user-friendly error messages
- Follow framework best practices for both frontend and backend
- Optimize for performance with proper memoization, suspense boundaries, and efficient data handling
- Include loading states, error boundaries, and fallback components in frontend
- Write reusable, composable components and functions that follow single responsibility principle
- Ensure responsive design that works across all device sizes
- Properly configure environment variables for API URLs
When providing solutions:
- Explain the reasoning behind architectural decisions
- Suggest performance improvements and potential optimizations
- Include relevant documentation and helpful comments
- Provide examples of proper error handling and edge cases
- Recommend best practices for maintainability and scalability
- Consider both frontend and backend implications of changes
- Test the custom instructions by asking Copilot any coding question and notice how it applies the custom instructions automatically
- The responses should include TypeScript for frontend, Python for backend, error handling, and proper architectural patterns
GitHub Copilot can review your code and provide feedback with suggested changes.
Instructions:
- Open
backend/app.py - Select the
get_nba_resultsfunction code - Right-click and choose 'Generate Code -> Review'
- Review Copilot's feedback and apply suggested improvements
- Repeat for other API endpoint functions in the backend
One of the common frustrations for developers is documenting their code properly, but Copilot is here to help!
Instructions:
- Open
backend/app.py - Use GitHub Copilot Chat to gain insights:
- Select the
get_nba_resultsfunction code and choose the/explainoption for a detailed breakdown
- Select the
- Generate documentation:
- Select the entire function, then press
Cmd+I(macOS) orCtrl+I(Windows) - Type
/doc- GitHub Copilot will generate documentation-style comments
- Select the entire function, then press
- Add
/docand comments to other API endpoint functions in the backend
Notice: When adding comments, ensure GitHub Copilot Chat applies custom instructions with each request.
Instructions:
- Open
frontend/src/util/calculator.js- the file contains simple calculator util functions - Open
frontend/src/util/calculator.test.js(this file should exist but be empty) - Select all the code in
calculator.jsand pressCmd+I(macOS) orCtrl+I(Windows) - Type
/tests- GitHub Copilot will generate unit tests for the selected functions - If they weren't created by Copilot in
calculator.test.js, copy the generated tests intocalculator.test.js - From the
frontenddirectory, run tests:npm test src/util/calculator.test.js - If tests fail, copy the terminal error message, select the failing test code, press
Ctrl+I/Cmd+I, and type/fixfollowed by pasting the error message
Alternative approach using Chat:
- Open GitHub Copilot Chat
- Attach the
frontend/src/util/calculator.jsfile to the chat - Ask: "Generate Jest unit tests for all functions in this calculator file"
- Copy the generated tests to
frontend/src/util/calculator.test.js
GitHub Copilot assists in fixing code errors by analyzing context to suggest corrections.
Instructions:
- Navigate to the errors page at http://localhost:3000/errors (this is an 'Add NBA player' page)
- Fill in the form and click 'Create player' button
- You should see a 404 error - the API endpoint was not found!
- Ask Copilot to
/explainthe error with context offrontend/src/app/(dashboard)/errors/page.tsx - The frontend sends a POST request to
/api/players- but does this route exist in the backend? - Open
backend/app.pyand search for the player creation endpoint - Find the bug: Compare the route name in the backend with what the frontend is calling. There's a mismatch!
- Fix the route name in
backend/app.pyto match the frontend request - Restart the backend server and test the form again
- You should now see "Player created successfully!" message
- Ask Copilot to rename the page from "errors" to something more descriptive like "add-player"
Note: This exercise demonstrates debugging API communication issues between frontend and backend.
Create a comprehensive player information display using file attachments.
Instructions:
-
Add these files to Chat context (attach files or drag&drop):
backend/app.py- Look at theget_player_infofunction to understand the APIbackend/data/player-info.json- Players data
-
Ask Copilot using either edit or agent mode:
Create a new Next.js page at /players-info that fetches player data from the backend API endpoint /api/player-info (running on http://localhost:8080). The page should display a list of player information showing only the id, name, team, weight, height, and position properties. Ensure each player is displayed in a separate card. Use TailwindCSS and shadcn components to style the output. The page should handle loading states and errors appropriately. -
Create the page in
frontend/src/app/(dashboard)/players-info/page.tsx -
The page should fetch from
${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080'}/api/player-info -
Open http://localhost:3000/players-info and verify results
Note: This demonstrates how the frontend communicates with the backend API to fetch and display data.
GitHub Copilot Chat can help you optimize code (refactor behavior without changing functionality).
Instructions:
- Start both services:
- Terminal 1:
cd backend && python app.py(backend on port 8080) - Terminal 2:
cd frontend && npm run dev(frontend on port 3000)
- Terminal 1:
- Click on 'Optimization' page in the web app left menu
- Wait until the page finishes loading - the page is intentionally slow for demonstration purposes
- Find the backend API route that serves the optimization data:
- Open
backend/app.pyand locate the/api/optimizeendpoint (around line 198)
- Open
- Choose chat model Claude Sonnet 4.5 for best optimization results
- Ask Copilot Chat: "Optimize this code to improve performance" while having the
optimizefunction in context - The function has an intentionally large prompt string that could be optimized
- Make the suggested optimizations in
backend/app.py - Restart the backend server and reload the page to verify it loads faster
Note: This demonstrates optimizing backend API performance. The execution time is shown on the page for comparison.
GitHub Copilot supports custom chat modes that create specialized AI assistants for specific tasks.
Instructions:
-
Explore existing modes:
- Navigate to
.github/chatmodes/directory - Open
plan.chatmode.mdto see the configuration - In Copilot Chat, try using custom modes from the model dropdown
- Navigate to
-
Create Your Own Custom Mode:
- Create a new file:
.github/chatmodes/reviewer.chatmode.md - Add the following content for a code review mode:
- Create a new file:
# Code Reviewer
You are a thorough code reviewer focused on best practices and maintainability.
## Instructions
- Always use single quotes in TypeScript
- Check for proper error handling
- Ensure consistent code formatting
- Verify accessibility standards
- Look for performance optimizations
- Suggest improvements for readability- Use the new mode from the mode picker
Why Custom Modes Are Powerful:
- Domain-specific expertise and context
- Standardized workflows and best practices
- Reduced need for detailed prompting
- Team consistency in AI interactions
Prompt files allow you to create reusable, shareable prompts for consistent development practices.
Instructions:
-
Explore existing prompt files:
- Navigate to
.github/prompts/directory - Open Copilot Chat and add
testing-strategy.prompt.mdas context to help create comprehensive test suites
- Navigate to
-
Create a Custom Prompt File:
- Create a new prompt file:
.github/prompts/api-security.prompt.md - Add the following content:
Secure REST API review: - Ensure all endpoints are protected by authentication and authorization - Validate all user inputs and sanitize data - Implement rate limiting and throttling - Implement logging and monitoring for security events
- Test the prompt by adding it as context in Copilot Chat
- Create a new prompt file:
-
Add additional existing chat modes and prompt files:
- Explore and utilize other prompt files in the
.github/directory to enhance your strategies and API security reviews, by following this link: https://github.com/github/awesome-copilot
- Explore and utilize other prompt files in the
Benefits of Prompt Files:
- Team-wide consistency in AI interactions
- Reusable knowledge and context
- Better onboarding for new team members
- Standardized coding practices and patterns
The rollback feature allows you to edit previous prompts and reapply changes with different models or instructions.
Instructions:
-
Practice Rollback Workflow:
- Ask Copilot Chat to create a simple NBA player card component
- After receiving the response, click on your original prompt in the chat history
- Edit the prompt to request additional features (e.g., "also add player statistics and hover effects")
- Switch to a different model (e.g., from GPT-4.1 to Claude Sonnet 4.5)
- Apply the changes and observe how Copilot reverts and reapplies with the new context
-
Advanced Rollback Scenarios:
- Test different AI models on the same prompt
- Refine prompts iteratively without losing context
- Compare code generation approaches
- Fix issues by adjusting original instructions
Why Rollback Is Powerful:
- Non-linear development workflow
- Easy experimentation with different approaches
- Efficient prompt refinement
- Better model comparison and selection
GitHub Copilot's agent mode can iterate on its own code, recognize errors, and fix them automatically.
Instructions:
- Open GitHub Copilot Chat, choose agent mode
- From the dropdown menu select Agent mode and Claude Sonnet 4.5 model
- Ensure both backend and frontend services are running
- Include a prompt to generate a new Stadium feature:
Let's enhance this application by adding an NBA Stadiums page.
1. First, verify if the backend API endpoint for stadiums already exists in backend/app.py (it should return data from backend/data/stadiums.json).
2. Create a new Next.js page in frontend/src/app/(dashboard)/stadiums/page.tsx that fetches stadium data from the backend API at ${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080'}/api/stadiums.
3. Build a React component that displays the stadium information as cards, showing name, location, capacity, and team.
4. Add a navigation link to this new page in the main navigation (frontend/src/components/navigation.tsx).
5. Use Tailwind CSS and shadcn components to style the UI.
π‘ Agent Mode Prompt Guidelines:
- Be specific: Include exact file paths (e.g.,
backend/app.pyfor API endpoints,frontend/src/app/(dashboard)/stadiums/page.tsxfor frontend pages) - Break into steps: Number your requirements (1, 2, 3...) - agent mode works best with sequential tasks
- Mention technology: Specify "Next.js 14", "TypeScript", "Tailwind CSS", "shadcn/ui", "Flask", "Python"
- Request iteration: End with "Please implement this step by step and let me review each step"
- Include context: Reference existing project structure and data files (backend/data/, frontend/src/)
- Review the output and monitor live changes in your codebase
- Accept or reject each step suggested by the agent
- Open the app at http://localhost:3000 to verify the Stadiums navigation tab and functionality
You can attach an example image and work with it directly in Copilot Chat.
Instructions:
- Open Copilot Chat and select Claude Sonnet 4.5 model
- Enable preview feature: chat.todoListTool.enable (Supported in VSCode version 1.103 and above)
- Navigate to the image folder and attach
login.pngto your chat - Ask Copilot using agent mode:
Write a React component code based on login.png image. Track your progress with a todo list. - Integrate the component into your application
- GitHub PAT (Personal Access Token)
- Azure DevOps PAT (Personal Access Token) (optional)
-
Switch to Agent Mode:
- Open GitHub Copilot Chat and select Agent mode
-
Add MCP Servers:
- Click the tools icon in the agent mode interface
- Click "Add MCP server... icon"
- Select "Browse MCP Servers..."
- Add MCP servers: GitHub, Playwright, Azure DevOps & Atlassian
-
Use MCP Tools in Agent Mode:
- Now you can use the added MCP server tools in your agent mode sessions
- Use your Azure DevOps MCP to see what you are working on this sprint
- Use Atlassian MCP to see your Confluence pages
- Use GitHub MCP to interact with your GitHub repositories
Note: Review all GitHub MCP Server available tools at: https://github.com/github/github-mcp-server
Goal: Automatically test your NBA application's critical user flows without writing test code.
Instructions:
-
Ensure your app is running:
npm run dev -
In Agent mode with Playwright MCP enabled, ask:
Using Playwright mcp, test the complete user flow: 1. Navigate to http://localhost:3000 2. Click on "NBA Scores" in the navigation 3. Verify game scores are displayed 4. Click on "Stadiums" 5. Verify stadium cards are rendered 6. Take screenshots of each page 7. Generate a test report with pass/fail results -
Review the automated test execution and results
-
Ask Copilot to fix any failing tests or improve coverage
Why This Is Powerful:
- No manual testing needed
- Instant regression detection
- Visual proof of functionality
- AI handles complex selectors and timing automatically
Agent Skills are a new open standard for AI agent automation that teach GitHub Copilot how to perform specialized tasks in a repeatable, modular way. Skills are stored in the .github/skills/ directory as structured packages of instructions that agents can automatically discover and use when relevant to your task.
This workshop includes a WebApp Testing skill located at .github/skills/webapp-testing/SKILL.md.
The WebApp Testing skill enables automated UI testing for web applications using Playwright, providing comprehensive test coverage, visual verification through screenshots, and detailed test reports.
Use the webapp-testing skill when you need to:
- β Test complete user flows and interactions
- β Verify that UI components render correctly
- β Ensure navigation between pages works as expected
- β Capture screenshots for visual verification
- β Generate test reports with pass/fail results
- β Perform regression testing after code changes
- Ensure your app is running: Start the development server with
npm run dev - Open Agent mode: Switch to Agent mode in GitHub Copilot Chat
- Enable Playwright MCP: Add Playwright MCP server in Agent mode tools
- Reference the skill: Mention "webapp-testing skill" in your prompt, or simply describe the testing task
Using the webapp-testing skill, test the complete user flow:
1. Navigate to http://localhost:3000
2. Click on "NBA Scores" in the navigation
3. Verify game scores are displayed
4. Click on "Stadiums"
5. Verify stadium cards are rendered
6. Take screenshots of each page
7. Generate a test report with pass/fail results
Copilot will automatically:
- Load the webapp-testing skill instructions
- Use Playwright MCP to interact with your application
- Execute each test step systematically
- Capture screenshots at specified points
- Generate a comprehensive test report
- Identify any issues and suggest fixes
Try testing features you built earlier in the workshop using the webapp-testing skill. For example, test the players-info page (Task 1.8) or the add player form (Task 1.7) by asking Copilot to navigate, verify, and take screenshots.
Want to create a custom skill for your team? Follow these steps:
-
Create the skill directory:
mkdir -p .github/skills/my-custom-skill
-
Create the SKILL.md file with YAML frontmatter:
--- name: My Custom Skill description: Brief description of what the skill does --- # My Custom Skill Detailed instructions on when and how to use this skill...
-
Add supporting resources: Include any scripts, templates, or files needed
-
Test the skill: Use Agent mode and reference your skill in prompts
-
Share with your team: Commit to your repository for team-wide access
- π GitHub Docs: About Agent Skills
- π οΈ VS Code: Use Agent Skills
- π¬ Anthropic Skills Repository
- π Agent Skills Specification
- Create a new issue in this GitHub repository:
Example:
- Title:
Create dark mode toggle for this web app - Description:
Create a dark mode ability for this web app, it should be a toggle on the top right corner of the page
- Title:
- Assign the issue to copilot
- Click on "Assignees"
- Select "Copilot"
- PR should be created automatically by Copilot
- You will be called to review once the PR is complete.
- Open the extensions marketplace in your IDE
- Search for "Effective AI Kit" and install it
- in your chat window, type '/' to see the available prompts, for example:
- "/create-readme"
- "/dotnet-design-pattern-review "
- Write a message to Copilot chat - you should see instruction files being referenced.
- "performance-optimization.instructions.md"
- "memory-bank.instructions.md"
GitHub Copilot CLI is a powerful terminal-based AI assistant that brings the full capabilities of GitHub Copilot directly to your command line. Unlike traditional CLI tools, Copilot CLI works as an interactive agent that can understand your codebase, make changes, and help you build features through natural language conversations.
Step 1: Install Copilot CLI
macOS/Linux:
# Install using npm (recommended)
npm install -g @githubnext/github-copilot-cliWindows:
# Install using npm
npm install -g @githubnext/github-copilot-cliStep 2: Verify Installation
copilot --versionStep 3: Open your workspace
Navigate to the folder containing your code and launch Copilot CLI:
cd /path/to/your/project
copilotThe first time you run it, you'll be prompted to authenticate with GitHub. Follow the authentication flow in your browser.
Once authenticated, Copilot CLI runs as an interactive agent in your terminal.
Launch Copilot CLI:
# Navigate to your project directory
cd ../../GitHub_Copilot_Workshop
# Launch Copilot CLI
copilotSwitch Models (Optional):
Once Copilot CLI is running, you can switch models using the /model slash command:
/model
Usefull command:
/share β Share session to markdown file or GitHub gist
/mcp β Manage MCP server configurations
/usage β Display session usage metrics and statistics
Basic Usage:
After launching Copilot CLI, simply describe what you want to accomplish in natural language. Copilot will:
- Understand your codebase context
- Generate or modify code files
- Execute commands when appropriate
- Explain its reasoning and approach
-
Launch Copilot CLI in the workshop directory:
-
Give Copilot a prompt to add a complete Teams feature:
Create a new Teams API route and display it on the web interface. The API should return a list of NBA teams with their name, city, and conference. Add a new page at /teams that displays this data in cards using Tailwind CSS and shadcn/ui components. Also add a navigation link to the teams page. -
Review Copilot's plan:
- Copilot will analyze your codebase structure
- It will show you which files it plans to create or modify
- Review the proposed changes before accepting
-
Accept or refine the changes:
- If you're happy with the plan, confirm to proceed
- If you want adjustments, provide additional instructions
- Copilot will iterate based on your feedback
Continue your Copilot CLI session and add a search feature:
Add a search bar to the Teams page that allows users to filter teams by name or city.
The search should work in real-time as the user types.
Ask Copilot to build a more complex feature:
Create a new page at /player-stats that shows player statistics.
Create an API route that returns sample data for top 10 NBA players with their points, rebounds, and assists.
Display the data in a sortable table.
Add this page to the navigation menu.
Create a new project to build your own MCP server.
- Latest version of Node.js installed
macOS/Linux:
mkdir weather
cd weather
npm init -y
npm install @modelcontextprotocol/sdk zod
npm install -D @types/node typescript
mkdir src
touch src/index.tsWindows:
md weather
cd weather
npm init -y
npm install @modelcontextprotocol/sdk zod
npm install -D @types/node typescript
md src
new-item src\index.tsCreate a weather MCP server that provides weather alerts and forecasts using the National Weather Service API.
Key Components:
- Server setup with MCP SDK
- Helper functions for API requests
- Tool implementation for weather data
- Error handling and validation
Test Your Server:
- Build:
npm run build - Add to VS Code settings.json MCP configuration
- Test in Agent mode with weather queries
- Start with Task 0 - Set up your environment and model selection
- Progress through Task 1 systematically - Each sub-task builds on previous knowledge
- Continue with Task 2 - Intermediate features and advanced chat capabilities
- Experience Task 3 - Agent mode capabilities
- Try Bonus Tasks 4-5 - For advanced workflows and integrations
- π€ Experiment freely - Try different prompts and approaches
- π Read instructions carefully - Each task builds on previous knowledge
- π Practice iteratively - Use Copilot to refine and improve your code
- π£οΈ Ask Copilot questions - It's your coding assistant and teacher
- π― Focus on learning - The goal is to understand Copilot's capabilities
Common Issues:
- Port 8080 already in use: Change the port in
backend/app.pyor kill the process usinglsof -ti:8080 | xargs kill -9 - Python dependencies not found: Ensure virtual environment is activated:
source venv/bin/activate(macOS/Linux) orvenv\Scripts\activate(Windows) - CORS errors: Verify the backend is running and CORS origins in
backend/app.pymatch your frontend URL
- Copilot not responding: Check your authentication and license status
- API connection errors:
- Verify backend is running on port 8080
- Check
.env.localhasNEXT_PUBLIC_API_URL=http://localhost:8080 - Test backend directly:
curl http://localhost:8080/api/health
- Build errors: Run
npm installto ensure all dependencies are installed - Port 3000 conflicts: Try using a different port with
npm run dev -- -p 3001
- Google Fonts errors during build: This is expected in restricted networks. The app will still work in development mode with
npm run dev - External API failures: Some workshop features may require internet access
Getting Help:
- Use GitHub Copilot Chat to debug issues
- Check the console for error messages
- Refer to task-specific troubleshooting in each section
- Review
backend/README.mdfor backend-specific help
This workshop is designed for learning GitHub Copilot. Feel free to:
- Experiment with the code
- Try different Copilot approaches
- Share your learning experiences
- Suggest improvements to the workshop content
This project is for educational purposes as part of the GitHub Copilot workshop.
Ready to begin? Start with Task 0 and begin your GitHub Copilot journey! π



