Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

SensorHub

IoT sensor management platform with data visualization.

Tech Stack

  • Backend: Django 5.2.8, Django Ninja 1.5.0, PostgreSQL 18
  • Frontend: Vue.js 3.5.24, Tailwind CSS, Chart.js 4.5.1
  • Testing: pytest 9.0.1, pytest-django 4.11.1
  • Container: Docker Compose

Quick Start

# Start services
make up
# Access at http://localhost:3000# API docs at http://localhost:8000/api/docs# Run tests
make test# Load sample data
make seed
# Stop services
make down

Default Credentials

Email: demo@sensorhub.com
Password: demo123

API Endpoints

Base URL: http://localhost:8000/api

Authentication

  • POST /auth/register/ - Register user
  • POST /auth/token/ - Login
  • POST /auth/refresh/ - Refresh token
  • GET /auth/me/ - Get current user

Sensors

  • GET /sensors/ - List sensors (paginated)
  • POST /sensors/ - Create sensor
  • GET /sensors/{id}/ - Get sensor
  • PUT /sensors/{id}/ - Update sensor
  • DELETE /sensors/{id}/ - Delete sensor

Readings

  • GET /sensors/{id}/readings/ - List readings (paginated, filterable)
  • POST /sensors/{id}/readings/ - Create reading

Statistics

  • GET /stats/ - Get dashboard stats

Full API documentation: http://localhost:8000/api/docs

Development

Available Commands

make up # Start all services
make down # Stop all services
make test# Run tests
make migrate # Run migrations
make seed # Load sample data
make logs # View logs
make shell # Django shell
make clean # Remove all containers and volumes

Manual Commands

# Run specific tests
docker compose exec web python -m pytest api/tests/test_auth.py -v
# Create superuser
docker compose exec web python manage.py createsuperuser
# Access database
docker compose exec db psql -U postgres -d fiftytest

Project Structure

fiftytest/
├── backend/
│ ├── api/
│ │ ├── tests/ # 38 tests
│ │ ├── api.py # API endpoints
│ │ ├── models.py # Database models
│ │ └── schemas.py # Pydantic schemas
│ ├── config/ # Django settings
│ └── requirements.txt
├── frontend/
│ └── index.html # Vue.js SPA
├── docker-compose.yml
├── Makefile
└── README.md

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages