I provided consultancy to a client to develop a product. Its been a couple of years now and I think there is a market to build that product for other clients. My question is how does it work. Is it ok if I use the ideas, use cases and logic that I developed for my first client to build my own product ? Are there any legal implications?
It's impossible to give you the right advice because you don't say in what country/state/province you're located. Basically, it all depends on the terms of the consulting contract and the local laws.
It is likely that some proprietary and/or private information was shared with you during your gig. The use of that knowledge is governed by the contract and the laws of your locality. There can be a permanent ban on future use for profit or there could be a term for that restriction. Even if the contract didn't specify the terms for intellectual property, there're still local laws about it.
In general, using the information that you learned from a client (not as a result of your own work) to build your own similar product is very unethical. You risk tarnishing your professional reputation if caught.
Did you have a contract in place with them when you did the initial consulting? That is going to play the largest part - if you agreed to anything specific you'll need to know that. If you haven't signed anything then you are probably ok. Since most IP falls to the creator (programmer) by default.
So if you learned information about a particular domain. Let's say real estate... and you created product X for a client. If you then want to make product Y and sell it in the real estate market based on things you have learned that should be fine. Assuming you are not using any logic, information, or something that is clearly a process or some IP of that client. If it's not something you COULD have learned on your own, or that is common knowledge you should be fine.
Even if you created a product to solve a problem for them, typically by default you would be the owner of the product and they would have the right to use it.
As mentioned, depending on your country, state, things you've signed like: work for hire agreements, confidentiality, NDA etc.
It depends on contracts and NDA's you have signed with your customers. As usual something comes from something. Most of products were created basing on former experience. So your case is quite normal.