I am in the process of learning to build a library for the third party api.
I am not so sure how to start it. If anybody has any recommended steps please put them here.
I am thinking of using HTTPoison, and Poison for HTTP client and for parsing Json respectively.
The current issue that I am finding here is How would one write configs for development and for testing and for the moment is included into another app.
If anybody has any past experience on this. I would be really appreciated for recommendations.
You’re on a good path. Have a look at ex_aws - it’s doing basically the same thing, i.e. wraps HTTP API.
The tough part might be to decide which config options go into config and which ones you want to pass around. One thing that makes many libraries useless for me is when I build a multi-tenant app and the library wants me to put the API key into the config, whereas I need to make an API call with different API keys.
Very often the first thing I do, after creating the project with mix new, is to write a README.md and explain what the library is, common usage and configuration. I find it to be a good exercise before getting on with the actual implementation.
Looks like “Readme Driven Development” is already a term:
@stefanchrobot Thank you for recommending ex_aws I will definitely look there as my starting point. I also have faced similar problems in multi tenant app. Will have to think wisely about the configuration parts.
@svilen Thank you for recommending about “Readme Driven Development”. Will look there also. Cause I will opensource this library. I think it is good to do the README from day one
@axelson Thank you for recommending, the article about the configuration. Will be looking there also.