Code Monkey home page Code Monkey logo

project-happy-thoughts's Introduction

Happy Thoughts ๐Ÿ’Œ

I've built a fullstack Twitter like application where users can read, post, delete and edit happy thoughts. I've created the application using React.js, the React hooks useState and useEffect, and an API which I've built myself.

The problem

The main functionalities of the application is that a user can POST, GET, DELETE and PATCH happy thoughts.

Before I dived into coding I started out sketching with pen and paper what kind of React components I would need, the flow of the components and what the components were to do. I decided to make the App.js component the main component with most of the functions and all of the useStates in it. With the sketch done and my decision on how the flow of the components where to be, I proceeded to build the structure for the GET and POST requests to the API, the message list containing the content of the message, how many likes it has received and a time stamp (GET request), the form where the user can post a new message (POST request) and the heart button so that the user can send likes (POST request) on a message. After that I proceeded to style the page according to a given design, which I added a few of my own styling ideas to.

I also added a counter below the form input that updated as the user types and shows how many characters are remaining. If a message doesn't meet the requirements of the API (being 5 characters long minimum and maximum 140) when posting a new message, the user will get a friendly error message stating what's wrong with the message and the focus will be once more put on the textarea. I've also added the possibility for the user to enter a username (or remain anonymous, which will be what is shown on the message if no user is filled in) and a tag, which will be displayed in the thought. A user can also edit a POSTed message and then update it (PATCH request).

If I had more time I would've added an animation for when a thought is submitted and appears in the message list.

View it live

project-happy-thoughts's People

Contributors

isabellam5 avatar emolsz avatar dependabot[bot] avatar idlefingers avatar jenniedalgren avatar puj avatar

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.