jonniek / rateapp

An image rating application created with create-react-app and express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rateapp-preview

RateApp

Let users create collections of images and criteria that images will be ranked by. Users will vote between 2 random images which one matches the criteria better. This way the collection will get ranked in a crowdsourced order.

NOTE

This projects development is halted. The master branch is not completely functional. The last working prototype can be found in the releases(with correct readme) or here.

Requirements

You need postgres installed for the database. Install guide ubuntu
You will also need npm or yarn, node(>v7.6 for async/await) and git.

Getting started

There are two parts, the server and the client. The server is the root of the project and create-react-app client is inside client/ directory. Both need to be npm installed after cloning. Be aware of which directory you run your npm scripts from, building should be done from root only as it moves the builded files into public folder. Setup and build scripts require unix commands, for windows create your own or perform the installs/moving of files manually.

Download:

git clone https://github.com/donmaiq/rateapp.git
cd rateapp

Install with npm script:

npm run setup

or manually:

npm install
cd client
npm install

DB(from project root):

sudo -u postgres createdb rateapp
sudo -u postgres psql rateapp < ./db/db-setup.sql
sudo -u postgres psql
#You need to set search path to find the schema 
postgres=#  ALTER USER postgres SET search_path = rateapp,public;
#change password if nececcary
postgres=#  ALTER USER Postgres WITH PASSWORD 'Kq9&8L7Av%leXvILquqx';

Open up db/index.js and edit the config match what you input:

user: 'postgres', //env var: PGUSER 
database: 'rateapp', //env var: PGDATABASE 
password: 'Kq9&8L7Av%leXvILquqx', //env var: PGPASSWORD 
host: 'localhost', // Server hosting the postgres database 
port: 5432, //env var: PGPORT 

Development

start express server in root dir:

npm start

start react dev server in client/:

cd client/
npm start

production

in root directory:

npm run build
npm run start

Tip: Use forever, pm2, nohup or something similar to start server in background for production.

About

An image rating application created with create-react-app and express


Languages

Language:JavaScript 82.5%Language:CSS 10.4%Language:PLpgSQL 6.7%Language:HTML 0.4%