Coder Social home page Coder Social logo

bbleap's Introduction

GEO Satellite FastAPI Application

This is a FastAPI application that provides an API for managing Polygon data.

Production

  • Ensure no port conflicts exist on your machine.
  • Navigate to the project directory containing the docker-compose.yml file.
  • Run the following command:
docker-compose up 
  • wait to this message appears in terminal "Application startup complete."
  • Once the containers are up and running, access the API documentation by visiting http://0.0.0.0:8000/docs#/.
  • The first step is to create a customer account. Afterward, proceed to log in using the provided username and password.
  • Explore and utilize the available endpoints as needed.

Stage

Installation

To install the dependencies, run the following command:

pip install -r requirements.txt

This will install all the required dependencies for the application.

Project Configuration

The application can be configured by editing the env.py file in core directory The following settings can be configured:

  • uncomment load_dotenv in settings.py and fill .env
  • DATABASE_URL: The URL of the database used by the application.
  • DEBUG: Whether to run the application in debug mode.

Running the Application

To start the application, run the following command:

uvicorn main:app --reload

This will start the application on http://localhost:8000/.

API Docs Endpoints

To view the API documentation, navigate to http://localhost:8000/docs in a web browser. This will open the Swagger UI, which provides documentation for all the API endpoints.

Alembic Migration

Config DB line 63 alembic.ini

In new model you should add model in env.py file above this section

...
import model
...
target_metadata = Base.metadata

Then run below command to create migration or alter then migrate

alembic revision --autogenerate -m "Initial migration"
alembic upgrade head

โš  Warning Do't rename model class name I'm sure remove table

Routing

Add routing in routes.py

def include_router(app):
    ...
    ...
    app.include_router($YOUR_ROUTE)

Deployment

To deploy the application to a production environment, follow these steps: Update the .env file with the appropriate production settings. Set the DEBUG environment variable to False. in production mode You can set many parameters such as workers

uvicorn main:app  --workers 4 

Test

at the first You should create Fake DataBase and set DATABASE_TEST_URL in .env

pytest -p no:warnings -v -s

bbleap's People

Stargazers

Osman Makhtoomnejad avatar

Watchers

Mahdi Bahari 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.