This Project is a Simple ReactJS Project which demonstrates the following
- Creating a Component in React
- Making HTTP calls
- Communicating between parent and child component
- Using Bootstrap along with React
- Using Basic Routing in React
The project Template can be used to build bigger projects
This project was tested on:
- node v11.2.0
- npm v6.10.3
Refer to https://nodejs.org/en/ to install nodejs
Clone the project into local
Install all the npm packages. Go into the project folder and type the following command to install all npm packages
npm installIn order to run the application Type the following command
npm startThe Application Runs on localhost:3000
Install all the npm packages. Go into the project folder and type the following command to install all npm packages
npm installGenerate static files for the application with
npm run buildInstall serve to serve the static content in the build folder.
npm install -g serveServe the application's production build
serve -i buildN/B On a real production environment, you would use a static web server like
Nginx
-
Customers Component : This Component displays a list of customers. This Component gets the data from a json file in assets folder
-
CustomerDetails Component : This Component Displays the details of the selected customer. This Component gets its data from a json file in assets folder as well. This Component is the Child Component of Customers Component
axios library is used to make HTTP Calls
The application has just one url /customerlist which ties to Customers Component
create-react-app : The following link has all the commands that can be used with create-react-app https://github.com/facebook/create-react-app
ReactJS : Refer to https://reactjs.org/ to understand the concepts of ReactJS
React Bootstrap : Refer to https://react-bootstrap.github.io/getting-started/introduction/ to understand how to use React Bootstrap