Repository files navigation Live Demo FPS-Aim-Trainer - Heroku Backend Is Permanently Down - Setup DB Locally if you want to run it. Instrusctions below
How to setup fps-aim-trainer-backend database locally (or on a virtual computer through a third party service such as Heroku that allows you to attach databases with your application)
Steps to setup database locally (WSL Ubuntu)
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo service postgresql start
sudo -u postgres psql -c "SELECT version();"
Create new super user (optional)
sudo -u postgres psql
CREATE ROLE your_username WITH SUPERUSER LOGIN PASSWORD 'your_password';
Verify role \du
Exit PostgreSQL q (if desired)
Add Create role, Create DB, Replication, Bypass RLS roles to new super user (optional)
sudo -u postgres psql
ALTER ROLE brianruff WITH BYPASSRLS CREATEDB CREATEROLE REPLICATION;
Verify roles with \du
Exit PostgreSQL q (if desired)
Access psql shell with your user
psql -U brianruff -d postgres -W
enter the password that assigned to the user
Updating pg_hba.conf files - Allows you to access psql shell as different user than root
change peer to md5 or scram-sha-256
CREATE DATABASE "fps-aim-trainer";
\c fps-aim-trainer
Create table named "score" (be sure that you are connected to the correct database "fps-aim-trainer" or w/e u named it)
CREATE TABLE score ( username VARCHAR(255), score INT );
Grant User Permission to database
GRANT CONNECT ON DATABASE "fps-aim-trainer" TO new_username;
GRANT ALL PRIVILEGES ON TABLE score TO new_username;
Create connection string to configure database in dbConfig.js
example connection string: "postgresql://username:password@localhost:5432/fps-aim-trainer"
node or nodemon node index.js
How to run the user interface once you have the backend running
In the ui folder, runt he index.html file in your browser.
Running on HTTPS (Ubuntu) - Server will try to do this for you automatically now
create signed certificate with OpenSSL
openssl genrsa -out localhost.key 2048 openssl req -new -x509 -key localhost.key -out localhost.cert -days 3650 -subj /CN=localhost
About
Improve your AIM for your favorite FPS PC Game
Resources
Stars
Watchers
Forks
You can’t perform that action at this time.