View on GitHub

基本事項

Home

基本事項

表記ルール

プロンプトの状態

任意のディレクトリ

$

オフライン処理のルートディレクトリ

offline$

フロントエンドのルートディレクトリ

frontend$

バックエンドのルートディレクトリ

backend$

仮想環境 recsys_full へのアクティベート

$ source ~/venv/recsys_full/bin/activate
(recsys_full) $

postgres データベースへの接続

$ sudo -u postgres psql
postgres=#

ml_latest_small データベースへの接続

postgres=# \c ml_latest_small
ml_latest_small=#

recsys_full データベースへの接続

postgres=# \c recsys_full
recsys_full=#

ファイルの編集

下記の例のように、パスに示したファイルをコードの内容のとおり編集します。ファイルが存在しない場合は、新規に作成したうえで編集します。既存のファイルを編集する場合は、// <- 修正// <- 追加などの指示がありますので、それにしたがってください。...(略)...と書かれた箇所は省略しています。

例;src/frontend/src/app/layout.tsx <- ファイル名

import type { Metadata } from 'next';
import { Geist, Geist_Mono } from 'next/font/google';
import './globals.css';

import { STYLES, SETTINGS } from '@/constants'; // <- 追加

import Header from './components/Header';
import Footer from './components/Footer';
......
export const metadata: Metadata = {
  title: SETTINGS.APP_NAME, // <- 修正
  description: 'Generated by create next app',
};

export default function RootLayout({ children }: LayoutProps<'/'>) {
  return (
    <html lang="ja" className={`${geistSans.variable} ${geistMono.variable} ${STYLES.HTML}`}>
      {/* <- classNameを修正 */}
      <body className={`${STYLES.BODY}`}>
        {/* <- classNameを修正 */}
        <Header />
        <main className={`${STYLES.MAIN}`}>{children}</main> {/* <- classNameを修正 */}
        <Footer />
      </body>
    </html>
  );
}

環境依存の内容

下記のように<>で記された箇所は、そのまま入力するのではなく、自身の環境に合った内容を入力してください。

例;

(recsys_full) backend$ export ENCRYPTION_KEY=<FERNET_KEY>

起動方法

フロントエンドサーバの起動

frontend$ yarn dev

動作確認するときは、フロントエンドサーバおよびバックエンドサーバが起動している状態で下記 URL にアクセスしてください。

バックエンドサーバの起動

ここでは、データベースにアクセスするユーザ名をrsl、ログインするためのパスワードをrsl-passとしています。適宜、変更してください。環境変数の設定は端末起動時の一度のみで結構です。

(recsys_full) backend$
 export DB_USER=rsl
 export DB_PASSWORD=rsl-pass
 export ENCRYPTION_KEY=<FERNET_KEY>
 python manage.py runserver

バックエンドサーバのみ動作確認するときは、バックエンドサーバが起動している状態で下記 URL にアクセスしてください。