-
Notifications
You must be signed in to change notification settings - Fork 20
Server & Database Setup
We are running a Koa application using Node.js with TypeScript.
- Open a terminal inside the server directory:
cd server
- Install the required Node dependencies:
npm i
- Compile and run the application:
npm run serve
If everything runs fine (without error), you can open the admin dashboard at http://localhost:3001
The default configuration will work fine but should you wish to modify it, the environment variables are located in the .env
file.
For our current database implementation, we have adopted MariaDB with MikroORM. We have chosen to migrate to this database for faster concurrency and transactions.
-
To begin, download and install XAMPP for your operating system.
-
Next, start both Apache and MySQL, then click on Admin for MySQL, this should launch phpMyAdmin in your web browser.
-
Click on 'New' in the top-left, and for your Database name put in bym. Then click the 'Create' button.
-
Next, run the following commands within your
./server
directory of the project:
npm run db:init
This command should generate a database
folder with a Migration and snapshot file, located at server/src/database
-
Download a SQL editor and database management tool of your preference, we like to use Beekeeper Studio.
-
New Connection > Select a connection type > MariaDB
-
Input the following credentials:
Connection Type:
MariaDBConnection Mode:
Host & PortHost:
localhostUser:
rootPassword:
(Please leave this blank)Default Database:
bym -
You can provide a 'Connection Name' and you should now be able to connect successfully.
-
Once connected, you should see the tables on the left-hand side. Right click on a table > View Data. If you have not run the game yet at this point, it should have no data.
-
Finally, start the server, run the game and once loaded, refresh the database to see populated data within the tables, example:
-
We are using Redis on our server to store user tokens, for efficient read/writes.
-
To begin, download redis-windows, and select the
cygwin.zip
one (not the service) -
Once downloaded, extract the contents to a folder of your choice, preferably your Desktop.
-
Open the folder and double-click (run) the
redis-server.exe
file. This will run the Redis service in the background.
Donate to the development of this project at: https://bymrefitted.com