Giter Club home page Giter Club logo

se-challenge's Introduction

Getting Started

First, clone this project and change to its directory.

git clone <repo_location>/se-challenge.git
cd se-challenge

Install Homebrew from http://brew.sh/

Install Python:

brew install python

Install Postgres:

brew install postgres

Configure Postgres:

initdb /usr/local/var/postgres

createdb csvstorage

Start Postgres:

postgres -D /usr/local/var/postgres

Set the connection string environment variable. Mine looks like this:

export DATABASE_URL=postgres://alex:@localhost:5432/csvstorage

Create a virtualenv:

virtualenv venv

Activate virutualenv

source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Start the server:

python src/server.py

Navigate to http://localhost:5000 in Chrome or Fox and follow the on-page instructions.

Three Things I'm Proud Of

Running in the Cloud

This application also runs in the cloud on Heroku.

First, get started with Heroku at: https://devcenter.heroku.com/articles/getting-started-with-python#introduction

In the project directory provision a dyno and add postgres to it:

heroku create 

heroku addons:add heroku-postgresql:hobby-dev 

Run locally with:

foreman start

Run in the cloud with:

git push heroku master

heroku open

##Repurposed UI

I repurposed code from another project to quickly iterate on the UI for this one. I am proud of the speedup that allowed.

##Unicode

This project has skeletal unicode support. CSV files are often exported from Microsoft Excel, and nonexpert users can easily end up with files encoded, for example, as UTF-16BE. There is skeletal support for detecting and parsing these encodings included, but I abandoned it when I decided to use PG to ingest the CSVs directly (in the interests of speed).

TODO

Add a fade to a spinner image to show the upload is working when there's a slight delay (eg, on Heroku).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.