Giter Site home page Giter Site logo

app-ws's Introduction

Application Developer Work Sample

Work sample to be completed to apply for the application developer position at Compose.

Context

At Compose, we have multiple apps being served on the app.compose.io domain. These apps all use the same basic CSS and JavaScript through a UI framework we built called Megatron.

The app in this repository is a Rails app which only serves a few routes. That's similar to our reality at Compose, where apps are specialized.

To test your abilities, we've created a very incomplete app which has the responsibility of exposing a UI to our users for browsing their PostgreSQL deployment.

We use appropriately-sized services to expose our data to our various apps. To simulate this condition, we created a small service (hosted at:https://compose-dummy-api.herokuapp.com/) which provides basic account details and deployment information. All of this is fake and modeled to work with this app.

Setup

Required software

  • Ruby >= 2.1
  • Bundler
  • PostreSQL >= 9.4(postgres and initdb should be available in your PATH)

Environment variables

We use "rbenv-vars" (a rbenv plugin) in development to apply environment variables present in the .rbenv-vars file. You may want to EXPORT those manually if you don't use "rbenv-vars"

Initializing a database

Use PostgreSQL's initdb executable to initialize a database in a directory (within this app's cwd) like so:

initdb -D pg_data

Starting up

Using foreman (or forego), you can start both the postgres process and the rails server process.

foreman start

Seeding the data

Make sure you've started your PostgreSQL instance by running the aforementioned foreman command. Then:

make seed

Accessing stuff

I'm sure you can figure that out from the Procfile / server logs.

About this app's structure and tooling

gem 'megatron'

This is our own UI kit / framework for consistent styles across all our apps. The source is here: compose-ui/megatron.rb

You can find some incomplete docs over here: https://megatron-docs.compose.io/

class Deployment

... is our main model from which other deployment types are inheriting (like PostgreSQL::Deployment.) It handles creating basic client connections, it knows about the connection details, etc.

What's expected of you

As a general rule, you should use idiomatic Rails to solve these problems. This could mean reorganizing things and probably means adding routes, controllers, models, and specs as you feel is necessary.

Use the tools, gems and libraries you enjoy using.

Aesthetics

Your presentation should be something you're proud of. The user-experience and aesthetic aspects should be well considered.

We have no expectations toward how something should look, but we do expect it to look good and feel natural.

Test: Specs need to pass

We've noticed an issue with the app, and added some failing specs accordingly. Please fix the issue so the specs are green.

Feature: DESCRIBE-like for PostgreSQL tables

  • Clicking on a table's name should bring up a page with all columns and their data types for the selected table. This should actually query the PostgreSQL deployment for the information, no fake data.
  • In addition to creating the actual feature. It should be tested.

Feature: Current queries

  • Show a deployment's current queries
  • It should be live updating

Feature: Tables with the same name in different schemas

In PostgreSQL, tables might have the same name but belong to different schemas.

Navigating to these tables, with the current implementation, does not work and raises an exception like:

ERROR: relation "table_name" does not exist

Fix this by appropriately displaying and using the schema in the UI and paths.

app-ws's People

Contributors

ihsw avatar jeromegn avatar jthornec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-ws's Issues

"make seed" results in SQL errors using Postgres 9.5 on macOS 10.11

Following the instructions in the readme, I've attempted to set up my environment to work on the project. However, after reaching the "make seed" stage, I receive multiple SQL errors. I've resolved some of them by correcting the SQL script, however, I am trying to determine if making these corrections is part of the exercise, or if the script needs to be updated for Postgres 9.5.

Standalone postgres and lockfiles on ubuntu

pushy ubuntu wants postgres to put its lockfile in /var/run/postgres which causes problems when the instructions for this assignment call for running a local postgres. I think the author's OS allows postgres' lockfile to be in /tmp, which causes no friction.

> foreman start
FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.6432.lock": Permission denied

Feeding postres a '-k' switch in the Procfile resolved the problem for me

web: bundle exec rails s -p 4000
pg: postgres -D pg_data -p 6432 -k /tmp

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.