In this tutorial we will be adding TypeORM to our API and we will use it to create a database to hold products information. As a base, we…
In this tutorial we will be adding TypeORM to our API and we will use it to create a database to hold products information. As a base, we will be using the API of this tutorial. If you prefer, you can get the source files here and start right away.
The first thing that we will have to do is setup a database to use. If you already have a database (even if it’s not a MySQL one) you can’t skip this part.
I’ll be using Docker to speed the process. If you don’t know docker already, I recommend that you take a look at it. You can install it following this page: https://docs.docker.com/get-docker/
Docker works with containers that contain a working OS with the tools and programs that you need. Instead of installing and setting things up by yourself you can use a ‘plug and play’ docker container with everything ready. For this tutorial, I’ll use a MySQL container. After installing docker, just run the following command into your terminal:
docker run --name database -e MYSQL_ROOT_PASSWORD=password -p 3306:3306 -d mysql:8
This will create a MySQL detached (-d) container with the name ‘database’, a user with the password ‘password’ (-e MYSQL_ROOT_PASSWORD) and with the container’s port 3306 mapped to the host’s 3306 port. This will be a lot of information if you’ve never used docker. The main things to remember here are the name and the password that you used.
You can check if the container is running using ‘_docker ps_’ at the terminal. If nothing shows up (maybe you restarted your PC), use ‘_docker ps -a_’ to show all the containers (including the ones that are not started). To start and stop the container, just use ‘_docker start database_’ and ‘_docker stop database_’. To summarize everything:
## List all running containers docker ps ## List all containers docker ps -a ## Start a container docker start <name> ## Stop a container docker stop <name>
This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.
For a developer, becoming a team leader can be a trap or open up opportunities for creating software. Two years ago, when I was a developer, ... by Oleg Sklyarov, Fullstack Developer at Skyeng company