Giter Club home page Giter Club logo

42tokyo-stats-website's Introduction

42tokyo-stats-website's People

Contributors

dependabot[bot] avatar nafuka11 avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

42tokyo-stats-website's Issues

Getting Startedを書く

目的

自分がAGUを取ったりBHに飲み込まれた場合、他の学生がこのリポジトリを使ってみたくなるはず。
そんな時、今のREADMEだと、どうすれば動くかが分からない。
→ とりあえず動かすための手順を書く。

ローディング表示

内容

  • Loginボタンのクリック時
  • 統計画面のデータ取得時

にCircularProgressを表示する

目的

上記の時に画面に変化が無く、再度クリックしたり更新ボタンを押してしまうそうになるので、ローディング中表示が欲しい。

First Contentful Paintが遅い(4s)

考えられる原因

  • getServerSidePropsをindexに使ってて、そこでsessionをawaitしてる
  • getServerSidePropsでファイルread & 都度集計処理を行っている

改善案

  • getServerSidePropsではなくAPI Routesを使う
  • yarn build:contentsで集計処理まで行い、その結果をjsonファイルに書き込む

テストを書く

テストを書かないと変更のたびにリグレッションしてないか確認が必要だからテストを書こうね

優先順位と観点

  1. builder
    • データの形式
    • APIにアクセスする回数(無限ループされると困るので)
  2. services
    • builderのテストである程度網羅できると思う
    • pick-contentsはclient側でcallするので、これ中心にする
      • 入出力の確認
  3. pages/api
    • 200と401の出力確認
  4. components, pages
    • frontのテスト方法が分からないのでまず調査が必要

背景色がwhiteになっている

原因

CssBaseLine を追加してCSSがリセットされているため

対処

CSSではなく、MUIのthemeでbackgroundの色を設定する

サンプルのページを作成する

目的

  • 42の学生ではない方に統計画面の作りを紹介したい
    • これまでは、ダミーデータを作って都度表示したり、デベロッパツールで数値を書き換えたりしていた……が面倒
    • 都度画像を作ってシェアするよりも、ページとして提供したほうが、相手がイメージしやすい

intra認証

  • ログインボタンから42のintra認証を行う
  • 認証後、統計画面へ遷移する
    • 統計画面は、ログインしていないときはアクセスできないこと
  • ログアウトボタンからログアウトを行う

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(deps): update nextjs monorepo to ^14.2.4 (eslint-config-next, next)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/deploy-chromatic.yml
  • actions/checkout v4
  • chromaui/action v11
.github/workflows/deploy-website.yml
npm
package.json
  • @emotion/react ^11.11.4
  • @emotion/styled ^11.11.5
  • @mui/icons-material ^5.15.18
  • @mui/material ^5.15.18
  • @storybook/test ^8.1.4
  • date-fns ^3.6.0
  • date-fns-tz ^3.1.3
  • highcharts ^10.3.3
  • highcharts-react-official ^3.1.0
  • next ^14.2.3
  • next-auth ^4.24.7
  • next-head-seo ^0.1.3
  • react ^18.3.1
  • react-dom ^18.3.1
  • @babel/core ^7.24.5
  • @storybook/addon-actions ^8.1.4
  • @storybook/addon-essentials ^8.1.4
  • @storybook/addon-interactions ^8.1.4
  • @storybook/addon-links ^8.1.4
  • @storybook/nextjs ^8.1.4
  • @storybook/react ^8.1.4
  • @types/node 20.12.8
  • @types/react 18.3.3
  • @types/react-dom 18.3.0
  • babel-loader ^9.1.3
  • chromatic ^11.4.0
  • dotenv ^16.4.5
  • eslint 8.57.0
  • eslint-config-next ^14.2.3
  • eslint-plugin-storybook ^0.8.0
  • firebase-admin ^12.1.1
  • npm-run-all2 ^6.2.0
  • storybook ^8.1.4
  • ts-node ^10.9.2
  • typescript 5.4.5

  • Check this box to trigger a request for Renovate to run again on this repository

タイトルクリックで `/` へ遷移 & GitHubのIcon表示

目的

  • demoページからindexへ遷移したい
  • GitHubのリポジトリに容易にアクセスできるようにし、ユーザにIssue/PRを作ってもらいやすくしたい

実装

  • logoにlinkを貼る
  • GitHubのIconはmaterial-iconに存在するので、それを設置する

週毎だけでなく日毎の推移を表示できるように

目的

ユーザが毎日webサイトにアクセスした場合、週毎だと変化が分かりづらい。
デフォルトで日毎表示、選択で週毎表示としたい。

実装案

  • dailyDataをcontentsに追加する
  • selectを追加し、日毎/週毎で変更できるようにする

amondnet/vercel-actionではなくVercelのDeploy Hooksを使う

amoudnet/vercel-actionとDeploy Hooksを比較した結果、Deploy Hooksを使うことにしました。

amoudnet/vercel-actionとDeploy Hooksの比較

amondnet/vercel-action

  • 良いところ
    • 出力が分かりやすい
  • 気になるところ
    • token, project_id, org_idが必要
      • 万が一tokenが漏れると、deployできるだけでなくVercel側のSecretが見れたり、deploymentを削除できたりする
      • project_id, org_idは再生成ができない気がする

Deploy Hooks

  • 良いところ
    • URLだけsecretsに渡せば良い
  • 気になるところ
    • 出力が簡素

リファクタリング

  • 未使用のファイルは消しましょう
  • components/stats が大きくなっているので、役割でディレクトリ分けましょう

Highcharts.jsのcreditを削除する

内容

https://api.highcharts.com/highcharts/credits
デフォでチャートの右下にcreditが表示される。これは設定で非表示にできる。
creditでチャートの文字が隠れることがあるので、非表示にしましょう。

ライセンス的に問題ない?

https://www.highcharts.com/blog/download/
非営利団体、個人のウェブサイト、または学校のプロジェクトならHighchartsを無料で使える、と読める。
creditについては何も書かれてないので大丈夫だと思う。

yyyy-MM-dd HH:mm:ss.SSS+09:00が別のbeginAtとして扱われる

原因

入力文字列を yyyy-MM-dd HH:mm:ss.SSSZ で決め打ちしていたため。

const getDateStrFromBeginAt = (beginAt: string) => {
return beginAt.replace(
/^(\d{4}-\d{2}-\d{2})T\d{2}:\d{2}:\d{2}\.\d{3}Z$/,
"$1"
);
};

修正案

以下のように修正してもいいが、JSTでの日付がズレる可能性がある。このため一旦Datetimeに変換後、文字列にするべき

- /^(\d{4}-\d{2}-\d{2})T\d{2}:\d{2}:\d{2}\.\d{3}Z$/,
+ /^(\d{4}-\d{2}-\d{2})T\d{2}:\d{2}:\d{2}\.\d{3}(Z|\+\d{2}:\d{2})$/,

水平展開

timestampをパースする際、timezone Z で決め打ちしてないか確認する。

  • src/types/CursusUsers.tsのDateStringがZ決め打ちになっているので単にstringにする。

    type DateString =
    `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`;

/demo でhydrationに失敗する

事象

/demo にアクセスすると、以下のUncaught Errorが発生する

Uncaught Error: Minified React error #425; visit https://reactjs.org/docs/error-decoder.html?invariant=425 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

  • Text content does not match server-rendered HTML.

Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

  • Hydration failed because the initial UI does not match what was rendered on the server.
    • このErrorは4回発生する

Uncaught Error: Minified React error #423; visit https://reactjs.org/docs/error-decoder.html?invariant=423 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

  • There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.