/touch-instinct-test-task

Test task for Touch Instinct

Primary LanguageJavaScript

File uploader

How to setup

Install dependencies
yarn install
Setup PostgreSQL
  1. Install PostgreSQL

    sudo apt-get install postgresql
  2. Change the default user password

    sudo passwd postgres
  3. Change the Postgres admin password

    # Change to the postgres user
    su - postgres
    # Log in to the postgres prompt
    psql
    # Change password
    \password postgres
  4. Create database

    # (In postgres prompt)
    CREATE DATABASE files;
  5. Run script to create table 'files'

    DATABASE_URL='postgres://postgres:<YOURPASSWORD>@localhost:5432/files' node models/files.js

    where is a password you typed in step 3

Build for development

Use webpack-dev-server with hot reload, source maps and dev React version

yarn dev
Build for production
yarn build
Start server

Server serves built files from /dist, so you need to run yarn build first.

PGUSER=postgres PGHOST=localhost PGPASSWORD=pgpass PGDATABASE=files PGPORT=5432 node index.js