Skip to content

Address Formatter API for UIDAI Hackathon

Notifications You must be signed in to change notification settings

madhavanand-github/address-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Address Formatter API

Approach

🛑 Disclaimer

Due to team limitations & single member contribution, integeration of all these modules/features are standlone and main module is having bug(tried fixing for 8 hrs but couldn't do it). Future little support can this real. I request you to please watch this video ➡️ concept-concern-video

1️⃣ Step to Run Locally

  1. Clone the repository git clone https://github.com/madhavanand-github/address-formatter.git
  2. Run npm i or npm install to install all dependencies.(Ensure NodeJS & NPM are pre-installed)
  3. Start the server node app.js or nodemon app.js;
  4. Send a POST request via Postman or Thunder Client - VSCode Extension on URL localhost:3000/format-address

2️⃣ Request Format

{
	"building" : ,
	"street" : ,
	"locality" : ,
	"landmark" : ,
	"vtc" : ,
	"subdistrict" : ,
	"district" : ,
	"pincode" : ,
	"state" : 
}

🛑 In the request body, any number of fields in any order among only above mention fields are accepted in lowercase(state instead of State) in JSON.

3️⃣ Response Format

{
	"building" : ,
	"street" : ,
	"locality" : ,
	"landmark" : ,
	"vtc" : ,
	"subdistrict" : ,
	"district" : ,
	"pincode" : ,
	"state" : ,
	"single-string-address" :
}

🛑 Response will include all the fields sent in request body along with an additional single-string-address field & repetitive fields will be assigned null in JSON.

4️⃣ Dependencies

  1. nodemon - For ease in developement.
  2. express - Backend Framework to build API.
  3. google-search-results-nodejs - To fix local language address & spelling mistake. (by serpapi.com )
  4. serp - Optional as an alternate to 3rd, if we want to deploy our own.

5️⃣ Handling of Edge/Boundary Cases

  1. Non Availabilty of Some of the Address Components (Like Locality, Sub-District)

some-fields

  1. Repetitive Components. ✅ + Extreme Repetitive Components.

empty-request

  1. Availability of Special Characters. ✅
  2. Handling of Minor Spelling Mistakes in English. ✅ 🪲

empty-request

  1. Handling of Local Language Address. ✅ 🪲

empty-request

6️⃣ Extra Security/Features

  1. Robust Against empty request. ✅

empty-request

  1. Check if field's name are correct. ✅

field-name-checker

  1. Log/Audit of API working in console. ✅

empty-request

8️⃣ Deployment

  1. Format-Address-Heroku
  2. 🛑 This won't return the reponse as expected due to module failure, I request you to please watch this video ➡️ concept-concern-video

About

Address Formatter API for UIDAI Hackathon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published