Playing Next Lesson In
seconds

Transcript

  1. - Now, before we actually create our Donetsch JS project, we have some prerequisites to get out of the way. First and foremost, we're gonna need a text editor

  2. to actually work within. Throughout the series, I'm gonna be using a text editor called Visual Studio Code. You can download it from code.visualstudio.com if you would like to use the same one that I am,

  3. or if you're already comfortable with a preexisting text editor, feel free to continue onwards with that. Now, we're also gonna need Node.js. Node.js is the underlying environment

  4. that AdonisJS runs within. So that's what's actually going to execute our server and get us up and running. So for that, you can either head to nodejs.org and download it from there.

  5. It will walk you through a setup process to get that installed within your system if you go with this approach. For AdonisJS version six, you will want at least version 20 or higher.

  6. So the LTS or long-term support version will be perfectly acceptable for that. If you wanna go for the latest features, that one should work A-okay as well.

  7. Now, an alternative approach to nodejs.org's download is you can use a Node package manager. For that, I like to use FastNodeManager. It's pretty quick and easy to get set up

  8. with your environment as it's cross-platform and it also supports a number of different shells. So I already have the LTS version 20 of Node.js installed,

  9. but you can go ahead and give this script here a copy, head into your terminal, paste it in. If you're using Bash, you'll be okay to just go ahead and hit Enter there.

  10. Otherwise, you can backspace that and either enter in zsh, and it also supports phish shells as well. Once you install that, it will register it within your path. So you may need to restart your terminal.

  11. So just go ahead and close out and reopen it back up. And now we should have the command fnm readily available to us. We could do --help to see the help commands for it.

  12. Scroll up a little bit and you'll see the actual commands. The one you're most likely interested in for right now is install. To install the long-term support version,

  13. you would just need to run fnm install --lts, and that will install the long-term support version, after which you should be able to run

  14. node --version and see that version printed out. Cool. So now we have Node.js installed, if you followed along with either one of those two approaches.

  15. Again, make sure you have at least version 20 there. Cool. So next we're going to need a database environment. This won't come into play until later on, but it'll be good to get it out of the way and install it now.

  16. So AdonisJS supports a number of different relational database environments. So we could use something like MySQL, Postgres, MS SQL or Microsoft SQL,

  17. SQLite or MariaDB. If you already have one of these installed on your system, you'll be a-okay to move onwards. Just note that whenever we get to that step,

  18. you'll just want to install the appropriate driver. Everything else that we'll do within the series from there on should work exactly the same, regardless of the database driver that you're working with.

  19. If you don't have one installed, I'll be using Postgres SQL. You can go ahead and download it from here. Again, that should just walk through you some steps. And then once you're finally installed,

  20. you should have an application called pgAdmin. Now, the first time pgAdmin opens up on your system, it's probably going to ask you to set a password. You'll want to remember that password,

  21. since it's just on your local system, you can make it something relatively easy to remember. For example, mine is just password. So I'm going to go ahead and hit okay here. On the left-hand side, we have a list of our servers.

  22. We're just going to have the one server version that we have installed. I have Postgres SQL 14. And then it's also going to list out our databases. These are all the databases I have installed locally on my system.

  23. Don't worry too much about that. You probably won't have any. Just right-click on databases. You can hit create database, give it a name. For this series,

  24. let's go ahead and call our database Adonis6. Note the owner is Postgres. So whenever we need to actually connect to this database, we'll be able to use this as a username

  25. and then whatever password we set as the password. So you will want to remember the password. And then if your owner is Postgres, I'll help you remember that whenever we get to that time. If you've set your owner to something different,

  26. you'll want to remember that. Okay, let's go ahead and hit save there. And we have successfully created our database. At this point, it will be empty, but we can just leave it empty. Cool, so let's go ahead and close out of pgAdmin.

  27. Cool, so the last thing that we're going to want to install on our system is called Redis. Redis is a caching database. It's going to allow us to really quickly store information into the database,

  28. get information out of the database, and determine whether or not we have any information in that database. Again, it's just for caching, not for long-term storage,

  29. but for short-term storage to help speed up operations on our system and store temporary information. So let's go ahead and dive in and get started with that one.

  30. So this one's going to vary a little bit depending on your system. So head on over to redis.io/docs/install/installredis. And from here, you'll be able to select

  31. based on your system. If you're using Linux, click here. If you're using macOS, click there. And lastly, Windows, there. I'm using macOS, so I'm going to click on macOS here. Cool, so for macOS, it's going to assume

  32. that you have Homebrew installed, which I do. But to verify that, you can run brew-version. So we'll jump back into our terminal here. I'll go ahead and clear this out

  33. and type in brew-version. Cool, and I see Homebrew 4.2.2 printed out, so I do indeed have it installed. And then lastly, we can go ahead and install Redis

  34. by doing brew install redis. So brew install redis. I already have this installed, so I'm going to skip actually executing this. But if you don't have it installed and you happen to have macOS,

  35. go ahead and give that a run and it should install it for you. Then we need to just actually start and stop the service. So redis-server, we'll start it in the foreground, but it would be great to have it running in the background

  36. so that we don't need to dedicate a terminal shell to just running Redis. So we can start in the background by running brew services start redis.

  37. So we can do brew services start redis, and that'll get it up and running. I already have it running, but we can go ahead and execute it and it should just show that it is already running.

  38. There we go, cool. So again, we don't need to do anything with Redis at this point in time. That'll come later on whenever we get to talking about caching and all that fun stuff within this series.

  39. So we have our environment set up. So now we're actually ready to go ahead and create our project. So let's do that in the next lesson.

What We'll Need Before We Begin

@tomgobich
Published by
@tomgobich
In This Lesson

We'll talk about some prerequisites to AdonisJS and this series. These include installing NodeJS, VS Code, a database environment, and Redis.

Join the Discussion 8 comments

Create a free account to join in on the discussion
  1. @tmuco

    Hello Tom,

    Are you planning to cover automated testing in this series?

    And as always, thank you for the hard work you put into this great content.

    2
    1. Responding to tmuco
      @tomgobich

      Hi tmuco!

      Not specifically within this series, but we are planning to use the completed code from this series within another series to cover testing with Japa!

      You can find what's on our radar at the page below, though series planned isn't in any particular order.
      https://adocasts.com/schedule

      2
  2. @rnam-dev

    Many thanks for the effort you made to provide us with a very detailed training series on Adonis js, many thanks again

    1
    1. Responding to rnam-dev
      @tomgobich

      Thank you for watching, rnam!!

      1
  3. @ikeh-victor

    finding it difficult to install Redis on Windows. any alternative. I skipped it but saw the need in 2.14.

    1
    1. Responding to ikeh-victor
      @tomgobich

      Hi Ikeh! Redis is used for a very brief period in this series. I believe 2.14 and 2.15 are the only two lessons we use it within, just to show how to work with it. It is completely skippable if you don't feel like setting it up on your machine!

      Alternatively, you can use Redis Cloud. They offer a small free tier if you click "Try for Free" and then select the "Essentials" plan option during sign-up, as shown below.

      Once you've created your database, you can click on "connect" and then expand the "Redis Client" section. Here you can copy/paste the username, password, host, and port into your .env file of your project.

      Note: you have to click the "copy" button to get the actual password

      1
      1. Responding to tomgobich
        @ikeh-victor

        thank you so much, I've been able to set it up. Thank you so much. I love what you do and your dedication. kudos

        1
        1. Responding to ikeh-victor
          @tomgobich

          Awesome, I'm really happy to hear you're all set up now! Thanks a bunch, Ikeh!! 😊

          0