Giter Site home page Giter Site logo

phantom's Introduction

App brief

  • Develop a JavaScript web app that maintains a list of bookmarks (links). The user is able to add/edit/delete any link in the list. * The application should only use front-end technologies (ie no backend database!).

Flow

Overview page

  • Displays a form on the top of the page that lets a user submit a link. The form should validate whether the input is a valid URL and exists.
  • Displays the a list of links with pagination so 20 links are shown per page.
  • The pagination should include numbered pagination with next and previous links eg. < 1 2 3 >.

Results page

  • Contains a message thanking the user for a submission.
  • Displays the user’s submission.
  • Includes a link back to the overview page.

Solution

I created a simple form with an input and submit button which would take the inputs vallue and add it to the list. If the URL entered in the input is a valid url, then the url will be accepted and the user will be taken to the thank you page which is just a conditionally rendered component. The user never leaves the page (single page application) - this goes for the pagination too. a link on the thank you page removed the boolean value causing that thank you message to show, removing it from sight and showing the form again whilst also emptying the form input, in case it isn't already cleared.

Todos

  • Retain list on page reload
  • Validate URL by way of returning a 200 or 404 response

Limitations

I tried to componentise as much as possible within the time I had and had a bit of an issue with the thankyou component. The link to go back wouldn't respond and with more time, I'd have debugged it and have no doubt i'd have fixed the issue.

I'd also have liked to convert the form into a component in order to keep the App.js file as clean as possible.abs

I found a solution to use the local storage to store the state but didn't manage to get it working and didn't want to waste too much time on it and not complete other aspects of the task. I'd have liked to have implemented this with more time.

I had issue with checking the url/site existed. The solution I intended to use was to use a XMLHttpRequest to check if the site returns a 200 or a 404 but I had fake sites or sites i knew didn't exist returning 200s not returning 404s. I also tried a few npm packages but found that they had either deprecated or just didn't work.

I found that once deployed to heroku, the URL validation stopped working and didn't throw an error. I'm unsure why this is but with more time, would have liked to investigate this.

Running

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Deployment

Deploed onto Heroku. https://ykphantom.herokuapp.com/#

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.