Skip to content

Commit

Permalink
Revised approach to dashboard (#34)
Browse files Browse the repository at this point in the history
* feat: url updates when results change

* chore: building out constructor standings for season results

* refactor: utilize axios for fetch calls and include status checks to see if server is active

* chore: consume standings data from server

Initialize the use of standings data from the server
Refactor the drivers and constructors standings ui
Include results type declarations at results.d.ts
Update faker data to match standings schema

* refactor: add constants file and revert from axios to fetch

* chore: test api standings of single race

* feat: added cypress tests and ci (#14)

* test: cypress setup and dropdown test

* test: cypress testing branch

* fix: update cypress version

remove error:
```
TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later.
```

* fix: rebuild pnpm.lock

* chore: updated dependencies

* ci: updated ci to include cypress tests

* ci: fix for prettier step in lint job

---------

Co-authored-by: Pratik Borole <[email protected]>

* chore: migrated husky to v9

* chore: updated dependencies

* race results prototype (#17)

* refactor: main filter separation of concern

* chore: introduce race results data per driver

* refactor: proper linting

* refactor: migrate lib out of app router

* chore: successfully test results endpoint

* refactor: timeline and remove results endpoint

instead of using the /results endpoint we will use the root, /, as the base

* refactor: main filter

main filters needs info from url params

* fix: minor update of race timeline and season tabs

* fix: commitlint subject update to support jira ticket names

* FRON-10 Document site url endpoints (#18)

* chore: FRON-10 main filter url navigation

* chore: FRON-10 adding placeholder pages

* chore: FRON-8 restructure the way atoms are populated on page load and reset (#19)

* FRON-9 spinners for main filter dropdown (#20)

chore: FRON-9 main filter dropdowns have a loader

* fix: FRON-10 resolving issue with race and session endpoints (#21) (#24)

* docs: FRON-4 jira smart commits (#25)

* feat: FRON-11 showcase next upcoming event (#26)

* fix: FRON-20 packages and dependencies reinstalled (#27)

* fix: folder structure

* chore: FRON-6 include server 422 error info on page (#29)

* refactor: simplify landing page, missing imagery so improvised (#30)

* style: migrate from daisyui to shadcn (#31)

* refactor: FRON-40 reformat project structure and organization (#32)

* feat: FRON-33 shared secret, bearer token (#33)

* feat: FRON-33 shared secret used in fetch calls

---------

Co-authored-by: Pratik Borole <[email protected]>
  • Loading branch information
Lombardoc4 and borolepratik authored Mar 19, 2024
1 parent 91dfc91 commit a347bea
Show file tree
Hide file tree
Showing 78 changed files with 3,384 additions and 1,988 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -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"
# NEXT_PUBLIC_SHOW_LOGGER="false"
NEXT_PUBLIC_BEARER_TOKEN="my-secret-token"
16 changes: 15 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ module.exports = {
es2021: true,
node: true,
},
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'],
plugins: [
'@typescript-eslint',
'simple-import-sort',
'unused-imports',
'cypress',
],
extends: [
'eslint:recommended',
'next',
Expand Down Expand Up @@ -77,6 +82,15 @@ module.exports = {
},
],
//#endregion //*======== Import Sort ===========

// #region //*========= Cypress files =========
'@typescript-eslint/no-namespace': [
'error',
{
allowDeclarations: true,
},
],
// #endregion //*========= Cypress files =========
},
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code Check
name: Code Lint and Test

on:
push:
Expand All @@ -8,19 +8,19 @@ on:

jobs:
lint:
name: ⬣ ESLint, ʦ TypeScript, 💅 Prettier
name: ⬣ ESLint, ʦ TypeScript, 💅 Prettier, ✅ Cypress
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: ⎔ Setup node
uses: actions/setup-node@v4
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: 21

- uses: pnpm/action-setup@v2
name: Install pnpm
- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598
with:
version: 8
run_install: true
Expand All @@ -33,3 +33,12 @@ jobs:

- name: 💅 Prettier check
run: pnpm format:check

- name: ✅ Cypress tests
uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a
with:
browser: chrome
build: pnpm build
component: true
start: pnpm start
wait-on: 'http://localhost:3000'
5 changes: 1 addition & 4 deletions .husky/commit-msg
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
pnpm exec commitlint --edit $1
6 changes: 2 additions & 4 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
pnpm typecheck
pnpm exec lint-staged
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 21.5.0
nodejs 21.6.0
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,

"python.terminal.activateEnvironment": false,
// Tailwind CSS Autocomplete, add more if used in projects
"tailwindCSS.classAttributes": [
Expand Down
193 changes: 0 additions & 193 deletions .vscode/typescriptreact.code-snippets

This file was deleted.

40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ 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)
- [Deployment](#deployment)
- [URL Structure](#url-structure)
- [Resources](#resources)

## Setting up the project
Expand Down Expand Up @@ -43,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.
Expand Down Expand Up @@ -78,14 +85,43 @@ This project is using [conventional commits](https://www.conventionalcommits.org
- `Squash and merge` can be used when the commits _**DON'T**_ need to be individually brought in to the target branch.
- [More information](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github).

- **Jira issue linking**
- Commits and PRs **_must_** be linked to a Jira issue.
- To do so, include the Jira issue key in the PR title and/or the commit message after the conventional commit type.
- [More information on Jira smart commits](https://support.atlassian.com/jira-software-cloud/docs/process-issues-with-smart-commits/).

## Tests

// TODO [cypress](https://www.cypress.io/)

> [!WARNING]
> Cypress does not officially support Next v14. If you enncounter any errors or issues please report them [here](https://github.com/Slick-Telemetry/frontend/issues)
- **Background**

- Cypress uses chai based assertions

- **Running Cypress**

- `pnpm run cypress:open`

## Deployment

// TODO [vercel](https://vercel.com/)

## URL Structure

```
`/`
├── Results of past seasons
└──`[season]` -> year
└── `[event name]` -> event name of race in season
└── `[session]` -> session of race
└── `[driver]` -> driverId in race session
├── `/` -> ???
└── `/telemetry` -> ???
```

## Resources

Key tools in use: `daisy-ui`, `tailwindcss`, `react`, `nextjs`, `pnpm`
Key tools in use: `daisy-ui`, `tailwindcss`, `react`, `nextjs`, `pnpm`, `cypress`
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ module.exports = {
rules: {
// TODO Add Scope Enum Here
// 'scope-enum': [2, 'always', ['yourscope', 'yourscope']],
'subject-case': [
0,
'always',
['sentence-case', 'start-case', 'pascal-case'],
],
'type-enum': [
2,
'always',
Expand Down
Loading

0 comments on commit a347bea

Please sign in to comment.