Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .mocharc.json/ hello_world_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"spec": "test/**/*.js",
"timeout": 5000,
"reporter": "spec"
}

const assert = require('assert');
describe('Application', () => {
it('should run correctly', () => {
assert.strictEqual(true, true);
});
});
110 changes: 50 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,72 @@
# 🚀 Complete Guide to GitHub Copilot for Developers
# README.md

Welcome to the official repository for the **Complete Guide to GitHub Copilot for Developers**. This repo is your one-stop destination for mastering GitHub Copilot. Dive into hands-on labs, access curated resources, and elevate your development workflow with AI-powered coding.
# Python Weather API

![GitHub Copilot Badge](https://img.shields.io/badge/GitHub-Copilot-blue?style=flat-square&logo=github)
![License Badge](https://img.shields.io/badge/license-MIT-green?style=flat-square)
This project implements a simple weather API using Python and Flask. It provides mock weather data for demonstration and testing purposes.

---

## 📘 About This Repository

This repository supports my video course **Complete Guide to GitHub Copilot for Developers**. Here, you'll find everything you need to maximize your learning:

- **Hands-On Labs** to practice what you learn.
- **First- and Third-Party GitHub Copilot Resources** for deeper insights.
- **Code Samples, Links, and Materials** to complement the course.

---
## Project Structure

## 🔗 Essential Resources
```
python_weather_api/
├── __init__.py
├── app.py # Main Flask application (entry point)
├── models.py # Weather data model class
└── mock_data.py # Mock weather data dictionary
setup.py
pyproject.toml
README.md
```

### 🌟 Must-Read GitHub Copilot Resources
1. [GitHub Copilot Documentation](https://docs.github.com/en/copilot)
Official resource to learn everything about GitHub Copilot.
2. [GitHub Copilot Pricing](https://github.com/features/copilot)
Detailed breakdown of subscription options.
3. [VS Code Extension for GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)
Install the extension to get started with Copilot in Visual Studio Code.
- **app.py**: Main Flask app, defines the `/weather` endpoint.
- **models.py**: Contains the `Weather` class for weather data modeling.
- **mock_data.py**: Contains a dictionary with mock weather data.

### 🔧 Helpful Third-Party Resources
1. [GitHub Blog: Copilot Updates](https://github.blog/tag/copilot/)
Stay up to date with the latest features and enhancements.
2. [Microsoft Learn: GitHub Copilot Learning Path](https://learn.microsoft.com/en-us/training/paths/copilot/)
Free, interactive learning modules to supplement your course.
## Dependencies

---
You need Python and Flask installed.
Install Flask with:

## 📂 Table of Contents
```sh
pip install Flask
```

### 🔹 **Hands-On Labs**
Each lab is a practical exercise designed to reinforce what you've learned in the course.
## Running the API

1. [Lesson 1: Configuring Copilot in Your Development Environment](./hands-on-labs/hol-lesson01.md)
2. [Lesson 2: Writing Effective Prompts for GitHub Copilot](./hands-on-labs/hol-lesson02.md)
3. [Lesson 3: Generating Code with GitHub Copilot](./hands-on-labs/hol-lesson03.md)
4. [Lesson 4: Refactoring and Debugging with GitHub Copilot](./hands-on-labs/hol-lesson04.md)
5. [Lesson 5: Building a Web Application with GitHub Copilot](./hands-on-labs/hol-lesson05.md)
6. [Lesson 6: Analyze and Visualize Data using GitHub Copilot](./hands-on-labs/hol-lesson06.md)
7. [Lesson 7: Mastering GitHub Copilot for Code Reviews](./hands-on-labs/hol-lesson07.md)
8. [Lesson 8: Advanced Copilot Techniques](./hands-on-labs/hol-lesson08.md)
9. [Lesson 9: Copilot for Testing](./hands-on-labs/hol-lesson09.md)
10. [Lesson 10: Copilot for Documentation](./hands-on-labs/hol-lesson10.md)
11. [Lesson 11: Copilot Best Practices](./hands-on-labs/hol-lesson11.md)
12. [Lesson 12: Copilot in Production](./hands-on-labs/hol-lesson12.md)
**Important:**
Run the API from the project root using the module flag to ensure imports work correctly:

---
```sh
python -m python_weather_api.app
```

## 🛠️ How to Use This Repository
You should see output indicating the server is running, e.g.:

1. **Start with the Labs:** Follow the sequence of labs above for a structured learning experience.
2. **Explore the Resources:** Use the links provided to deepen your understanding of GitHub Copilot.
3. **Practice and Experiment:** Use the included code samples and examples for hands-on learning.
```
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
```

---
## Testing the API with curl

## 📄 License
Open a new terminal and run:

This repository is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.
```sh
curl http://127.0.0.1:5000/weather
```

---
### Expected Response

## 📬 Contact
```json
{
"location": "New York",
"temperature": "15°C",
"condition": "Sunny"
}
```

**Tim Warner**
- [LinkedIn](https://www.linkedin.com/in/timothywarner/)
- [Twitter](https://twitter.com/timwarner)
- [Email](mailto:tim@timwarner.com)
- [Website](https://www.timwarner.com)
This confirms the API is running and returning the expected mock data.

---

Thank you for learning with me. Let’s unlock the full potential of GitHub Copilot together!
**Tip:**
You can modify `mock_data.py` to change the mock weather data returned by the API.
4 changes: 3 additions & 1 deletion examples/fizz-buzz.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ function fizzBuzz() {
if (i % 5 === 0) output += 'Buzz';
console.log(output || i);
}
}
}

fizzBuzz();
2 changes: 2 additions & 0 deletions examples/node-app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { engine } = require('express-handlebars');
const index = require('./routes/index');
const who = require('./routes/who');
const contact = require('./routes/contact');
const blogRouter = require('./routes/blog');

const app = express();

Expand All @@ -18,6 +19,7 @@ app.use('/', express.static('public'));
app.use('/', index);
app.use('/who', who);
app.use('/contact', contact);
app.use('/blog', blogRouter);

app.listen(config.port, () => {
console.log(`Demo app is running on ${config.port}!`);
Expand Down
1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/_mocha

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/flat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/glob

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/handlebars

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/he

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/js-yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/mocha

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/node-which

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/node-app/node_modules/.bin/uglifyjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading