Angular App and Spring Boot Api for Country, State and City

Share on:

Introduction

Address WebApi and test example to display Country, State and City

Prerequisite

  • Java SDK
  • node.js

Building Backend

1https://gitlab.com/address-api/api-server.git

Create Database in mysql create database address_api_db;

Export Env variable

1MYSQL_HOST=localhost
2MYSQL_PORT=3306
3MYSQL_SECRET=my_super_secret_password

Execute maven command to run project

1./mvnw spring-boot:run

API Details

Name Path
All Countries http://localhost:8080/country/all
State By Country http://localhost:8080/state/all?countryId={countryId}
City By State http://localhost:8080/city/all?stateId={stateId}

Building Frontend

1https://gitlab.com/address-api/frontend.git

Build

1ng build

Run

1ng serve

Navigate to http://localhost:4200

Demo

https://www.youtube.com/watch?v=ykxosCUoUTQ

Ref:

Thanks to https://github.com/hiiamrohit/Countries-States-Cities-database 🙇

comments powered by Disqus