This project was bootstrapped with Create React App.
- open terminal and
cd
into project folder - run
npm i
and wait until it finishes - run
npm start
and wait until project compiles itself in development mode - it will automatically start the browser and open
http://localhost:3000
- just run
npm run test
in terminal from the root folder (you could do in the separated terminal while app is running in local mode) - you will also see code coverage table in the output
- just to get the test result, just run
npm run test-raw
There are 3 ways to access subreddit you want. First one is to choose from listed subreddits on the initial screen (it is showed in batches of 10, you can go forward and backwards by clicking on the buttons under the list).
The second way is to find subreddit by typing the name of the subreddit in the input field on the right side of the app, it should populate the results in real time, and you just have to click on the desired search result.
Third way is not a typical use case, but it is possible to use it this way. If you know some subreddit that you want to open you can also open it by adding it to the base URL (i.e. for r/reactjs subreddit just put this -> http://localhost:3000/r/reactjs
in your address bar while running the app locally and press enter, data for it will load).
After choosing subreddit from the list or search results (or any of the 3 mentioned ways), you can browse the selected subreddit and open a post as it links to the original posts on actual reddit.
If the post is of a picture type, you will see the actual picture, not just the title.
You can browse subreddit you entered (i.e. r/reactjs) as you will get the latest articles in a batch of 10 per page, naturally there are PREV and NEXT buttons for going forward or backward.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000
to view it in the browser.
Launches the test runner in the interactive watch mode with code coverage table.
Launches the test runner in passive mode, displays the test results with code coverage. No inputs needed.
Runs the automated tests first and if everything is fine it proceeds to build the app for production to the build folder. This was altered to work in the deployment pipeline - if every test passes it builds it, otherwise the build is interrupted and fails.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes. Your app is ready to be deployed!
- create-react-app
- typescript
- styled-components
- JEST & Enzyme
- Git
- Eslint
- Netlify