- Django based
- Flask based
The application where the rest-client will be calling API requests to flask microservice. The main functions of this layer is to :
- Works as main interface layer.
- Parameters validation.
- Caching of the 'ifsc search' requests.
- Intracting with the flask app.
- Tracking the URL Hits & IFSC Hits.
The application where the datacfrom excel is processed and stored. The main functions of this layer is to :
- It Works aa a microservice of the system.
- Processes the stored data in memory.
- Stores ifsc bank, bank leaderboard & bank statistics data.
- Responds to the request send by django API as JSON.
python 3.8.10
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt
cd cache_api(in terminal)
python3 manage.py migrate
python3 manage.py test app
python3 manage.py runserver
cd backend_api(in terminal)
python3 test.py
python3 main.py
Congrats, you are good to go. Both the servers are running and are ready to accept you API calls at:
http://127.0.0.1:8000/api/ + 'add app urls'+'?query parameters as well'.
GET /ifsc-search
GET 'http://127.0.0.1:8000/api/ifsc-search?ifsc_code=ABHY0065004'
query parameter : ifsc_code (mandatory)
{
"status": 200,
"success": true,
"message": "Found! ifsc search data.",
"results": {
"BANK": "ABHYUDAYA COOPERATIVE BANK LIMITED",
"IFSC": "ABHY0065004",
"MICR_CODE": "400065004",
"BRANCH": "BHANDUP",
"ADDRESS": "CHETNA APARTMENTS, J.M.ROAD, BHANDUP, MUMBAI-400078",
"STD_CODE": 22,
"CONTACT": "25963157",
"CITY": "GREATER MUMBAI",
"DISTRICT": "MUMBAI",
"STATE": "MAHARASHTRA"
}
}
GET leaderboard/
GET 'http://127.0.0.1:8000/leaderboard/'
GET 'http://127.0.0.1:8000/leaderboard/?sortorder=ASC'
GET 'http://127.0.0.1:8000/leaderboard/?fetchcount=6'
GET 'http://127.0.0.1:8000/leaderboard/?sortorder=ASC&fetchcount=6'
query parameter : {
sortorder : ASC, // (optional) (valid values = ASC, DESC || Default = DESC)
fetchcount : 6 // (optional) (valid value = 1 to 225 || Default = 10)
}
{
"status": 200,
"success": true,
"message": "Found! bank leaderboard data.",
"results": {
"STATE BANK OF INDIA": 28500,
"PUNJAB NATIONAL BANK": 12237,
"CANARA BANK": 10817,
"UNION BANK OF INDIA": 10178,
"BANK OF BARODA": 9558,
"HDFC BANK": 7012,
"INDIAN BANK": 6089,
"ICICI BANK LIMITED": 5693,
"BANK OF INDIA": 5295,
"AXIS BANK": 5242
}
}
GET statistics/
GET 'http://127.0.0.1:8000/api/statistics'
GET 'http://127.0.0.1:8000/api/statistics?sortorder=DESC&fetchcount=1'
GET 'http://127.0.0.1:8000/api/statistics?sortorder=ASC&fetchcount=5'
query parameter : {
sortorder : DESC, // (optional) (valid values = ASC, DESC || Default = ASC)
fetchcount : 6 // (optional) (valid value = (1 to 10000) and all || Default = all)
}
{
"status": 200,
"success": true,
"message": "Found! bank statistics data.",
"results": [
{
"IFSC": "ABHY0065004",
"TIMESTAMP": "20/10/2022, 17:15:06.797519"
}
]
}
GET /ifsc-hits
GET 'http://127.0.0.1:8000/ifsc-hits'
{
"status": 200,
"success": true,
"message": "Ifsc hit counts results.",
"results": {
"ABHY0065004": 1
}
}
GET /url-hits
GET 'http://127.0.0.1:8000/api/url-hits'
{
"status": 200,
"success": true,
"message": "url hit counts results.",
"results": {
"IFSC_Search": 1,
"Leaderboard": 1,
"Statistics": 1
}
}