From 4a97d5c3aec941c50ff5c619654f24077a103ee8 Mon Sep 17 00:00:00 2001 From: Cris Lom <36197748+Lombardoc4@users.noreply.github.com> Date: Tue, 19 Mar 2024 18:57:15 -0400 Subject: [PATCH] feat: FRON-33 shared secret, bearer token (#33) * feat: FRON-33 shared secret used in fetch calls --- .env.example | 3 ++- README.md | 8 +++++++- src/app/page.tsx | 2 +- src/components/Footer/index.tsx | 17 ++++++++++++++--- src/components/SelectionData/NextEvent.tsx | 4 ++++ src/components/TopNav/UserNav.tsx | 2 +- src/lib/helpers.tsx | 16 ++++++++++------ 7 files changed, 39 insertions(+), 13 deletions(-) diff --git a/.env.example b/.env.example index 16df694..567c429 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ # DEVELOPMENT TOOLS # Ideally, don't add them to production deployment envs # Change to true if we want to log data -NEXT_PUBLIC_SHOW_LOGGER="false" \ No newline at end of file +# NEXT_PUBLIC_SHOW_LOGGER="false" +NEXT_PUBLIC_BEARER_TOKEN="my-secret-token" \ No newline at end of file diff --git a/README.md b/README.md index 3dfa599..15a6ee3 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Table of Contents: - [Getting Started](#getting-started) - [Install dependencies](#install-dependencies) - [Run the development server](#run-the-development-server) + - [Connecting to the server](#connecting-to-the-server) - [Commit Message Convention](#commit-message-convention) - [Contribution Guidelines](#contribution-guidelines) - [Tests](#tests) @@ -44,9 +45,14 @@ You can start the server using this command: pnpm dev ``` -csd Open [http://localhost:3000](http://localhost:3000) with your browser. +### Connecting to the server + +Currently the standard is to run the backend locally. Follow instructions [here](https://github.com/Slick-Telemetry/backend/blob/dev/README.md) for setup. + +To make calls to API you need to duplicate the `.env.example` file to define a client-side bearer token + ### Commit Message Convention This project is using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), it is mandatory to use it to commit changes. diff --git a/src/app/page.tsx b/src/app/page.tsx index c522141..bc2940d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; import { BsPlusCircle } from 'react-icons/bs'; -import { NextEvent } from '../components/SelectionData/NextEvent'; +import { NextEvent } from '@/components/SelectionData'; export default function Home() { return ( diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 0effd8f..e92bcd0 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -1,5 +1,16 @@ -const Footer = () => { - return
Footer
++ Server Status: {serverStatus.status || 'Offline'} +
+