Skip to content

Commit 56ba626

Browse files
authored
Merge pull request #7 from githubuniverseworkshops/arilivigni/self-service-prompting
Arilivigni/self service prompting
2 parents 14c2e19 + 17ddd98 commit 56ba626

File tree

17 files changed

+99
-136
lines changed

17 files changed

+99
-136
lines changed

.devcontainer/devcontainer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010
"extensions": [
1111
"github.copilot",
1212
"github.copilot-chat",
13-
"Phu1237.vs-browser"
13+
"Phu1237.vs-browser",
14+
"markdown-lint.markdownlinter",
15+
"ms-python.python", // Python extension
16+
"ms-python.vscode-pylance" // Pylance extension for Python
1417
]}
15-
}
18+
},
19+
"forwardPorts": [
20+
8000, // Django default port
21+
27017 // MongoDB default port
22+
]
1623
}

.gitignore

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
# Virtual Environment
44
venv/
55

6-
# octofit backend
7-
octofit/
8-
manage.py
9-
app/
10-
11-
# octofit frontend
12-
frontend
6+
# octofit tracker app frontend and backend
7+
backend/
8+
frontend/

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Without further ado, let's get started.
2626
## Table of Contents
2727

2828
1. [Story](docs/1_Story)
29-
2. [Prerequisites, expectations, and assumptions](docs/2_Prerequisites)
30-
3. [Getting started - front end setup with HTML and CSS](docs/3_GettingStarted)
31-
4. Prettifying the design with Bootstrap
32-
5. Adding functionality with ReactJS
33-
6. Adding a backend with NodeJS
29+
2. [Prerequisites and development environment setup](docs/2_Prerequisites)
30+
3. [Getting started - app frontend and backend creation](docs/3_GettingStarted)
31+
4. [MongoDB install and setup](docs/4_MongoDBInstallSetup/)
File renamed without changes.

docs/2_Prerequisites/README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Prerequisites, assumptions, and development environment setup
1+
# Prerequisites and development environment setup
22

33
## Prerequisites
44

@@ -13,26 +13,22 @@
1313

1414
## Developer environment setup
1515

16-
### Go to the code tab
17-
![code tab](../../images/code-tab.png)
16+
### Option 1: Using a Copilot + Codespaces
1817

19-
### Create a GitHub codespace
20-
![create a GitHub codespace](../../images/codespace-create.png)
18+
You are not required to use GitHub Codespaces
19+
but, this is what we are using for the GitHub Universe workshop
2120

22-
## Assumptions
21+
#### Go to the code tab
2322

24-
Two approaches:
25-
Ask Copilot to generate a lot of boiler plate codes first time:
26-
PROS: Create a lot of structures that we probably need later
27-
CONS: Probably need to make a bunch of changes to make it work. Hard to make it into a tutorial.
28-
Good for: When you actually work for the real project
29-
Bad for: Make it a tutorial like format
30-
Ask Copilot to make incremental, graduate changes
31-
PROS: More predictable and easy to make it procedural steps
32-
CONS: Can take more time and strategy later
33-
Good for: Tutorial
34-
Bad for: Real project
23+
![code tab](./2_1_code-tab.png)
3524

36-
We will choose the second approach because we want to make it a more procedural step-by-step approach.
25+
#### Create a GitHub codespace
3726

38-
[:back: Previous: Story](../1_Story) | [Next: Getting started - Front end setup with HTML and CSS :soon:](../3_GettingStarted)
27+
![create a GitHub codespace](./2_1_codespace-create.png)
28+
29+
### Option 2: Use your IDE of choice
30+
31+
- If you choose this option we recommend using VSCode as your IDE, but this workshop is not limited to VSCode
32+
- URL for REACT and Django will be `http://localhost` or `http://127.0.0.1`
33+
34+
[Back :: Previous: Story](../1_Story) | [Next :: Getting started](../3_GettingStarted/)
213 KB
Loading
79.2 KB
Loading
154 KB
Loading

docs/3_GettingStarted/README.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
1-
# Getting started - Front end setup with HTML and CSS
1+
# Getting started
22

