Giter Site home page Giter Site logo

lubytest's Introduction

Luby

Create a simple restfull service

Relate Parents with childrens.

Features

  • A parent can have zero to infinity childrens
  • A child can have zero to two parents
  • Must be in python with postgre database
  • Deploy in a docker

Tables

CREATE TABLE public.child (
	id serial NOT NULL,
	"name" varchar(150) NOT NULL,
	"CreatedAt" timestamp NULL DEFAULT now(),
	"UpdatedAt" timestamp NULL DEFAULT now(),
	CONSTRAINT child_pkey PRIMARY KEY (id)
);

CREATE TABLE public.parent (
	id serial NOT NULL,
	"name" varchar(150) NOT NULL,
	"CreatedAt" timestamp NULL DEFAULT now(),
	"UpdatedAt" timestamp NULL DEFAULT now(),
	CONSTRAINT parent_pkey PRIMARY KEY (id)
);

Routes

  • localhost:5000/api/parent
  • localhost:5000/api/parent/{id}
  • localhost:5000/api/parents
  • localhost:5000/api/child
  • localhost:5000/api/child/{id}
  • localhost:5000/api/children
  • localhost:5000/api/children?parents={NUMBER} return all children with NUMBER of parents
  • localhost:5000/api/parents?children={NUMBER} return all parents with NUMBER of children

Specify the relationship between the table during the POST method

Installation

git clone https://github.com/hermescanutodesouza/lubytest.git

cd lubytest/

docker-compose up -d

Run Locally

  • Need to configure the connection to the database through the environmental variables.
  • Install all dependencies
  • run the project
export POSTGRES_URL=<postgresql>
export POSTGRES_USER=<postgres>
export POSTGRES_PASSWORD=<1234>
export POSTGRES_DB=<postgres>

cd lubytest/
pip install -r requirements.txt
python main.py

Requirements

  • python v3.8+
  • postgre v11+
  • Postman v8+
  • Docker v20+
  • Docker-compose v1.25+

Usage

Off line Example

Using Postman import Luby.postman_collection.json file.

Online Example

https://documenter.getpostman.com/view/384862/TWDXnGZt

lubytest's People

Contributors

hermescanutodesouza avatar

Watchers

James Cloos avatar  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.