Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised approach to dashboard #34

Merged
merged 25 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0e08921
feat: url updates when results change
Lombardoc4 Jan 9, 2024
7064c7c
chore: building out constructor standings for season results
Lombardoc4 Jan 10, 2024
56abbfa
refactor: utilize axios for fetch calls and include status checks to …
Lombardoc4 Jan 10, 2024
aec4338
chore: consume standings data from server
Lombardoc4 Jan 22, 2024
45926f1
refactor: add constants file and revert from axios to fetch
Lombardoc4 Jan 23, 2024
0aac508
chore: test api standings of single race
Lombardoc4 Jan 23, 2024
7738b1d
feat: added cypress tests and ci (#14)
Lombardoc4 Jan 25, 2024
def0952
chore: migrated husky to v9
borolepratik Jan 28, 2024
0232eaa
chore: updated dependencies
borolepratik Jan 28, 2024
68bd1f4
race results prototype (#17)
Lombardoc4 Feb 2, 2024
01e4241
fix: minor update of race timeline and season tabs
Lombardoc4 Feb 3, 2024
c2f13b5
fix: commitlint subject update to support jira ticket names
Lombardoc4 Feb 3, 2024
e2e8013
FRON-10 Document site url endpoints (#18)
Lombardoc4 Feb 4, 2024
cbc2e70
chore: FRON-8 restructure the way atoms are populated on page load an…
Lombardoc4 Feb 6, 2024
9059a31
FRON-9 spinners for main filter dropdown (#20)
Lombardoc4 Feb 7, 2024
de75d4a
fix: FRON-10 resolving issue with race and session endpoints (#21) (#24)
Lombardoc4 Feb 11, 2024
5261264
docs: FRON-4 jira smart commits (#25)
Lombardoc4 Feb 11, 2024
c6b2629
feat: FRON-11 showcase next upcoming event (#26)
Lombardoc4 Feb 12, 2024
bab0b5f
fix: FRON-20 packages and dependencies reinstalled (#27)
Lombardoc4 Feb 15, 2024
a11a4e5
fix: folder structure
Lombardoc4 Feb 20, 2024
64920b2
chore: FRON-6 include server 422 error info on page (#29)
Lombardoc4 Feb 27, 2024
b0b3a5a
refactor: simplify landing page, missing imagery so improvised (#30)
Lombardoc4 Mar 12, 2024
275226e
style: migrate from daisyui to shadcn (#31)
Lombardoc4 Mar 16, 2024
eac7597
refactor: FRON-40 reformat project structure and organization (#32)
Lombardoc4 Mar 16, 2024
d484e4f
feat: FRON-33 shared secret, bearer token (#33)
Lombardoc4 Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading