Giter Site home page Giter Site logo

iothingsdev / core-api Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 259 KB

IoThings core api is an API to kickstart your IoT projects, for BLE and Sigfox objects

Home Page: https://docs.iothings.fr

License: Apache License 2.0

Go 80.00% HTML 20.00%
iothings api sigfox golang mongodb redis iot

core-api's Introduction

Things API

Presentation Documentation Go Report Card GoDoc Swagger CI

Things API is an open-source, fast and scalable solution that enables you to speed up your IoT project development, by defining standard common features.

Things API rely on GoLang Gin Gonic web framework, MongoDB, Redis (for cache) and Sendgrid for mail management.

Getting started

Generate API Keys

If you want to send mails (for user account management) things-api uses Sendgrid, so you should get an API key.

To resolve WiFi geolocations, things-api uses Google, so you should get an API key.

Create a .env.prod file from the included .env.example file template, while customizing data such as domain name, API keys...

Install docker and docker-compose

Run docker-compose up -d

Watch yourip:4000, you should have a welcome message saying Welcome to things API.

Congratulations, you are all set !

Sigfox Use

Connect to your account, select your device type and create two callbacks:

Type: DATA UPLINK,

URL: https://youraddress/v1/sigfox/messages

Method: POST,

Content-type: application/json

mesType is 1 for Sens'it, 2 for an Arduino Syntax, and 3 for Wisol 20

{
   	"sigfoxId":"{device}",
   	"frameNumber":{seqNumber},
   	"timestamp": {time},
   	"station": "{station}",
   	"snr": {snr},
   	"avgSnr": {avgSnr},
   	"rssi": {rssi},
   	"mesType":1,
   	"data": "{data}"
}

Type: SERVICE GEOLOC,

URL: https://youraddress/v1/sigfox/messages

Method: POST,

Content-type: application/json

{
	"sigfoxId": "{device}",
	"frameNumber": {seqNumber}, 
	"timestamp": {time},
	"latitude": {lat},
	"longitude": {lng},
	"radius": {radius},
	"spotit": true
}

NGinx configuration

With HTTPS using certbot

You can copy paste and customize the nginx/conf-https-step-1 to your etc/nginx/sites-enabled/yourdomain sudo service nginx reload Run certbot ....

Copy paste and customize the nginx/conf-https-step-2 to your etc/nginx/sites-enabled/yourdomain sudo service nginx reload

Without HTTPS

Copy paste and customize the conf-http to your etc/nginx/sites-enabled/yourdomain sudo service nginx reload

API documentation and client generator

A swagger documentation is available here, you can automatically generate a client in your favourite language!

Roadmap

Some features would be nice to have, such as user roles management, Stripe billing management, Twilio SMS alerts.... And may be implemented in the future.

Miscellaneous

If you want something you consider relevant to be implemented, feel free to fork the repo, and create a PR.

core-api's People

Contributors

adrien3d avatar kindermoumoute avatar maxencehenneron avatar rb62680 avatar

Stargazers

 avatar  avatar

Watchers

 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.