This repository contains the backend services for the APS Final project, code-named "EcoMobile".
This project consists of four main services:
- Geolocation Service: Converts location names into geographical coordinates.
- Gateway Service: Acts as the main entry point for client requests, routing them to the appropriate microservices.
- Weather Service: Provides weather data based on geographical coordinates.
- Weather Metrics Service: Offers additional weather-related metrics based on the data from the Weather Service.
- Each service is built using TypeScript and leverages the ArunaCore framework for microservice communication.
- The services communicate with each other through defined actions and data structures.
- The Gateway Service handles incoming HTTP requests and coordinates responses from the other services.
- The Weather Service can accept either a location name or geographical coordinates to fetch weather data.
- The Weather Metrics Service provides supplementary weather metrics based on the coordinates provided by the Weather Service.
The easiest way to run all services is using Docker Compose:
-
Clone the repository to your local machine
-
Configure environment variables:
cp .env.example .env
Edit the
.envfile and add your API keys:GEO_API_KEY: Your OpenWeatherMap API key for geolocationWEATHER_API_KEY: Your OpenWeatherMap API key for weather data
-
Start all services:
docker-compose up -d --build
-
View logs:
docker-compose logs -f
-
Stop all services:
docker-compose down
The Gateway API will be available at http://localhost:3000
To run the services locally without Docker:
- Clone the repository to your local machine.
- Navigate to each service directory and install the necessary dependencies using
npm install. - Copy the
.env.examplefile to.envin each service directory and configure the environment variables as needed. - Build each service using
npm run build. - Start each service using
npm start.
NOTE: Ensure that you have a running instance of the ArunaCore, as it is required for inter-service communication.