Device Registry is responsible for managing the creation of devices, sites, and events, along with handling the associated activities that occur within a site.
It follows the Model-View-Controller (MVC) architectural pattern.
.
├── bin
│ └── jobs
├── config
│ ├── environments
│ └── global
├── controllers
├── models
├── routes
│ ├── v1
│ └── v2
├── utils
│ ├── common
│ ├── scripts
│ └── shared
└── validators
├── common
└── shared
- Device Management: Create, edit, and delete devices.
- Site Management: Manage sites associated with devices.
- Event Management: Log and manage events (measurements) related to devices and sites.
- Activity Monitoring: Track activities occurring within the site.
- Cohort Management: Manage Cohorts associated with devices.
- Grid Management: Manage Grids associated with sites.
- Health Tips Management: Manage Health Tips associated with Measurements.
- Know Your Air (KYA) Management: Manage Know Your Air (KYA) lessons and quizzes.
- Backend: Node.js with Express.js
- Database: MongoDB
- Authentication: AirQo Tokens
- Containerization: Docker
- Orchestration: Kubernetes
Ensure you have the following installed:
- Node.js (version 18 or higher)
- Docker (if using Docker for deployment)
- npm
- A valid Google Cloud project and associated credentials if interacting with Google Cloud services.
- Redis (running and accessible) if using Redis for caching or other functionalities.
- If using Kafka, configure a Kafka broker, client ID and bootstrap servers.
- MongoDB (ensure a MongoDB instance is running, either locally or remotely. If running remotely, set DB_URL appropriately.)
-
Clone the repository
git clone https://github.com/airqo-platform/AirQo-api.git
-
Navigate to the microservice directory
cd AirQo-api/src/device-registry
-
Install dependencies
npm install
-
Run the service
npm run dev
-
Build the Docker image
docker build --target={TARGET_STAGE} -t {IMAGE_NAME} .
-
Run the Docker container
docker run -d --name {CONTAINER_NAME} -p host-port:container-port {IMAGE_NAME}
After successfully running the container, you can test the respective endpoints.
This project utilizes Kubernetes for container orchestration.
-
Build the image within the microservice's directory
docker build --target={TARGET_STAGE} -t {IMAGE_NAME} .
-
Push the image to a Docker registry
-
Use the images in your Kubernetes deployment files accordingly
We welcome contributions! Please see our Contributing Guide for more details.
This project is licensed under the MIT License - see the LICENSE file for details.