Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FastAPI Project Setup Guide

Follow these steps to set up and start the FastAPI project using a virtual environment (venv).

Prerequisites

  • Python 3.7+
  • Git

Steps

  1. Clone the Repository

    git clone https://github.com/dev-dojo-uok/iot-manager.git core
    cd core
  2. Create a Virtual Environment

    python -m venv .venv
  3. Activate the Virtual Environment

    • On Windows:

      .venv\Scripts\activate
    • On macOS/Linux:

      source .venv/bin/activate
  4. Install Dependencies

    pip install -r requirements.txt
  5. Run the FastAPI Application

    uvicorn app.main:app --reload

    Replace main:app with the appropriate module and application instance if different.

  6. Access the Application

    Open your browser and navigate to http://127.0.0.1:8000 to see the FastAPI application running.

  7. API Documentation

    • Swagger UI: http://127.0.0.1:8000/docs
    • ReDoc: http://127.0.0.1:8000/redoc

Usage With Docker

  1. Build the Docker Image

    docker build -t iot-manager .
  2. Run the Docker Container

    docker run -d --env-file .env --network host iot-manager

    This maps the container's port 8000 to the host's port 8000, allowing you to access the application at http://127.0.0.1:8000.

Deactivating the Virtual Environment

When you're done, you can deactivate the virtual environment with:

deactivate

Additional Notes

  • Ensure you have the correct permissions to install packages and run scripts.
  • Update the requirements.txt file as needed to include all necessary dependencies.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages