In this lab, we will be using GitHub Copilot's chat feature and inline suggestions in Visual Studio Code to get answers to our questions.
Here's how you can use it:
- Create a folder which will store the project source code we create.
- Open Visual Studio Code and open the project folder.
- Click on the Copilot icon in the activity bar on the side.
- Click on the "Chat in new tab" button to start a new chat.
- Now you can start asking questions.
- Try and use Copilot chat to create a new Express API project as well as a Next.js Web App.
- Below are some questions you can ask to get started.
In addition to using the chat feature, you can also use the CTRL + I
command to get inline suggestions from GitHub Copilot while you're writing code. This can be especially useful when you're not sure how to write a certain piece of code. Simply start typing and then press CTRL + I
to see a suggestion from GitHub Copilot.
Start by creating a folder in your project folder to store the Express API code, then use Copilot chat to create the Express API.
Ask Copilot: "What are some high level areas I should learn for Node and Express?"
Ask Copilot: "How do I create a new Express API using TypeScript?"
Ask Copilot: "What's a good Express project structure?"
Ask Copilot: "How do I add a controller and routes in Express?"
Ask Copilot: "How can I add a git ignore file to my Express project?"
Next we will use Copilot chat to create a new Next.js Web App.
Ask Copilot: "What are some high level areas I should learn for Next.js?"
Ask Copilot: "How do I create a new Next.js App?"
Notice that their are some options asked when creating the Next.js App, if you're unsure of what to select ask Copilot! I chose No to using the App Router, instead opting for the Page Router.
Would you like to use TypeScript? No / [Yes]
Would you like to use ESLint? No / [Yes]
Would you like to use Tailwind CSS? No / [Yes]
Would you like to use `src/` directory? No / [Yes]
Would you like to use App Router? (recommended) [No] / Yes
Would you like to customize the default import alias (@/*)? [No] / Yes
Ask Copilot: "What's a good project structure for Next.js?"
Ask Copilot: "How do I add a new Page to a Next.js project and fetch data from an API to display?"
Previous - Home | Next - Extending the Node.js Express TypeScript API