Coder Social home page Coder Social logo

lap-1-project-server-side's Introduction

Lap 1 futureproof project - Storyboard messaging API

This API is part of the project set out by futureproof for Lap 1 of the 13-week bootcamp. The task was to design and develop a journaling-style website using full-stack. We have chosen our project to be a storyboard messaging webapp for school children whereby they can create stories which are displayed. This repository deals with the back-end of the project.

We have used NodeJS and Express to build this API. The code has been laid out using an MVC architecture. This API has several endpoints which respond with getting and posting stories and their replies.

Pre-requisites

A minimum of Node v16.11.0 needs to be installed

Installing

After git cloning this repository, CD into the directory lap-1-project-server-side and run the following command to install all the dependencies:

$ npm i

After the dependencies are installed, the API is ready to be ran

Launching the API

To start the API, run the following script:

$ npm run dev

From here a GET and POST requests can be made by using the local host with base URL: http://localhost:3000/ in insomnia or in a web browser.

Testing

For testing, Jest has been implemented. To run the test, execute the following command:

$ npm t

Hosting

The API is hosted on Heroku. This URL can be used as the base URL. Previews of the what requests and responses look like are avaialbe here.

Requests

These are the requests that can be made to the API:

GET:

  • /all - gets all messages
  • /:id - gets messages by their Id's
  • /:id/replies - gets all replies to messages by the message ID

POST:

  • /post - posts body from client onto the database
  • /:id/replies - posts reply body onto database corresponding to message ID

Add these endpoints to the base URL to make a request

Change log

For heroku, the 'start' script seems to be linked to heroku, hence it should only contain the node command, not others such as nodemon.

Authors

Team Surviving With Google:

lap-1-project-server-side's People

Contributors

syedmjavaid avatar

Watchers

 avatar

Forkers

tari38

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.