-
Install Node.js and NPM
-
Run
npm install
from OrgChart directory -
Run
npm start
-
App now should be running on: 127.0.0.1:3000/company
Note: if you install supervisor (npm install -g supervisor
) and then run supervisor bin/www
the app will restart on save. Helps with development.
-
It should allow users to view the chart
-
It should allow users to add and delete items to the chart
-
It should allow users to reorder and restructure the chart
-
Testing!
-
Finish features. Unfortunately, I did not have enough time to complete all feature requests.
-
Proper frontend. I'd love to spend some time making an Angular app.
-
Way to make the whole app a true module, to be easily integrated with another app. I think this has great potential for gradual signup!
-
Form validation similar to WTForms (Flask/Python) to properly display validation errors.
-
Caching.
This approaches several data structures(graph/heap/tree), but adding these constraints would
complicate the problem and make it harder to manage. By looking at several
org. charts online, it can be determined that most organizations are
structured by employee `Title`. Arguments can be made either way, but we're
going to assume this is how we'd like to structure our chart as well and
sort our data based on the numerical rank of the `Title` model.
- Each person can have multiple managers and multiple direct reports.
- Represent with a one to many
Managers
field.
- No login, all session-based (assuming this will be a part of a bigger app that has login capability).
- The session will keep track of the various
Company Charts
the user may have. EachCompany
gets a unique ID assigned which will be used as the URL linking to that chart. Eventually use this for gradual signup purposes!
Models
: This could be created purely as a SPA (if we don't need to query these models or really do anything with them a JSON blob or likewise would be fine), but since this is a full stack test we will want to have clearly defined models:
-
Employee
model: OneName
field (not everyone has a first and last name!) One to one relation to theTitle
model (we're going to assume that no one has more than one official title) One to manyManagers
field which is a self-referencing foreign key that can be null (C-level employees.) One to one relation with theCompany
-
Title
model Incrementing PKTitle
field Numerical rank (this doesn't have to be unique, all VPs can have the same rank, for example) One to one relation with theCompany
-
Company
model Sequential uuid as a PK (Note: this may give you performance problems with indexing, so it should be thought about a little more) so we can can easily generate our unique URL for the company org char page. Store this in the session for the user so they can access theirCompanies
without having to log in. Eventually this could become some kind of gradual signup for new users (users don't have to sign up to create a chart, only to save one) Title of theCompany
(required)
- We want to structure our chart based on the numberical rank of the
Title
model.
- This can be reworked to structure the graph purely based on direct reports, but at this point we'd complicate the problem beyond the time we have to work on it.
- By sticking to these constraints we can develop a UI based on the available
Title
fields which could later be expanded to a graph UI if the specs change.
-
Session support for users
-
RESTful API to:
- Add/Remove/Edit
Company
- Only supports adds - Add/Remove/Edit
Title
- DONE - Add/Remove/Edit
Employee
- No employee support. Base offTitle
.
-
Reorder
Employee
by changing theirTitle
-
Support a
progressive enhancement
UI