New York Times Bestselling lists web app with React using The NYT's Books API & Google Books API. Top 15 bestselling fiction and non fiction books alongside a favourites section where you can add your favourite books. Clicking on a specific book takes you to it's amazon link so you can buy it.
For development, you will only need Node.js and a node global package, Npm or Yarn, installed in your environement.
-
Just go on official Node.js website and download the installer. Also, be sure to have
git
available in your PATH,npm
might need it (You can find git here). -
You can install nodejs and npm easily with apt install, just run the following commands.
$ sudo apt install nodejs $ sudo apt install npm
-
You can find more information about the installation on the official Node.js website and the official NPM website.
If the installation was successful, you should be able to run the following command.
$ node --version
v8.11.3
$ npm --version
6.1.0
If you need to update npm
, you can make it using npm
! Cool right? After running the following command, just open again the command line and be happy.
$ npm install npm -g
In case you want to install yarn, just run the following command.
$ npm install -g yarn
config.json file exists in nytbr/frontend/src
{
"backendUrl":
}
this value should reflect the value of the full path to the backend server. When running through the docker images or docker-compose this should reflect the path to the external url not the internal one.
{
"NYTBR_BACKEND_PORT": ,
"NYTBR_BACKEND_URL": ,
"NYTBR_FIREBASE_APP_ID":,
"NYTBR_FIREBASE_API_KEY":,
"NYTBR_FIREBASE_AUTH_DOMAIN":,
"NYTBR_FIREBASE_DATABASE_URL":,
"NYTBR_FIREBASE_MESSAGING_SENDER_ID":,
"NYTBR_FIREBASE_PROJECT_ID":,
"NYTBR_FIREBASE_STORAGE_BUCKET":,
"NYTBR_NYT_API_KEY":,
"NYTBR_SECRET":,
"NYTBR_DISCORD_TOKEN":,
"NYTBR_FRONTEND_URL":,
}
1-Right-click the Computer icon and choose Properties, or in Windows Control Panel, choose System.
2-Choose Advanced system settings.
3-On the Advanced tab, click Environment Variables.
4-Click New to create a new environment variable. Click Edit to modify an existing environment variable.
1-sudo -H gedit /etc/environment
2-VARNAME="my value"
cd nytbr
cd backend
npm install
Open a new terminal
cd nytbr
cd frontend
npm install
cd backend
node index.js
cd discord
node index.js
In a different terminal tab...
cd frontend
npm start
to build the images run these commands
docker build -t backend -f ./backend/Dockerfile .
docker build -t discord -f ./discord/Dockerfile .
docker built -t frontend ./frontend
to run these images simply
docker run backend
docker run discord
docker run frontend
Options
- -p use this option to specifiy what ports to bridge from the image to the outside world
- -env use this option to pass all the required env variables to the image
the docker-compse.yml handles all the runtime config needed for the running of the images simply type
docker-compose build
docker-compose up