Some community members have done that. One did a project write up.
The biggest complexity is over what is the device’s behavior in a power outage.
US code in most areas require that doors on buildings where people sleep be able to be opened from the inside in the event of a fire without requiring an extra key or code or device.
At the same time, most people would like their doors to remain locked from the outside in a power outage to prevent burglary.
This is why most smart locks are deadbolts. It’s easy to have a manual turn bolt on the inside which will work whether the lock is powered or not, but the default is that it is locked from the outside, again whether it is powered or not.
As soon as you go to the strike plate mechanism, it’s common to find that allowing it to Open from the inside even when the power is off means it will be unlocked from the outside when the power is off.
So just depends on exactly what you want.
Here’s the project report the other person posted: