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)
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo service postgresql start
sudo -u postgres psql -c "SELECT version();"
sudo -u postgres psql
CREATE ROLE your_username WITH SUPERUSER LOGIN PASSWORD 'your_password';
- Verify role
\du
- Exit PostgreSQL
q
(if desired)
sudo -u postgres psql
ALTER ROLE brianruff WITH BYPASSRLS CREATEDB CREATEROLE REPLICATION;
- Verify roles with
\du
- Exit PostgreSQL
q
(if desired)
- psql -U brianruff -d postgres -W
- enter the password that assigned to the user
- 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 CONNECT ON DATABASE "fps-aim-trainer" TO new_username;
GRANT ALL PRIVILEGES ON TABLE score TO new_username;
- example connection string: "postgresql://username:password@localhost:5432/fps-aim-trainer"
- node or nodemon
node index.js
- In the ui folder, runt he index.html file in your browser.
- 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