Giter VIP home page Giter VIP logo

fullstack-challenge-api's Introduction

Fullstack Challenge API

React Native App

How to run

  • Clone this repo in your machine

  • With Docker

    • Build back-end in the terminal:

      $ docker-compose build
      
    • Run back-end in one terminal:

      $ docker-compose up
      
    • Run migrations in another terminal:

      $ docker-compose exec api yarn typeorm migration:run
      
  • Wait until see this message in the terminal:

    api_1  | listening at http://localhost:3000
    

Endpoints

Create a book:

  • Endpoint:

    http:/localhost:3000/api/books
    
  • Method:

    POST
    
  • Request body example (JSON):

    {
      "authorId": 1,
      "name": "Beginning Node.js",
      "description": "This book explains everything for you from a beginner level, enabling you to start using Node.js in your projects right away."
    }
    

Get book:

  • Endpoint:

    http:/localhost:3000/api/books/:id
    
  • Method:

    GET
    
  • Request body example (JSON):

    // NO BODY
    
  • Response body example (JSON):

    {
      "id": 1,
      "name": "Beginning Node.js",
      "description": "This book explains everything for you from a beginner level, enabling you to start using Node.js in your projects right away.",
      "author": {
        "id": 1,
        "name": "Barasat Syed",
      }
    }
    

List books:

  • Endpoint:

    http:/localhost:3000/api/books?page=<number>&limit=<number>&search=<string>
    // This queries are optional
    
  • Method:

    GET
    
  • Request body example (JSON):

    // NO BODY
    
  • Response body example (JSON):

    [
      [
        {
          "id": 1,
          "name": "Beginning Node.js",
          "description": "This book explains everything for you from a beginner level, enabling you to start using Node.js in your projects right away.",
          "author": {
            "id": 1,
            "name": "Barasat Syed"
          }
        },
        {
          "id": 2,
          "name": "Beginning Node.js 2.0",
          "description": "This book explains everything for you from a beginner level, enabling you to start using Node.js in your projects right away.",
          "author": {
            "id": 1,
            "name": "Barasat Syed"
          }
        }
      ],
      2
    ]
    

List authors:

  • Endpoint:

    http:/localhost:3000/api/authors
    
  • Method:

    GET
    
  • Request body example (JSON):

    // NO BODY
    
  • Response body example (JSON):

    [
      {
        "id": 1,
        "name": "Barasat Syed"
      }
    ]
    

Create a author:

  • Endpoint:

    http:/localhost:3000/api/authors
    
  • Method:

    POST
    
  • Request body example (JSON):

    {
      "name": "Barasat Syed"
    }
    

fullstack-challenge-api's People

Contributors

danielmarquesr 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.