-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from githubuniverseworkshops/update-grammar-an…
…d-content Update grammar and content
- Loading branch information
Showing
29 changed files
with
217 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,157 @@ | ||
# Let's build some beautiful front end | ||
|
||
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. | ||
|
||
## Goals/Outcome | ||
|
||
- Understand the basic strategies around designing the **OctoFit Tracker** app by asking **GitHub Copilot** Chat | ||
- Start getting the feel for OctoFit app by generating HTML and CSS resources | ||
- See a front-end page with a greeting message | ||
|
||
Let's take a look at what we have so far by expanding the `octofit-tracker/frontend`. It will look something like this: | ||
|
||
![Front end structure](./4_1_FrontEndStructure.jpg) | ||
|
||
Let's expand `public` section because that is where we will find our static files. | ||
|
||
Type the following prompt in GitHub Copilot Chat: | ||
|
||
> TIP: we are going to use gpt-4o as our OpenAI GPT model for this GitHub Universe Workshop | ||
```text | ||
Now, how can I add HTML and CSS on these to make it more OctoFit tracker like? | ||
Launch the port in 8080 | ||
Make sure to add a simple navigation | ||
Ignore bootstrap for now | ||
``` | ||
|
||
If I type that command in the GitHub **Copilot Chat**, it may look like this: | ||
|
||
![Prompt example](./4_2_PromptFrontEnd.jpg) | ||
|
||
And the generated response might look like this: | ||
|
||
![Generated response exampe](./4_3_GeneratedResponsePrompt.jpg) | ||
|
||
> :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: | ||
And if you type the following command in the GitHub **Copilot Chat**, it will create a new port in `8080`. | ||
|
||
![Opening up port](./4_4_OpeningUpFrontend.jpg) | ||
|
||
And the final result should look like this: | ||
|
||
![Frontend result](./4_5_WebsiteFrontend.jpg) | ||
|
||
That is it! Please refer to the **Solution** below or the [troubleshoot guide](../9_Troubleshooting/README.md) if you encounter any issues. | ||
|
||
## Solution | ||
|
||
This shows one possible solution where you need to make a change: | ||
|
||
### Modify the following files: | ||
|
||
`src/App.js` | ||
|
||
```javascript | ||
import React from 'react'; | ||
import './App.css'; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<nav className="navbar"> | ||
<ul> | ||
<li><a href="/">Home</a></li> | ||
<li><a href="/profile">Profile</a></li> | ||
<li><a href="/activities">Activities</a></li> | ||
<li><a href="/teams">Teams</a></li> | ||
<li><a href="/leaderboard">Leaderboard</a></li> | ||
<li><a href="/workouts">Workouts</a></li> | ||
</ul> | ||
</nav> | ||
<header className="App-header"> | ||
<h1>Welcome to OctoFit Tracker</h1> | ||
</header> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; | ||
``` | ||
|
||
Create or modify `src/App.css` | ||
|
||
```css | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.navbar { | ||
background-color: #333; | ||
overflow: hidden; | ||
} | ||
|
||
.navbar ul { | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.navbar li { | ||
float: left; | ||
} | ||
|
||
.navbar li a { | ||
display: block; | ||
color: white; | ||
text-align: center; | ||
padding: 14px 16px; | ||
text-decoration: none; | ||
} | ||
|
||
.navbar li a:hover { | ||
background-color: #111; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
``` | ||
|
||
|
||
`package.json` | ||
Update the following section: | ||
|
||
```json | ||
"scripts": { | ||
"start": "PORT=8080 react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
``` | ||
|
||
### Run the following commands: | ||
|
||
```bash | ||
cd octofit-tracker/frontend | ||
``` | ||
|
||
Then, followed by... | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
Check the browser at the port `8080` to see the changes. | ||
|
||
[: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) |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains 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
File renamed without changes
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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,19 @@ | ||
# What's next? | ||
|
||
You made it this far! Congraulation! | ||
|
||
![Congratulation](https://octodex.github.com/images/hula_loop_octodex03.gif) | ||
|
||
What's next? From here, you can continue to leverage **GitHub Copilot** to finish the rest of exercises. | ||
|
||
Also, be sure to checkout self-paced documentation to build the application from scratch: | ||
|
||
[**gh.io/octofit-tutorial**](https://gh.io/octofit-tutorial) | ||
|
||
Make sure to leave the feedback on the workshop and the documentation by following this link: | ||
|
||
[:speech_balloon: We want to hear from you! - **github.com/orgs/community/discussions/142536**](https://github.com/orgs/community/discussions/142536) | ||
|
||
Thank you again. Happy coding with **GitHub Copilot**! | ||
|
||
[:house_with_garden: Go back to the main page](../../README.md) |
This file contains 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,18 @@ | ||
# Troubleshooting guide and FAQ | ||
|
||
## Troubleshooting guide | ||
|
||
<details> | ||
<summary>I am getting a different answer. What do I do?</summary> | ||
Please check the section where you can copy-and-paste the code if you want to follow along. | ||
</details> | ||
|
||
## FAQs | ||
|
||
<details> | ||
<summary>How can I enable Copilot?</summary> | ||
For the workshop, it should be already enabled. If you need any help, please reach out to the GitHub Expert Service team. | ||
</details> | ||
|
||
|
||
|