GithubHelp home page GithubHelp logo

project-happy-thoughts-api's Introduction

Project Happy Thoughts API

This week my assignment was to create the backend API of Happy Thoughts, a Twitter like app for which I've built a front-end a couple of months ago. I was supposed to set up a database with MongoDB and connect it to my deployed Heroku backend. For this project it was needed to create an API with a possibility to post and get thoughts, but also with the possibility to like thoughts.

The problem

This week I started with creating an endpoint to post thoughts. As soon as I got that one up and running, and could see that my thoughts was being posted properly, I continued with creating a get endpoint to be able to get the existing posts. I sorted them by the time they were created, with the most recent on top. I also limited them to show only the last 20 messages. As soon as I had this working, I set up the endpoint to post likes. Once this was done, I connected the deployed backend to my frontend, which was easy to do by just replacing the URLs already in that repo. To complete the project, I also created one patch endpoint to make it possible yo update a thought, and a delete endpoint to make it possible to delete a thought.

I decided not to go for the red and black requirements this week, since I wanted to focus a bit on planning for the final sprint, and also to wrap up previous projects a bit.

To use the endpoints, you have the following options:

GET /thoughts to get the existing thoughts

POST /thoughts to post a thought of your own

POST /thoughts/:thoughtId/like to post a like to a specified existing thought

PATCH /thoughts/:thoughtId to update a specified existing thought

DELETE /thoughts/:thoughtId to delete a specified existing thought

View it live

The backend is deployed here:

https://backend-happy-thoughts.herokuapp.com/

and it's connected to my front-end which is deployed here:

https://therese-happy-thoughts.netlify.app/

project-happy-thoughts-api's People

Contributors

dependabot[bot] avatar emolsz avatar idlefingers avatar theresehag 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.