Skip to content

MIT-Senseable-City-Lab/sensing-garden-web

Repository files navigation

Sensing Garden Dashboard

A web dashboard to view data from the Sensing Garden API using the sensing_garden_client package.

Setup Instructions

Environment Setup

  1. Create a .env file in the project root with the following content:
# API Configuration for Sensing Garden Backend
SENSING_GARDEN_API_KEY=your_api_key_here
API_BASE_URL=https://your-api-endpoint.com

Option 1: Using Poetry (Local Development)

  1. Install Poetry if you don't have it already:
curl -sSL https://install.python-poetry.org | python3 -
  1. Run the start script to create the Poetry environment:
./start_local.sh
  1. Run the dashboard:
poetry run flask run --host=0.0.0.0 --port=8080
  1. Open your browser and navigate to:
http://localhost:8080

Option 2: Using Docker

  1. Make sure Docker and Docker Compose are installed on your system

  2. Build and run the Docker container:

docker-compose up --build
  1. Open your browser and navigate to:
http://localhost:8080

Features

  • View detection data including images and metadata
  • View classification data including species information and confidence scores
  • View model information
  • View detailed information for each item
  • Direct links to S3 images
  • Pagination support for large datasets

Technical Details

  • Uses Flask for the web framework
  • Poetry for dependency management
  • sensing_garden_client package to interact with the API
  • Docker support for containerized deployment

Environment Variables

The following environment variables are required (stored in the .env file):

  • SENSING_GARDEN_API_KEY: API key for authentication with the Sensing Garden API
  • API_BASE_URL: Base URL for the API

Development

Adding Dependencies

To add new dependencies to the project:

poetry add package-name

Running Tests

First install dependencies (if not already done):

poetry install --no-root

Run the test suite using Poetry's virtual environment:

poetry run pytest -q

Health Check Endpoint

After starting the dashboard you can verify that it is running by hitting the /health endpoint:

curl http://localhost:8080/health

Deploying to AWS AppRunner

This application is configured to be deployable to AWS AppRunner. The Docker container setup provides the necessary configuration for cloud deployment.

Notes

  • This dashboard is for development and testing purposes only
  • For production use, consider adding authentication and additional security measures

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •