Member-only story
Building a Multiplayer RPG with Meteor & Flutter (4): Authentication
In the previous article, we added our first Non Player Character and the ability to talk with it.
Today, we will add authentication using Meteor. This is going to be our first step toward making the game multiplayer !
I choose to use Meteor because of its real-time data feature which will simplify our state management.
But Meteor is based on websockets to communicate between the client and the server so we cannot use it like we would use a regular REST api or equivalent.
If you’re not familiar at all with Meteor, I recommend you to have a look at https://guide.meteor.com/accounts.html before reading this article.
To be able to use Meteor with Flutter, we will use dart_meteor
. The author of this package wrote this article to introduce authentication which was of great help.
Create the meteor app
Let’s start by creating our meteor app which we will use as a backend. This application will store our user’s data and handle authentication.
I used Blaze as a front-end framework but you can use the one that suits you as we’re not going to use it here anyway.
To create one with blaze, run meteor create --blaze game-server
.
We will start by removing the packages insecure
which allow collection methods to be called from the clients and autopublish
which publish all…