Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather API Service

Overview

This service provides an API for retrieving weather data, logging requests in Redis, and exposing Swagger documentation for API interaction.

Requirements

  • Docker and Docker Compose installed
  • Node.js (v18 or higher) and npm installed

Installation and Running

Clone the Repository

git clone https://github.com/EugeneSafonov/ITSoft-TestTask
cd ITSoft-TestTask

Running the Project in Production Mode

Copy .env (use command copy instead of cp on Windows)

cp service-a/env.example service-a/.env
cp service-b/env.example service-b/.env
cp env.example .env

YOU NEED TO GET PUBLIC API FROM https://www.visualcrossing.com/ USING FREE PLAN OR YOU CAN USE TEST API KEY JHR47AVF7FR3MCJAAH9AD3FS9

Insert this API key to a variable of ./service-a/.env called API_KEY
Modify other variables if needed.

To run the project in production mode, use Docker Compose:

docker compose up -d --build

Verify that containers are running:

docker ps

Swagger


To stop and remove all containers:

docker compose down

Running the Project in Development Mode

Copy .env(use command copy instead of cp on Windows)

cp service-a/env.example.dev service-a/.env
cp service-b/env.example.dev service-b/.env
cp env.example .env

YOU NEED TO GET PUBLIC API FROM https://www.visualcrossing.com/ USING FREE PLAN OR YOU CAN USE TEST API KEY JHR47AVF7FR3MCJAAH9AD3FS9

Insert this API key to a variable of ./service-a/.env called API_KEY
Modify other variables if needed.

For development, it's recommended to run databases and message brokers in Docker, while running services locally.

1. Start only dependencies in Docker

docker compose up -d database database_logs redis rabbitmq

2. Install dependencies

cd service-a
npm install
cd ../service-b
npm install

3. Start services locally

Start service-a

cd service-a
npm run start:dev

Start service-b

cd ../service-b
npm run start:dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors