Coder Social home page Coder Social logo

apbackend's Introduction

Run APBackend locally

Install depedencies

pip install -r requirements.txt

Setup database (Homebrew installation required)

brew install postgresql

Run the app

uvicorn main:app --reload


Run APBackend on Docker

  1. Start Docker daemon
  2. [Optional] Provide permission for the first run:
sudo chmod 755 docker-build.sh
sudo chmod 755 docker-run.sh
  1. From the root directory, run the following cmds:
. ./scripts/build.sh
. ./scripts/run.sh

Result

in Browser

http://0.0.0.0:4000/api/docs Default docu generated by FastAPI

with postman


Architecture

Detail explanation sees Explicit Architecture. App uses onion architecture that leverages Inversion of Control. core/ knows nothing but itself; infrastructure/ has access to itself and everything in core/; presentation/ knows everything in the app.

core <-- infrastructure <-- presentation

The directory tree looks like this:

app/
├── core/
├── infrastructure/
└── presentation/

core/

This part includes the main Business Logic of the app, which actually do the work.

app/
├── core/
        ├── abstractions/
        ├── domain/
        └── services/
...

infrastructure/

This part connects the core/ to other tools like Database, search engine, or other third party APIs.

app/
├── core/
├── infrastructure/
        ├── adapters/
        └── database/
...

presentation/

This part is responsible to communicate with external world, receiving or sending infos.

app/
├── core/
├── infrastructure/
└── presentation/
        └── api/

apbackend's People

Contributors

chuyinghe avatar chuuuing 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.