Skip to content

LAB1_Setup and deploy your first app

David Jones-Gilardi edited this page Feb 23, 2021 · 15 revisions

βš’οΈ Setup and deploy your first app

Exercise time: ~15 minutes

Once you get your tools and environment setup you'll be good to go, not just for this workshop, but for your own JAMStack applications moving forward. Just repeat the process for your own application repositories.

We're going to start with just the basics and then build up our capabilities from there.

We will cover:

  1. Create your BattleStax repository
  2. Setup Netlify account
  3. Summary

Template CTRL click


1. Create your BattleStax repository

The very first thing we want to do is create a copy of the BattleStax repository into YOUR GitHub account. This is important because as part of this workshop you will deploy the BattleStax application to production and will need your own repository to do so. To do this we will make a copy the DataStax-Examples/battlestax repo using a template.

βœ… Step 1a. Launch the BattleStax repo into another tab

This might seem like an odd step, but will allow you to keep your place in the instructions you are reading now until you move to the new repo. Scroll up on the GitHub repo page, Right-Click on the battlestax repo name, and choose Open Link in New Tab to launch it in a new tab:

Template CTRL click

βœ… Step 1b. Use template to copy repository into YOUR GitHub account

βœ” From the new tab you just launched, click on the Use this template button up on the top right of the page.

Template CTRL click

βœ” On the Create a new repository from battlestax dialog, choose the repository you wish to fork the repo to. This should be to one of YOUR personal GitHub orgs.

  • Ensure to choose the Public option and include all branches then click the Create repository from template button

Template create repo

It should only take a moment for GitHub to generate a new repository in your account.

βœ… Step 1c. Navigate back to your place in the docs

βœ” Once complete you should now have your own battlestax repo within YOUR account. Notice both the GitHub org is no longer DataStax-Examples and the text generated from DataStax-Examples/battlestax.

Template create repo

The org "SonicDMG" you see there is just the example I used from my personal account. You will see a different organization in your case.

2. Setup Netlify account

βœ… Step 2a. Setup a Netlify account

βœ” Using the link HERE, sign up for a new account and follow Netlify's instructions to create a New Site from Git (you must be logged in to see this option).

Netlify Setup Example

βœ” Once signed in, you should land on the following page.

Netlify Setup Example

βœ… Step 2b. Create a new site

βœ” Move to the Sites tab and Click the New site from git button.

Netlify Setup Example

βœ” On the new page select Github and locate the proper repository in your github Account.

Netlify Setup Example

βœ” After allowing the Netlify application on Github select the BattleStax repository.

Netlify Setup Example

βœ” Use all of the defaults for Basic Build Settings and click Deploy Site.

Netlify Setup Example

βœ… Step 2c. Deploy your site

βœ” Once deployed copy the domain name of your new site from Netlify.

Netlify URL Example

βœ” We'll let that bake for a moment and move on to the next section. It will take Netlify a couple minutes to spin everything up. We'll come back to this interface in an upcoming section.

Netlify Setup Example

3. Summary

At this point, by creating a new site from GitHub in Netlify anytime you commit to master your site will automatically be deployed with a CI/CD pipeline. No servers needed. This is seriously powerful stuff and really gets at the core of what we're all good at, coding.

As we move on we'll dive deeper into what this all means and how it's hooked up. Click on the button below to create your database.

🏠 Home

🏁 I - What is the JamStack?

Introduction to the JAMStack Why this is cool ? Introduction to Netlify Want to learn more ? πŸ› οΈ II - Setup and deploy your first app

Create your BattleStax repository Setup Netlify account Summary πŸ› οΈ III - Create your Astra instance

Register and Sign In to Astra Configure and create your database Activate Cassandra awesome πŸ“š IV - What can Netlify do for you

Build, Package, deploy, host Advanced features Netlify Functions Want to learn more πŸ› οΈ V - Expose your "hello world" API

Setup your environment Make a serverless endpoint using Netlify functions Merge back to master Check your deployment in Netlify Summary πŸ“š VI - What are DataStax Astra and Stargate

Introduction to Astra Introduction to Stargate Want to know More πŸ› οΈ VII - Set environment variables in your application

Creating the .env file Explore the API with HTTPie πŸ› οΈ VIII - Set secrets in GitHub for CI/CD

Configure secrets in GitHub Verify your secrets How is this all working ? πŸ› οΈ IX - Set environment variables in Netlify

Set environment variables in Netlify Verify your environment variables Summary πŸ› οΈ X - Implement a CRUD Api in Astra

Creating the insertGame Netlify endpoint Connect to Astra Hook it all together Running TDD tests πŸ› οΈ XI - Verify and Deploy in Netlify

Merge back to master Verify your deployment in Netlify Feel the enormity of your accomplishment Super secret full game option πŸ“š XII - Resources

Clone this wiki locally