Skip to content

delineateio/fast-api-example

Repository files navigation

Contributors Forks Stargazers Issues MIT License


delineate.io

delineate.io

portray or describe (something) precisely.

Fast API Example

Demonstrate a potential combination of technologies to rapidly build and deploy Python APIs
Explore the docs »

Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Usage
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgements

About The Project

The purpose of this repo is to demonstrate a potential combination of technologies to rapidly build and deploy APIs.

Built With

  • FastAPI is an API framework which is high performance, easy to learn, fast to code, ready for production
  • Behave is a BDD Python framework for collaboration between developers, QA and non-technical or business team members
  • Build Packs is a cncf project to transform application code into images to run on any cloud
  • Hashicorp Waypoint provides a modern workflow to build, deploy, and release across platforms.
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -

Usage

Run Native

# runs the server
uvicorn main:app --reload --app-dir src

# runs the tests
behave tests

# health check
http :8000/healthz

# companies
http :8000/company/03638404 # Capco
http :8000/company/00048839 # Barclays

Build Packs

# builds the image based on heroku buildpacks
pack build companies-api --path ./src --builder heroku/buildpacks:18

# runs the container on the standard port
docker run -d -p 8000:8000 --name companies-api companies-api

# cleans up
docker rm companies-api -f && docker system prune -f

Waypoint

# run the commands in ./src
cd ./.src

# start the waypoint server locally
waypoint install --platform=docker -accept-tos

# generate the waypoint token
waypoint user token new

# initialises the directory
waypoint init

# deploys the app
waypoint up

# destroys the app
waypoint destroy

Docker Commands

docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Ports}}'

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

If you would like to contribute to any Capco Digital OSS projects please read:

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

About

Combination of technologies to rapidly build and deploy Python APIs.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •