Giter Site home page Giter Site logo

clowder2-backend's Introduction

Clowder 2 FastAPI Backend

Running in Docker

To run the full stack in Docker compose please use the following instructions:

  1. Build images with docker compose -f docker-compose.yml build

  2. Run all docker services with docker compose up --scale backend=4. This will start the services with four instances of the backend running in parallel.

  3. Default url for backend will be http://clowder.docker.localhost/ using a web browser. If using a different client (for example postman set the HOST header to clowder.docker.localhost). This variable is set using the traefik.http.routers.backend.rule for the backend service.

  4. To access the traefik dashboard go to http://localhost:8080. For the raw settings see http://localhost:8080/api/rawdata.

  5. Minio console is available at minioconsole.docker.localhost.

Developing

When developing please follow the following instructions:

  1. Start mongo and minio using provided development docker compose file:

    docker compose -f docker-compose.dev.yml up

  2. Install dependencies using pipenv install. See pipenv.

  3. Run app from command line (if you set it up in PyCharm you can use its debug functions):

    uvicorn app.main:app --reload

  4. API docs are available at http://localhost:8000/docs. Default API is deployed at http://localhost:8000/api/v2.

  5. Create a user using POST /api/v2/users and getting a JWT token by using POST /api/v2/login. Place the token in header of requests that require authentications using the Authorization: Bearer <your token> HTTP header.

  6. Manually run tests before pushing with pipenv run pytest -v or right-clicking on test folder and clicking Run in PyCharm.

  7. Linting is managed using Black. You can set up PyCharm to automatically run it when you save a file using these instructions. The git repository includes an action to run Black on push and pull_request.

clowder2-backend's People

Contributors

lmarini avatar max-zilla avatar tcnichol avatar longshuicy avatar

Watchers

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