Skip to content

CMS for a hypothetical trampoline park named Sky High Trampolines. This was a collaborative project between four developers over a four-week span from September 12th - October 7th, 2022.

Notifications You must be signed in to change notification settings

perennialAutodidact/skyhigh-trampolines

 
 

Repository files navigation

Sky High Trampolines CMS

Commits Contributors Checks

Live: Sky High Tramplines

This project is a CMS and appointment booking system for a fake trampoline park named Sky High Trampolines. It was the result of four, week-long Agile sprints enacted by four international devlopers.

This repository is a fork of the original with some added features and updated styling.

Tech Stack

Frontend

JavaScript React Redux React Router React Hook Form

Bootstrap SASS

Backend

Firebase

Features

The app has a customer-facing UI for booking reservations in two different rooms and an admin UI for viewing existing bookings, visualizing ticket availablity for each room and viewing/creating additional rooms, products and add-ons.

Customer UI

Booking Wizard
booking step 1 booking step 1 booking step 1
booking step 1 booking step 1 booking step 1

Admin UI

Bookings List Daily Availability
bookings list bookings list

Running Locally

This project uses Node 16.17.0 via nvm and yarn as the package manager.

$ nvm use 16.17.0 && npm i g yarn

Install the Firebase CLI

$ npm i g firebase-tools

Configuration

The local environment will require an active Firebase project setup for configuration and authentication. This app utilizes the Stripe, SendGrid and Google Places APIs and will therefore require accounts and keys for those services. If you intend on receiving emailed receipts from the app, a SendGrid email template will have to be created that accepts values to dynamically create the email. The template's id will be included in the cloud functions' .env.local file.

Client

Create a .env.local file in the project's root directory with a value for each variable.

# .env.local

REACT_APP_FIREBASE_AUTH_DOMAIN=<YOUR_PROJECT>.firebaseapp.com
REACT_APP_FIREBASE_API_KEY=<YOUR_API_KEY>
REACT_APP_FIREBASE_PROJECT_ID=<YOUR_PROJECT_ID>
REACT_APP_FIREBASE_STORAGE_BUCKET=<YOUR_PROJECT>.appspot.com

REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_test_<YOUR_STRIPE_PUBLISHABLE_KEY>
REACT_APP_GOOGLE_PLACES_API_KEY=<YOUR_GOOGLE_PLACES_API_KEY>

Cloud Functions

This app uses the Google Secrets Manager in production to handle secret values, but the cloud functions are configured to use .env.local in developement. Create .env.local in the functions folder and add values for the following variables:

# functions/.env.local

SENDGRID_API_KEY=<YOUR_SENDGRID_API_KEY>
SENDGRID_TEMPLATE_ID=<YOUR_SENDGRID_TEMPLATE_ID>

STRIPE_SECRET_KEY=sk_test_<YOUR_STRIPE_SECRET_KEY>
STRIPE_HANDLE_EVENT_SECRET=whsec_<YOUR_STRIPE_CLI_WEBHOOK_SECRET>

NODE_ENV=DEVELOPMENT

Start the Firebase Emulator

$ firebase emulators:start --import ./emulator/data

Open a localtunnel Instance

In order to communicate with Stripe webhooks locally, a localtunnel url will be used. See this blog post for more details. The port number is the number used by the Firebase emulator to serve the Firebase functions.

$ npx localtunnel --port 5001

Copy the generated URL.

Listen for Stripe Events Locally

Install the Stripe CLI and login. Use the localtunnel URL to forward Stripe events to the local machine.

$ stripe listen --forward-to https://<YOUR_LOCAL_TUNNEL_URL>.loca.lt/<YOUR_PROJECT_NAME>/us-central1/handleStripeEvent

Start the App Server

$ yarn start

About

CMS for a hypothetical trampoline park named Sky High Trampolines. This was a collaborative project between four developers over a four-week span from September 12th - October 7th, 2022.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.0%
  • SCSS 3.3%
  • HTML 0.7%