This repository is a monorepo containing both the frontend and the backend in their respective folders.
- Node.js (tested on v14.18.0)
- PostgreSQL (tested on v14.0)
The following step is common for both the frontend
and backend
folder.
- Install all dependencies and setup the pre-commit hooks:
npm install
-
(Optional) Populate the
.env
file (following the.env.example
file) if the default user (postgres
) and password (postgres
) does exist. -
Create and seed the database:
- Import BTO excel file to file path src/database/data/HDB-BTO-Prices-List.xls
- Convert the resale files from csv to xlsx and import to the following file paths:
- src/database/data/resale-flat-prices-based-on-approval-date-1990-1999.xlsx
- src/database/data/resale-flat-prices-based-on-approval-date-2000-feb-2012.xlsx
- src/database/data/resale-flat-prices-based-on-registration-date-from-mar-2012-to-dec-2014.xlsx
- src/database/data/resale-flat-prices-based-on-registration-date-from-jan-2015-to-dec-2016.xlsx
- src/database/data/resale-flat-prices-based-on-registration-date-from-jan-2017-onwards.xlsx
npm run db:create
and
npm run db:seed
- Start the development server:
npm run dev
- To update BTO table, import new BTO excel file to file path src/database/data/HDB-BTO-Prices-List.xls. Then run
npm run db:update-bto src/database/data/HDB-BTO-Prices-List.xls
- To update Resale table, run
npm run db:update-resale
- Start the development server:
npm run dev
You may also choose to run the app in production mode.
- Build the frontend and backend:
cd frontend
npm run build
cd ../backend
npm run build
- Inside the
backend
folder, start the production server:
npm start