Version 2.0 of our glorious project! The hype is real! Such w0w, such 4m4z1ng ... such 1337! Much c00l!
"Waren Sie in einem großen Gebäude schon einmal komplett lost - hatten Sie gar keinen Plan? Dann brauchen Sie KainPlan!" - with this legendary slogan we kick-started this amazing project back in 2020 - look how far we've already gotten!
In case you want to clone this repository and get KainPlan up and running on your machine, all you should have to do is follow these instructions:
The current requirements are ...
- Node
>= v12.18.3
- NPM
>= 6.14.6
... do also note, however, that the versions mentioned are simply the ones used on the original system and everything might just work fine with newer/older versions.
Firstly, clone this repository to your local machine ...
$ git clone https://github.com/KainPlan/kp
... afterwards, change into the directory that has just been created and use npm
to install all dependencies ...
$ cd kp
$ npm i
... and you should be grand! (If you're not, feel free to ask for support ^^).
Since the user authentication update, the node server will now also be looking to connect to the local Postgres
server - you need to install / set it up.
First of all, if you don't have Postgres installed, install it and any interface/manager you like (pgadmin
, pgcli
, ...).
Then, simply run the following SQL script to set up the database, user and tables (of course you need to replace [PWD]
with the proper password):
-- Create & use the database ...
CREATE DATABASE kainplan;
USE kainplan;
-- Create user & grant privileges ...
CREATE USER kainplan WITH PASSWORD '[PWD]';
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO kainplan;
GRANT SELECT, UPDATE, USAGE ON ALL SEQUENCES IN SCHEMA public TO kainplan;
-- Create tables ...
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
email VARCHAR(40) UNIQUE NOT NULL,
username VARCHAR(32) UNIQUE NOT NULL,
password VARCHAR(60),
googleId VARCHAR(22)
);
CREATE TABLE maps (
id BIGSERIAL PRIMARY KEY,
"user" BIGINT NOT NULL,
map VARCHAR(24) NOT NULL,
CONSTRAINT fk_user
FOREIGN KEY("user")
REFERENCES users(id)
);
Ever since adding maps to KainPlan, you'll also be required to have a MongoDB
server up and running on your local machine.
First of all, if you don't have the MongoDB Community Server
installed, install it and any interfaces/db managers you require (mongosh
, compass
, ...).
Then simply open your command line interface and execute the following commands, or do it manually in your GUI:
// Create & use the databse ...
use kainplan;
// Create collections ...
db.createCollection('maps');
db.maps.createIndex({ name: "text", desc: "text" });
// Create user & grant privileges ...
db.createRole({
role: "kainplan",
privileges: [
{ resource: { db: "kainplan", collection: "" }, actions: [ "find", "insert", "update", "remove" ] }
],
roles: []
});
db.createUser({
user: "kainplan",
pwd: "[PWD]",
roles: [ "kainplan" ],
authenticationRestrictions: [ { clientSource: [ "127.0.0.1" ], serverAddress: [ "127.0.0.1" ] } ]
});
... obviously you'll have to replace [PWD]
with the real password.
@everyone who's looking for some docs, but especially @frontend-devs, you can find the full documentation here. Here you should find everything - from an extensive documentation of the backend and the models it uses, all API endpoints, ...
Tbh, it might not be completely complete... but the most important things for you (like API endpoints, etc.) will be there ... ^^
... The KainPlan Team, June 2021