33
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.
44

5-
## Goals/Outcome
5+
> TIP: One challenging thing about GitHub Copilot is that it is very generative. Thus, it is hard to make a consistent, repeatable tutorial unless you try to keep it simple and very progressive.
66
7-
- Understand the basic strategies around designing the OctoFit 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
7+
## Explain to GitHub Copilot the goals and steps
108

11-
![OctoFit App with front end](../../images/0_FinalResult.jpg)
9+
It is important to lay out a plan and provide details
1210

13-
Let’s start with the basic front end development with the help of GitHub Copilot. Although we can start using the built-in in-file Copilot suggestion, we will initiate this by using GitHub Copilot Chat.
11+
```text
12+
I want to build an OctoFit Tracker app that will include the following:
1413
15-
After you open the GitHub Copilot Chat panel, please type the following prompt.
14+
* User authentication and profiles
15+
* Activity logging and tracking
16+
* Team creation and management
17+
* Competitive leader boards
18+
* Personalized workout suggestions in one app
1619
17-
`I have this great idea called the OctoFit app. Can you show me the outline for how to get started? Please ignore technology stacks for now.`
20+
I want to use React.js for the frontend. I want to use Python with Django REST Framework for the backend and Mongo DB as the database to store data.
1821
19-
![Ask Copilot for Outline](../../images/1_AskCopilot4Outline.jpg)
22+
Create the frontend and backend in the octofit-tracker directory of this repository
2023
21-
The reason why I asked to ignore technology stack is because I want to keep it super simple. If we did not add that, what you will likely see is that some users will get code examples, while some others don’t, etc.
24+
the octofit-tracker/backend directory will store the django app with no subdirectories
2225
23-
> TIP: One challenging thing about GitHub Copilot is that it is very generative. Thus, it is hard to make a consistent, repeatable tutorial unless you try to keep it simple and very progressive.
24-
Once you get the result, try to read to see how you can approach creating our fitness application. Your result still might look different from mine, and that is perfectly okay!
26+
the octofit-tracker/frontend directory will store the react app with no subdirectories
27+
28+
Use a Python virtual environment and install all python dependencies from file octofit-tracker/requirements.txt in this workspace
2529
26-
Once you get the result, try to read to see how you can approach creating our fitness application. Your result still might look different from mine, and that is perfectly okay!
30+
The octofit-tracker/requirements.txt already contains all Django requirements. Django, djongo, sqlparse
2731
28-
Now, let’s move onto the next prompt through GitHub Copilot Chat. This time, we want to generate some assets to create our web pages. HTML, which stands for Hyper Text Markup Language, is the language of the web, though it is not exactly a programming language, and CSS, which stands for Cascading Style Sheet, is the web language for the design. Thus, we will ask to generate these two. Let’s proceed with the following prompts.
32+
Layout the directory structure with no redundant backend and frontend subdirectories
2933
30-
`Now, how can I add HTML and CSS on these?`
34+
Use bootstrap for the frontend
3135
32-
![Ask Copilot for HTML and CSS - Page 1](../../images/2_1_AskGenerateHTMLCSS.jpg)
36+
Let's think about this step by step
3337
34-
![Ask Copilot for HTML and CSS - Page 2](../../images/2_2_AskGenerateHTMLCSS.jpg)
38+
Important to avoid using public code and we do NOT need to initialize the git repository
39+
```
3540

36-
As you can see, this prompt will generate some examples of HTML and CSS lines that you can use. Again, your result might look different from mine, and that is perfectly okay!
41+
![project plan](./3_1_AskCopilotProjectCreation.png)
3742

43+
![directory structure](./3_2_CopilotDirectoryStructure.png)
3844

45+
![octofit-tracker app setup](./3_3_OctFit-Tracker-Setup.png)
3946

47+
[Back :: Previous: Prerequisites and development environment setup](../2_Prerequisites) | [Next :: MongoDB install and setup - ](../4_MongoDBInstallSetup)

0 commit comments

Comments
 (0)