vigliensoni / page_rwanda_memorial

Database for memorial of Page Rwanda
GNU General Public License v3.0
0 stars 1 forks source link

Page Rwanda Memorial

This site contains the implementation for the database of the memorial of the Page Rwanda page. The basic stack for the project includes: MongoDB, Node.js, and Express.js.

Installation

Node

Install npm

Clone this repo in server and go to the repository home

Install and run npm

apt install npm
nmp install
npm start

If node: not found error, follow these instructions

ln -s /usr/bin/nodejs /usr/bin/node

and run it again.

Adjust the firewall (if needed)

Don't forget to open SSH

sudo ufw allow OpenSSH
sudo ufw enable

A demo Node project will run on port 3000, and so you may need to open it in ufw

sudo ufw allow 3000

MongoDB

Installation

Following these instructions

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

sudo apt-get update

If the package keys are missing, add them

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 012345thekeynumber6789

sudo apt-get update

Finally, install MongoDB

sudo apt-get install -y mongodb-org

Adjust the firewall

MongoDB's default port is 27017. It should be accessible only from certain trusted locations. In case you don't want to make it accessible from everywhere:

sudo ufw allow from 127.0.0.1/32 to any port 27017

Run mongo and mongod

Within the repository home, or any other known location, create /data folder

Run mongod and locate your data folder

mongod --dbpath [wherever you put your data folder]

TODO: Use systemctl or supervisor to start mongod and npm

Add some data

See notes.md

Test

If everything went well you, you can load the db schema

and start the app

mongo < mongo_conf/database_schema.js
npm start

and should be able to see the app Listing view running at

localhost:3000

The Editing view is located at

localhost:3000/memorial-admin

And the list of all entries in the database should be accessible as a JSON list at

localhost:3000/victims/victimelist