Below you will see a demo of the project. Here in this post, will share the guide of how to configure your own home automation with raspberry pi so you can remotely control anywhere.
Note the instructions require you to understand few basic things before you start this tutorial project.
These are what you will need:

Hardware
1) raspberry
2) door lock
3) door lock power-source adapter
4) gpio cables
5) where to buy?
You can buy online. If you are in Malaysia, you can buy them at lowyat and Jalan Pasar , KL.

Software
1) install nodejs and npm
2) install python

Knowledge and Understanding
1) RED and black wire and basic wiring understanding.
2) How to pin connect the wire gpio port correctly.
3) Nodejs,npm and python coding basic.

The big picture.
Your raspberry pi is like a pc/server.
Your raspberry pi can communicate and activate on/off[IO] switches of your real hardware via gpio ports.
You make your raspberry pi a server with REST API end points to on/off, via nodejs expressjs.
Your remote device like phone sends a signal to the REST end point with signal indicator flag to switch on or off.
Once your REST endpoint receives signal, the raspberry then communicates the on/off signal to its gpio via npm library gpio or phython gpio coding.

The details.
You just need search the answer on how achieve big picture milestone above and you are done. Below are the close up details wiring picture of the setup.