A simple messaging app using Apollo Server, GraphQL, React, Vite, and mariadb.
This project was created on a linux desktop running Arch Linux.
This application was developed using MariaDB cli.
Please replace all italicized to your preference and make sure it is consistent throughout the project.
- Install MariaDB depending on your operating system
- Install node and npm depending on your operating system
- Samples are inside the config folder. Cater it to what you will configure in the next section.
- For the dialect field inside the sample-config.json, you can configure it to 'mariadb' or 'mysql'. mariadb is used in the development of this project.
- The value of JWT_TOKEN inside sample-env.json is a type of string that you can set to whatever.
- Rename the files 'sample-config.json' to 'config.json'. and 'sample-env.json' to 'env.json'.
Initialize MariaDB
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Start MariaDB service
sudo systemctl start mariadb.service
Enter mariaMariaDB as admin
sudo mariadb
Create a database named sanSuDB
MariaDB [(none)]> CREATE DATABASE sanSuDB;
Create a user at 'localhost'
MariaDB [(none)]> CREATE USER 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';
Grant all privileges to sanSuDB database to USER then exit mariadb console
MariaDB [(none)]> GRANT ALL PRIVILEGES ON sanSuDB.* TO 'USER'@'localhost';
MariaDB [(none)]> exit
Change directory into src
cd src
Initialize database
npx sequelize-cli db:migrate
Start node server
npm start
Open your browser and navigate to localhost:5173