This project was bootstrapped with Create React App. website is deployed over heroku -- https://tiny-word-counter.herokuapp.com/
Clone the repository
git clone https://github.com/vishalsh2299/Word-Counter.git
Move into the directory
cd client
To start the server type the below commands
npm run start-server
Local server will be running at localhost:5000 Hosted server running at https://tiny-word-counter.herokuapp.com/
To start the frontend type the below commands. Runs at localhost:3000
ng serve
In the project directory, you can run and create the build folder(for deployment):
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
To install all the dependencies run npm install
- React material ( for loader )
- React ( front end )
- Axios ( to get and post data using the API )
- Body parser ( to parse JSON data )
- Request ( to fetch data from the given API )
- Express ( for handling requests )
- Nodemon ( Easy reloading only for development )
Goto: server -> index.js Get the POST request from the frontend form value. Then fetching the data from the API and mapping each word with its count and then sorting and storing it in an array. Then sending the top n (value that we got from the form) words with their count.
Goto: src index.js is the main file that renders the components and here we fetch the API data and pass it to FetchWords component FetchWords it renders the props data that is sent and shows all the words with their respective frequency CountWord: it gets the input value and pass to the api using axios on submitting.
#Rendering the top N words
#Loading Words