-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from ruchernchong/v2
v2
- Loading branch information
Showing
89 changed files
with
6,305 additions
and
4,815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
NEXT_PUBLIC_SITE_URL= | ||
NEXT_PUBLIC_API_URL= | ||
NEXT_PUBLIC_GA_MEASUREMENT_ID= | ||
NEXT_PUBLIC_FEATURE_FLAG_RELEASED= | ||
NEXT_PUBLIC_REVALIDATE_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: latest | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Build | ||
run: pnpm build | ||
env: | ||
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Deployment (Dev) | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'main' | ||
|
||
concurrency: | ||
group: merge-${{ github.ref }} | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: latest | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Run tests | ||
run: pnpm test | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
Build: | ||
needs: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: latest | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ${{ github.workspace }}/.next/cache | ||
key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Build | ||
run: pnpm build | ||
env: | ||
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} | ||
Deploy: | ||
needs: Build | ||
runs-on: ubuntu-latest | ||
env: | ||
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} | ||
NEXT_PUBLIC_FEATURE_FLAG_UNRELEASED: ${{ vars.NEXT_PUBLIC_FEATURE_FLAG_UNRELEASED }} | ||
NEXT_PUBLIC_GA_MEASUREMENT_ID: ${{ vars.NEXT_PUBLIC_GA_MEASUREMENT_ID }} | ||
NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }} | ||
NEXT_PUBLIC_REVALIDATE_TOKEN: ${{ secrets.NEXT_PUBLIC_REVALIDATE_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: latest | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ${{ github.workspace }}/.next/cache | ||
key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | ||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ vars.ROLE_TO_ASSUME }} | ||
aws-region: ap-southeast-1 | ||
- name: Deploy app | ||
run: | | ||
pnpm install && pnpm sst deploy --stage dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Deployment (Staging) | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags-ignore: | ||
- "*" | ||
|
||
concurrency: | ||
group: merge-${{ github.ref }} | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
Deploy: | ||
runs-on: ubuntu-latest | ||
environment: Staging | ||
env: | ||
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} | ||
NEXT_PUBLIC_FEATURE_FLAG_UNRELEASED: ${{ vars.NEXT_PUBLIC_FEATURE_FLAG_UNRELEASED }} | ||
NEXT_PUBLIC_GA_MEASUREMENT_ID: ${{ vars.NEXT_PUBLIC_GA_MEASUREMENT_ID }} | ||
NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }} | ||
NEXT_PUBLIC_REVALIDATE_TOKEN: ${{ secrets.NEXT_PUBLIC_REVALIDATE_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: latest | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ${{ github.workspace }}/.next/cache | ||
key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | ||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ vars.ROLE_TO_ASSUME }} | ||
aws-region: ap-southeast-1 | ||
- name: Deploy app | ||
run: | | ||
pnpm install && pnpm sst deploy --stage staging |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Test | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: latest | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Run tests | ||
run: pnpm test | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { KeyStatistics } from "@/app/components/KeyStatistics"; | ||
import { TotalNewCarRegistrationsByYear } from "@/app/components/TotalNewCarRegistrationsByYear"; | ||
import { Top5CarMakesByYear } from "@/app/components/Top5CarMakesByYear"; | ||
import Typography from "@/components/Typography"; | ||
import { UnreleasedFeature } from "@/components/UnreleasedFeature"; | ||
|
||
const HomePage = () => { | ||
return ( | ||
<section className="flex flex-col gap-y-8"> | ||
<Typography.H1>Dashboard</Typography.H1> | ||
<UnreleasedFeature> | ||
<div className="flex flex-col gap-y-4"> | ||
<TotalNewCarRegistrationsByYear data={data} /> | ||
<KeyStatistics data={data} /> | ||
<Top5CarMakesByYear topMakes2023={topMakes2023} /> | ||
</div> | ||
</UnreleasedFeature> | ||
</section> | ||
); | ||
}; | ||
|
||
// TODO: Dummy data for visualisation ONLY | ||
const data = [ | ||
{ year: 2013, total: 22472 }, | ||
{ year: 2014, total: 28932 }, | ||
{ year: 2015, total: 57589 }, | ||
{ year: 2016, total: 87504 }, | ||
{ year: 2017, total: 91922 }, | ||
{ year: 2018, total: 80281 }, | ||
{ year: 2019, total: 72344 }, | ||
{ year: 2020, total: 44465 }, | ||
{ year: 2021, total: 45442 }, | ||
{ year: 2022, total: 30939 }, | ||
{ year: 2023, total: 30225 }, | ||
]; | ||
|
||
// TODO: Dummy data for visualisation ONLY | ||
const topMakes2023 = [ | ||
{ make: "BYD", value: 1416 }, | ||
{ make: "Toyota", value: 7248 }, | ||
{ make: "BMW", value: 3436 }, | ||
{ make: "Mercedes Benz", value: 4317 }, | ||
{ make: "Honda", value: 2631 }, | ||
]; | ||
|
||
export default HomePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const AboutPage = () => { | ||
return ( | ||
<div> | ||
<h1>About Page</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AboutPage; |
Oops, something went wrong.