Skip to content

Phonebook services consists of two micro services. One service creates phone book entities, the other creates reports. A queue mechanism is used for asynchronous processing of reporting requests.

Notifications You must be signed in to change notification settings

skaranuh/phoneBookServices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phoneBookServices

Phonebook services consists of two micro services. One service creates phone book entities, the other creates reports. A queue mechanism is used for asynchronous processing of reporting requests.
 

install docker images

//PostgreSql, Kafka, Zookeeper, PhoneBookApi, PhoneBookReport
 
//create phonebook-report-api image
docker build --rm --pull -f "src/PhoneBook.Report.Api/Dockerfile" --label "com.microsoft.created-by=visual-studio-code" -t "phonebook-report-api:latest" "."

//create phonebook-api image
docker build --rm --pull -f "src/PhoneBook.Api/Dockerfile" --label "com.microsoft.created-by=visual-studio-code" -t "phonebook-api:latest" "."
 
cd src
//volumes in docker compose needs to be shared by docker
docker-compose up

 

create database user for api

docker exec -it postgres_phonebook_api bash
su postgres
 
createuser -P -d -E -e phonebookuser
//password: phoneBookPass
 

psql -h localhost -U postgres -c "CREATE DATABASE phonebook;"
psql -h localhost -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE phonebook to phonebookuser;"
exit
exit
 

update api database

//update server info in connection string in ".\src\PhoneBook.Api\appsettings.json"' as localhost , port 5434 cd .\PhoneBook.Api.DataContext\
dotnet ef database update --startup-project ..\PhoneBook.Api\
cd ..
 

create database user for report

docker exec -it postgres_phonebook_report bash
su postgres
 
createuser -P -d -E -e phonebookreportuser
//password: phoneBookReportPass
 

psql -h localhost -U postgres -c "CREATE DATABASE phonebookreport;"
psql -h localhost -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE phonebookreport to phonebookreportuser;"
exit
exit
 

update report database

//update server info in connection string in ".\src\PhoneBook.Report.Api\appsettings.json"' as localhost , port 5433 cd .\PhoneBook.Report.Api.DataContext\
dotnet ef database update --startup-project ..\PhoneBook.Report.Api\
 
 
//PhoneBookApi
http://localhost:5000
 
//PhoneBookReport
http://localhost:5003

About

Phonebook services consists of two micro services. One service creates phone book entities, the other creates reports. A queue mechanism is used for asynchronous processing of reporting requests.

Resources

Stars

Watchers

Forks

Packages

No packages published