![]() In the “server” folder, create an app.js file that will initialize the application and create and hold the environment configuration. You can now run npm start and nodemon will be activated.Įnough with the preparations, let’s code. Minimal and flexible framework to be usedĪllows you to interact with the MySQL databaseĪutomatically restarts the application when file changes in the directory are detectedĪfter installing them, go to your package.json file and, in the scripts section, change start from node app.js to nodemon app.js. we will summarize what each dependency does below, in case you are not familiar with all of them. To install them, we will be using yarn version 1.22.10 and running the yarn add command. Then, run the npm init command to initialize npm and proceed to install the required dependencies listed below. Folder names are up to you, you can name them however you want. Once you are done, you can start by creating the backend project and installing the necessary dependencies.įirst, we will create a “loginApp” folder and, inside it, another one called “server” where our backend will be placed. Select the configuration below and click “Apply” to finish the setup. Right click it and select “Create table”. In the left panel, you will see the database we have just created. Click “Apply” and the database will be created. We will name it “loginDB”, but you can choose whichever name you prefer. Right click below “Schemas” and choose “Create schema”. Remember the password, as well as the username and the port your local instance is running on. To connect to the database, click on that instance and you will be asked to enter a password. When you have finished, you will see a MySQL local instance running. We will use versions 8.0.25 and 8.0.12, respectively. Download it from the same site and install it. Then, MySQL Workbench will be needed to manage our database. Follow the installation instructions and that’s it. Start by downloading MySQL Community Server from their website. You can use another database if you want. To store our users in the database, we will be using MySQL Community Server as well as MySQL Workbench, so you will need them both as well. We will be using node v14.16.1 and the npm 6.14.12 version. To be able to follow this part of the guide, you must have Node installed. Behind the scenes, it will be interacting with the database, creating the users when they sign up and verifying their credentials when they attempt to log in. It will receive requests from the frontend and, in turn, give a response according to the result of the data flow. Let’s talk about our backend and what its role will be. Now that we know which technologies we are going to use, let’s get started. Moreover, its package ecosystem, npm, has the greatest number of open-source libraries in the world. Moreover, it uses a non-blocking I/O model to respond to events from a user or from another application, which makes it lightweight and efficient. The official documentation claims that “ Node.js is a JavaScript runtime built with Chrome’s V8 JavaScript engine.”īeing a runtime means it acts as an environment that allows you to execute, in this case, a JavaScript program on your machine. ![]() Therefore, this tool allows web developers to take advantage of React’s outstanding benefits and apply their prior JavaScript knowledge but, in this case, to target mobile platforms. React Native is a framework based on React that uses JavaScript to build mobile applications that render natively, for Android and iOS at the same time. But let’s analyze what that really means. To put it more simply, React Native is the adaptation of React for native development. Why React Native?Īccording to the official docs, “ React Native combines the best parts of native development with React, a best-in-class JavaScript library for building user interfaces.” You should know that prior knowledge of both tools is required to complete this guide successfully. We won’t go into too much detail, so you can get started as soon as possible.īefore we start, let’s take a look at why we chose to use these technologies. Once logged in, users will be able to access a private resource. In this guide, we will cover how to connect React Native and Node.js to develop a login application. ![]()
0 Comments
Leave a Reply. |