Skip to content

Commit 38df12d

Browse files
authored
Merge pull request #13 from githubuniverseworkshops/update-grammar-and-content
Update grammar and content
2 parents d45ed04 + fb9e241 commit 38df12d

29 files changed

+217
-30
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Without further ado, let's get started.
3131
1. [The OctoFit Tracker app story](docs/1_Story/README.md)
3232
2. [Prerequisites and a setup of the development environment](docs/2_Prerequisites/README.md)
3333
3. [Getting started - app frontend and backend creation](docs/3_GettingStarted/README.md)
34-
4. [The OctoFit Tracker database and app backend creation](docs/4_BackendSettings/README.md)
35-
5. [Populate the database with sample data](docs/5_PopulateDBwData/README.md)
36-
6. [Using the Codespace endpoint to access the Django REST Framework](docs/6_CodespaceDjangoRESTFramework/README.md)
37-
7. [:fire: REFERENCE - Troubleshooting guide and FAQs](docs/7_Troubleshooting/README.md)
34+
4. [Let's build some beautiful front end](docs/4_FrontEndWork/README.md)
35+
5. [The OctoFit Tracker database and app backend creation](docs/5_BackendSettings/README.md)
36+
6. [Populate the database with sample data](docs/6_PopulateDBwData/README.md)
37+
7. [Using the Codespace endpoint to access the Django REST Framework](docs/7_CodespaceDjangoRESTFramework/README.md)
38+
8. [What's next?](docs/8_WhatsNext/README.md)
39+
9. [:fire: REFERENCE - Troubleshooting guide and FAQs](docs/9_Troubleshooting/README.md)

docs/1_Story/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ Join us for this exciting journey into the future of software development, where
107107

108108
In this workshop, you are going to assume to be the lead developer. You will be responsible for building the application with GitHub Copilot’s help. Good luck!
109109

110-
[Next: Prerequisite and setup of the development environment](../2_Prerequisites/README.md)
110+
[Next: Prerequisite and setup of the development environment :arrow_forward:](../2_Prerequisites/README.md)

docs/2_Prerequisites/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ When the codespace is created you may get the following message for the GitHub C
3838
- If you choose this option we recommend using VSCode as your IDE, but this workshop is not limited to VSCode
3939
- URL for REACT and Django will be `http://localhost` or `http://127.0.0.1`
4040

41-
[Back :: Previous: The OctoFit Tracker app story](../1_Story/README.md) | [Next :: Getting started - app frontend and backend creation](../3_GettingStarted/README.md)
41+
If you ever get stuck, don't worry. Please check out the [troubleshooting guide](../9_Troubleshooting/), and GitHub Experts will be here to help you.
42+
43+
[:arrow_backward: Previous: The OctoFit Tracker app story](../1_Story/README.md) | [Next: Getting started - app frontend and backend creation :arrow_forward:](../3_GettingStarted/README.md)

docs/3_GettingStarted/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ Important to avoid using public code and we do NOT need to initialize the git re
7575

7676
![octofit-tracker app directory tree](./3_3_OctoFitTrackerDirTree.png)</br>
7777

78-
[Back :: Previous: Prerequisites and development environment setup](../2_Prerequisites/README.md) | [Next :: The OctoFit Tracker database and app backend creation](../4_BackendSettings/README.md)
78+
[:arrow_backward: Previous: Prerequisites and development environment setup](../2_Prerequisites/README.md) | [Next: Let's work on front end stuff :arrow_forward:](../4_FrontEndWork/README.md)
140 KB
Loading
70.9 KB
Loading
Loading
126 KB
Loading
151 KB
Loading

docs/4_FrontEndWork/README.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Let's build some beautiful front end
2+
3+
In this section, we will start by setting up the face of our OctoFit application by building the front end page. To do that, we will keep it as simple as possible for now. We need resources like **HTML** and **CSS** to start decorating first, and we will later modify the page to extend the functionalities.
4+
5+
## Goals/Outcome
6+
7+
- Understand the basic strategies around designing the **OctoFit Tracker** app by asking **GitHub Copilot** Chat
8+
- Start getting the feel for OctoFit app by generating HTML and CSS resources
9+
- See a front-end page with a greeting message
10+
11+
Let's take a look at what we have so far by expanding the `octofit-tracker/frontend`. It will look something like this:
12+
13+
![Front end structure](./4_1_FrontEndStructure.jpg)
14+
15+
Let's expand `public` section because that is where we will find our static files.
16+
17+
Type the following prompt in GitHub Copilot Chat:
18+
19+
> TIP: we are going to use gpt-4o as our OpenAI GPT model for this GitHub Universe Workshop
20+
21+
```text
22+
Now, how can I add HTML and CSS on these to make it more OctoFit tracker like?
23+
24+
Launch the port in 8080
25+
Make sure to add a simple navigation
26+
Ignore bootstrap for now
27+
```
28+
29+
If I type that command in the GitHub **Copilot Chat**, it may look like this:
30+
31+
![Prompt example](./4_2_PromptFrontEnd.jpg)
32+
33+
And the generated response might look like this:
34+
35+
![Generated response exampe](./4_3_GeneratedResponsePrompt.jpg)
36+
37+
> :warning: **TIP:** What if you don't get the same response? That's okay! The beauty of GitHub Copilot is that it is generative, and it will give you a different response each time. The key is to be persistent and keep asking the same question in different ways until you get a response that you are happy with. :smile:
38+
39+
And if you type the following command in the GitHub **Copilot Chat**, it will create a new port in `8080`.
40+
41+
![Opening up port](./4_4_OpeningUpFrontend.jpg)
42+
43+
And the final result should look like this:
44+
45+
![Frontend result](./4_5_WebsiteFrontend.jpg)
46+
47+
That is it! Please refer to the **Solution** below or the [troubleshoot guide](../9_Troubleshooting/README.md) if you encounter any issues.
48+
49+
## Solution
50+
51+
This shows one possible solution where you need to make a change:
52+
53+
### Modify the following files:
54+
55+
`src/App.js`
56+
57+
```javascript
58+
import React from 'react';
59+
import './App.css';
60+
61+
function App() {
62+
return (
63+
<div className="App">
64+
<nav className="navbar">
65+
<ul>
66+
<li><a href="/">Home</a></li>
67+
<li><a href="/profile">Profile</a></li>
68+
<li><a href="/activities">Activities</a></li>
69+
<li><a href="/teams">Teams</a></li>
70+
<li><a href="/leaderboard">Leaderboard</a></li>
71+
<li><a href="/workouts">Workouts</a></li>
72+
</ul>
73+
</nav>
74+
<header className="App-header">
75+
<h1>Welcome to OctoFit Tracker</h1>
76+
</header>
77+
</div>
78+
);
79+
}
80+
81+
export default App;
82+
```
83+
84+
Create or modify `src/App.css`
85+
86+
```css
87+
.App {
88+
text-align: center;
89+
}
90+
91+
.navbar {
92+
background-color: #333;
93+
overflow: hidden;
94+
}
95+
96+
.navbar ul {
97+
list-style-type: none;
98+
margin: 0;
99+
padding: 0;
100+
}
101+
102+
.navbar li {
103+
float: left;
104+
}
105+
106+
.navbar li a {
107+
display: block;
108+
color: white;
109+
text-align: center;
110+
padding: 14px 16px;
111+
text-decoration: none;
112+
}
113+
114+
.navbar li a:hover {
115+
background-color: #111;
116+
}
117+
118+
.App-header {
119+
background-color: #282c34;
120+
min-height: 100vh;
121+
display: flex;
122+
flex-direction: column;
123+
align-items: center;
124+
justify-content: center;
125+
font-size: calc(10px + 2vmin);
126+
color: white;
127+
}
128+
```
129+
130+
131+
`package.json`
132+
Update the following section:
133+
134+
```json
135+
"scripts": {
136+
"start": "PORT=8080 react-scripts start",
137+
"build": "react-scripts build",
138+
"test": "react-scripts test",
139+
"eject": "react-scripts eject"
140+
},
141+
```
142+
143+
### Run the following commands:
144+
145+
```bash
146+
cd octofit-tracker/frontend
147+
```
148+
149+
Then, followed by...
150+
151+
```bash
152+
npm start
153+
```
154+
155+
Check the browser at the port `8080` to see the changes.
156+
157+
[:arrow_backward: Previous: Getting started - app frontend and backend creation](../3_GettingStarted/README.md) | [Next: The OctoFit Tracker database and app backend creation :arrow_forward:](../5_BackendSettings/README.md)

docs/4_BackendSettings/README.md renamed to docs/5_BackendSettings/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ In our next steps lets think step by step and setup the following in this order
1616
6. make sure urls.py has a root, admin, and api endpoints
1717
```
1818

19-
![OctoFit Tracker backend prompt](./4_1_BackendSettingsPrompt.png)</br>
20-
![OctoFit Tracker backend response step 1](./4_2_BackendSettingsStep1.png)</br>
21-
![OctoFit Tracker backend response step 2 and 3](./4_2_BackendSettingsStep2Step3_1.png)</br>
22-
![OctoFit Tracker backend response step 3 continued](./4_2_BackendSettingsStep3_2.png)</br>
23-
![OctoFit Tracker backend response step 3 continued](./4_2_BackendSettingsStep3_3.png)</br>
19+
![OctoFit Tracker backend prompt](./5_1_BackendSettingsPrompt.png)</br>
20+
![OctoFit Tracker backend response step 1](./5_2_BackendSettingsStep1.png)</br>
21+
![OctoFit Tracker backend response step 2 and 3](./5_2_BackendSettingsStep2Step3_1.png)</br>
22+
![OctoFit Tracker backend response step 3 continued](./5_2_BackendSettingsStep3_2.png)</br>
23+
![OctoFit Tracker backend response step 3 continued](./5_2_BackendSettingsStep3_3.png)</br>
2424

2525
### Sample settings.py
2626

@@ -189,4 +189,4 @@ urlpatterns = [
189189
]
190190
```
191191

192-
[Back :: Previous: Getting started - app frontend and backend creation](../3_GettingStarted/README.md) | [Next :: Populate the database with sample data](../5_PopulateDBwData/README.md)
192+
[:arrow_backward: Previous: Let's work on front end](../4_FrontEndWork/README.md) | [Next: Populate the database with sample data :arrow_forward:](../6_PopulateDBwData/README.md)

docs/5_PopulateDBwData/README.md renamed to docs/6_PopulateDBwData/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Let's use manage.py to get everything setup we need to populate_db command inclu
1010

1111
### Example of not being specfic in prompting Copilot Chat
1212

13-
![populate db Code your app name](./5_1_PopulateDbCodeYourAppNameFirst.png)
13+
![populate db Code your app name](./6_1_PopulateDbCodeYourAppNameFirst.png)
1414

1515
## Example of being more specific in our prompt
1616

@@ -27,9 +27,9 @@ Let's use manage.py to get the database setup and populated based on fields in m
2727
- Include steps to migrate in the octofit_tracker project
2828
```
2929

30-
![populate the database with data prompt](./5_1_PopulateDBwDataPrompt.png)
31-
![create the populate_db.py step 1_1](./5_2_PopulateDBwDataStep1_1.png)
32-
![create the populate_db.py step 1_2](./5_2_PopulateDBwDataStep1_2.png)
30+
![populate the database with data prompt](./6_1_PopulateDBwDataPrompt.png)
31+
![create the populate_db.py step 1_1](./6_2_PopulateDBwDataStep1_1.png)
32+
![create the populate_db.py step 1_2](./6_2_PopulateDBwDataStep1_2.png)
3333

3434
### Sample code for populate_db.py
3535

@@ -146,4 +146,4 @@ class Command(BaseCommand):
146146

147147
![Migrate and populate db](./5_3_MigratePopulateDb.png)
148148

149-
[Back :: Previous: Getting started - app frontend and backend creation](../4_BackendSettings/README.md) | [Next :: Using the Codespace endpoint to access the Django REST Framework](../6_CodespaceDjangoRESTFramework/README.md)
149+
[:arrow_backward: Previous: The OctoFit Tracker database and app backend creation](../5_BackendSettings/README.md) | [Next: Using the Codespace endpoint to access the Django REST Framework :arrow_forward:](../7_CodespaceDjangoRESTFramework/README.md)

docs/6_CodespaceDjangoRESTFramework/README.md renamed to docs/7_CodespaceDjangoRESTFramework/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: application/json Vary: Accep
3737
}
3838
```
3939

40-
[Back :: Previous: Getting started - app frontend and backend creation](../4_BackendSettings/README.md | [Next :: Using the Codespace endpoint to access the Django REST Framework](../6_CodesapceDjangoRESTFramework/)
40+
[:arrow_backward: Previous: Populate DB data](../6_PopulateDBwData) | [Next: What's next :arrow_forward:](../8_WhatsNext/README.md)

docs/7_Troubleshooting/README.md

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

docs/8_WhatsNext/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# What's next?
2+
3+
You made it this far! Congraulation!
4+
5+
![Congratulation](https://octodex.github.com/images/hula_loop_octodex03.gif)
6+
7+
What's next? From here, you can continue to leverage **GitHub Copilot** to finish the rest of exercises.
8+
9+
Also, be sure to checkout self-paced documentation to build the application from scratch:
10+
11+
[**gh.io/octofit-tutorial**](https://gh.io/octofit-tutorial)
12+
13+
Make sure to leave the feedback on the workshop and the documentation by following this link:
14+
15+
[:speech_balloon: We want to hear from you! - **github.com/orgs/community/discussions/142536**](https://github.com/orgs/community/discussions/142536)
16+
17+
Thank you again. Happy coding with **GitHub Copilot**!
18+
19+
[:house_with_garden: Go back to the main page](../../README.md)

docs/9_Troubleshooting/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Troubleshooting guide and FAQ
2+
3+
## Troubleshooting guide
4+
5+
<details>
6+
<summary>I am getting a different answer. What do I do?</summary>
7+
Please check the section where you can copy-and-paste the code if you want to follow along.
8+
</details>
9+
10+
## FAQs
11+
12+
<details>
13+
<summary>How can I enable Copilot?</summary>
14+
For the workshop, it should be already enabled. If you need any help, please reach out to the GitHub Expert Service team.
15+
</details>
16+
17+
18+

0 commit comments

Comments
 (0)