Codespaces template for creating and deploying your own React portfolio
Codespaces template for creating and deploying your own React portfolio
View these instructions in Spanish or Portuguese
Create, customize and deploy your own portfolio website in minutes. ✨
In this template repository we have the development environment and base set and ready to go. So that you can immediately launch your Codespace environment and start customizing your site using Copilot to help you write code faster.
In this "choose your own adventure" template portfolio, we have a React based web application ready for you to easily customize and deploy using only your web browser.
Click the Use this Template button and then Create a new repository as can be seen in the image below. Note: Make sure you've signed in to GitHub otherwise, you wouldn't see the Use this Template button.
Select the repository owner (e.g. your GitHub account)
Enter a unique name for your new repository
Click the Code button
Click Create Codespace on main button
Customize your portfolio site with Copilot
To learn more about Codespaces, watch our video tutorial series
This repo is a GitHub template to build a JavaScript personal portfolio frontend web application using the React framework. The goal is to give you a template that you can immediately utilize to create your own website through Codespaces.
The repo contains the following:
/.devcontainer.devcontainer/Dockerfile: Configuration file used by Codespaces to determine operating system and other details..devcontainer/devcontainer.json: Configuration file used by Codespaces to configure Visual Studio Code settings, such as the enabling of additional extensions./src: HTML, JS and CSS files used to build your portfolio site..eslintrc: Settings for ESLint that is included for code consistency and quality..prettierrc: Settings for Prettier that is used to format code.package.json and package-lock.json: Defines the project information for Node.js, dependent packages and the versions needed of each.This portfolio site project is filled with sample data so that you can immediately open Codespaces, see it running, and deploy at any point.
Your development environment is all set for you to start. Based on our JavaScript Codespace Template (React), here is what is already setup and ready for you to use:
Create a repository from this template. Use this create repo link. Select the repository owner, provide a name, a description if you'd like and if you'd like the new repository to be public or private.
Before creating the Codespace, enable GitHub Copilot for your account. If it is not enabled, take a look at Customize your portfolio site using Copilot.
Navigate to the main page of the newly created repository.
Under the repository name, use the Code drop-down menu, and in the Codespaces tab, select "Create codespace on main".
Wait as GitHub initializes the Codespace.
When complete you will see your Codespace load with a terminal section at the bottom. Codespaces will install all the required extensions in your container, followed by executing npm install. Once the package installs are completed, Codespaces will execute npm start to start your web application running within your Codespace.
When the web application has successfully started you will see a message in the terminal that the server is running on port 1234 within your Codespace:
This project is built to be easily customizable. Each section of the site is a separate component, and your information needs to be set in only one spot. This is not only for ease of updating, but so you can see how prop values are passed to React components.
For each step, open the project in Codespaces, then you can make and commit your changes while within your Codespace.
See Using source control in your codespace for more Codespaces source control how-tos
Within /src/App.jsx you will see a variable called siteProps. This is a JavaScript object that hold the key value pairs needed to customize your name, title, email, and social accounts.
const siteProps = {
name: "Alexandrie Grenier",
title: "Web Designer & Content Creator",
email: "[email protected]",
gitHub: "microsoft",
instagram: "microsoft",
linkedIn: "satyanadella",
medium: "",
twitter: "microsoft",
youTube: "microsoft",
};Update to the name and title you'd like displayed at the top of your site.
Optional values are email address and social accounts. These are used in the Footer component. If any item is not included in the list or set to an empty string ("") it will not display the icon and link.
This portfolio site includes 3 images: top section background, "About me" background and portfolio section (desk). These can be any landscape sized images of your choosing from your own collection, or found that have a license allowing you to use without attribution.
A couple possible sites to find photos are Pixabay and Unsplash. Photos, illustrations, vectors, your choice! When you find your images, save each one to /src/images with a short, meaningful file name.
Go to the following below components to update the import image... line to reference the new image you downloaded for that section, as well as the imageAltText for the image:
/src/Components/Home.jsx - section at top of the page, main image you will see when site loads (woman standing by server wall in sample) import image from "../images/server-wall.jpg";
const imageAltText = "woman holding laptop standing by server room with glass wall";/src/Components/About.jsx - background behind the detailed "About me" section (abstract mosaic in sample) import image from "../images/mosaic.svg";
const imageAltText = "purple and blue abstract background";/src/Components/Portfolio.jsx- image highlighted in left hand side of section (design desk photo in sample) import image from "../images/design-desk.jpeg";
const imageAltText = "desktop with books and laptop";The About section helps to give people a bit more information about your skills and passions. Within /src/Components/About.jsx you will find 2 values to update:
description: short sentence or two describing yourself, career goals, and/or passionsdetailOrQuote: longer block for you to add more detail about yourself, or even a quote you likeThe second section to update is the Portfolio section, where you highlight items you've worked on. These would be articles, videos, logo designs, GitHub projects, anything that highlights you!
Go to /src/Components/Portfolio.jsx to the projectList variable. This is a JavaScript array of objects. Each item you want to highlight needs: title, description, and URL.
The sample design has 4, but the number you include is up to you.
…Project includes the setup needed for you to deploy FREE to either Azure Static Web Apps or GitHub Pages. Instructions are included below for both:
Azure Static Web Apps is Microsoft's hosting solution for static sites (or sites that are rendered in the user's browser, not on a server) through Azure. This service provides additional opportunities to expand your site through Azure Functions, authentication, staging versions and more.
You'll need both Azure and GitHub accounts to deploy your web application. If you don't yet have an Azure account you can create it from within during the deploy process, or from below links:
With your project open in Codespaces:
Click Azure icon in the left sidebar. Log in if you are not already, and if new to Azure, follow the prompts to create your account.
From Azure menu click “+” sign and then “Create Static Web App”.
If you are not logged into GitHub you will be prompted to log in. If you have any pending file changes you will then be prompted to commit those changes.
Set your application information when prompted:
/distWhen complete you will see a notification at the bottom of your screen, and a new GitHub Action workflow will be added to your project. If you click “Open Action in GitHub” you will see the action that was created for you, and it is currently running.
To view the status of your deployment, find your Static Web App resource in the Azure tab in the VS Code left side bar.
Once deployment is complete, you can view your brand new new publicly accessible application by right clicking on your Static Web App resource and selecting "Browse Site".
Issues? When creating your Static Web app, if you are prompted to select an Azure subscription and are not able to select a subscription, check the "Accounts" tab in VS Code. Make sure to choose the "Grant access to ..." options if those options appear. Should you receive the error-message "RepositoryToken is invalid. ..." switch to Visual Studio Code for the Web (vscode.dev) and repeat the steps there.
GitHub Pages allows you to host websites directly from your GitHub repository. This project is already set up for you to get your portfolio deployed to GitHub pages with minimal steps.
With your project open in Codespaces:
No open issues yet, or sync has not completed.