This repository is my implementation of Node.js + React.js Server-Side-Rendering or SSR*. The goal for building this application was to display "Tracks" from the Chinook Dataset in a tabular form and also give the user an endpoint to create new tracks.
This isn't truly a server side rendered application. The application serves React-ive webpages with configurable static content for each page, allowing me to improve the SEO score and improving first load times.
The application uses Postgres as the primary database and Node.js. To run the application locally, download Postgres and follow the steps below
$ createdb -h localhost -p 5432 -U <pg_user> chinook
$ cd ./path/to/application/dir
$ psql -h localhost -d chinook -U <pg_user> -p 5432 -f seed.sql
Note: The seed file used in this application is different from the default chinook seed file you can find on the original repository. Since the primary keys are note serial and do not auto-increment, I've added commands to create a
Sequence
and alter the "TrackID" column for the table used.
The command below are for MacOS, alter them for your machines OS. Replace the pg_user
with the one you used above to crate the db
$ touch .env
$ __env="BASE_URL="http://localhost:3000"
BASE_PORT=3000
PGUSER=pg_user
PGHOST=localhost
PGDATABASE=chinook
PGPORT=5432"
$ echo "$__env" > .env
$ npm i
$ npm run dev
- Add a Dockerfile and scripts to ease deployments