Coder Social home page Coder Social logo

lucascvilasboas / basic-restapi-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jllopez/basic-restapi-app

0.0 0.0 0.0 7 KB

Naive solution for a basic REST API application. Its main purpose is to provide an easy way to expose endpoints and enable SDETs to build automation frameworks around it.

Python 86.19% Makefile 12.54% Dockerfile 1.27%

basic-restapi-app's Introduction

Basic REST API Application using FastAPI

Naive solution for a basic REST API application. Its main purpose is to provide an easy way to expose endpoints and enable SDETs to build automation frameworks around it.

The application was designed to run inside a Docker container to strip out the complexity of setting virtual environments, facilitate its distribution and avoid the infamous but it works on my machine conversation.

Prerequisites

Run the App

  1. Open a terminal

  2. Change to your favorite local directory (i.e. cd /opt)

  3. Clone the repository

git clone [email protected]:jllopez/basic-restapi-app.git
  1. Run the application
make run

This command will remove any existing fastapi_restapp containers and build a new dev/fastapi_restapp image.

  1. Visit URL
http://localhost:8080/docs#/

User admin/admin is preloaded in the DB. Leverage this user to authenticate and perform admin-only operations (i.e. create/delete/list-all users, delete comments)

Developer Mode

  1. Complete steps 1-3 as described in Run the App section.

  2. Start development environment

make dev

This command will remove any existing fastapi_restapp containers, build a new dev/fastapi_restapp image, start a container, mount local code under /opt/app and provide a /bin/bash terminal.

  1. Start uvicorn server by executing the following command in the container's terminal
uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload

Now the container is ready for development. Local code changes will be automatically reflected inside the container and thanks to the --reload uvicorn flag the code will be immediately deployed.

basic-restapi-app's People

Contributors

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