MLH Prep Project for Pod 22.OCT.PREP.1
Follow the steps below to setup the project on your local machine according to the operating system you are using.
Step 1
: Install Node.js and npmYou can skip this step if you have node installed on your system.
Open the link below to install Node.js and npm on your system.
https://nodejs.org/en/download/
Step 2
: Install all the dependenciesnpm install
Step 3
: Create a .env
file and insert your api key:You can generate an api key by clicking on this link.
REACT_APP_APIKEY
REACT_APP_GEOKEY
REACT_APP_AUTOCOMPLETE_LOCATION_APIKEY
REACT_APP_ALERTKEY:
Add the following in your .env
file and replace Your_Api_Key
with the api key generated
REACT_APP_WEEKLYFORECASTAPIKEY
REACT_APP_APIKEY=Your_Api_Key
REACT_APP_GEOKEY=Your_Api_Key
REACT_APP_AUTOCOMPLETE_LOCATION_APIKEY=Your_Api_Key
REACT_APP_ALERTKEY=Your_Api_Key
REACT_APP_WEEKLYFORECASTAPIKEY=Your_Api_Key
Step 4
: Start the server:npm start
You can view your project at http://localhost:3000/
.
Step 1
: Install Node.js and npmYou can skip this step if you have node installed on your system.
Open the link below to install Node.js and npm on your system.
https://nodejs.org/en/download/
Step 2
: Install yarnYou can skip this if you have the yarn installed on your system. Make sure it is the latest stable version.
Run the following command in Powershell.
npm install --global yarn
Step 3
: Install the dependenciesyarn install
or simply
yarn
Note: The yarn.lock may cause issues with the installation of dependencies. If you face this issue, try deleting the yarn.lock file and repeat the command above.
Step 4
: Start the serveryarn start
Step 1
: Install the Curl Command-Line ToolYou can skip this step if you have curl installed on your system.
sudo apt install curl
Step 2
: Install Node.js and npmYou can skip this step if you have node installed on your system. Make sure it is the latest stable version.
Open the link below to install Node.js and npm for your specific distribution.
https://github.com/nodesource/distributions/blob/master/README.md
Step 3
: Install all the dependenciesnpm install
Step 4
: Start the server.npm start
You can view your project at http://localhost:3000/
.
Step 1
: Install the Curl Command-Line ToolYou can skip this step if you have curl installed on your system.
sudo apt install curl
Step 2
: Install Node.js and npmYou can skip this step if you have node installed on your system. Make sure it is the latest stable version.
Open the link below to install Node.js and npm for your specific distribution.
https://github.com/nodesource/distributions/blob/master/README.md
Step 3
: Install yarnYou can skip this if you have the yarn installed on your system. Make sure it is the latest stable version.
npm install --global yarn
Step 4
: Install the dependenciesyarn install
or simply
yarn
Step 5
: Start the serveryarn start
!!! Have your environment file ready before running the container !!!
This project contains 2 Dockerfiles := Dockerfile.dev
and Dockerfile.prod
for development and production environment respectively.
These 2 enviroments are :-
In order to run them simply choose from one of the above and replace them for env-name
$ docker-compose up <env-name>
Both of these environment would be live at localhost:3000
To make your own image, choose from any of the above mentioned Dockerfile and simply run
$ docker build -t <image_name> -f <dockerfile_name> .
Create a .env
file to insert your API keys. You can refer to the example.env
format for more information.
Step 1
: Go to this url and sign up. https://openweathermap.org/current
Step 2
: Generate the API key in the My API Keys section and add that in .env
file.
Step 1
: Go to this url and sign up. https://myprojects.geoapify.com/projects
Step 2
: Create a new project and under "Choose a Geoapify API" dropdown select "Places API".
Step 3
: Add the generated key in .env
file.
Step 1
: Same as above.Step 2
: Create a new project and under "Choose a Geoapify API" dropdown select "Autocomplete API".
Step 3
: Add the generated key in .env
file.Add the following in your .env
file and replace Your_Api_Key
with the API key generated
REACT_APP_APIKEY=Your_Api_Key
REACT_APP_GEOKEY=Your_Api_Key
REACT_APP_AUTOCOMPLETE_LOCATION_APIKEY=Your_Api_Key