Skip to content

Commit

Permalink
Add architecture documentation (#101)
Browse files Browse the repository at this point in the history
* Start outlining architecture in docs

* Switch to png

* Tweak diagrams

* Expand and improve architecture docs

* Simplify planned graph

* Clarify some services
  • Loading branch information
kasbah committed May 30, 2017
1 parent 71ca60f commit 41aa6b2
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Expand Up @@ -110,6 +110,52 @@ gerbers: manufacture/gerbers-and-drills


## Development

### Architecture

#### Current
This repository is the Kitnic front-end. The contents including all project
data are currently pre-compiled into a static site. The main part of the site
that requires server side components is the submission preview (`/submit`). Pages also use freegeoip lookup to decide what sites to link to for people that do not have the 1-click BOM browser extension. This roughly illustrates the main data flow when someone is browsing the site.

![](docs/current.png)

We have two services running for the submission preview.

- [git-clone-server](https://github.com/kasbah/git-clone-server) for serving up files from git repositories.
- [partinfo](https://github.com/monostable/kitnic-partinfo) for getting part information for the BOM.

And one for the geo ip lookup on pages.

- [freegeoip](https://github.com/fiorix/freegeoip)

#### Planned

We are using [GitLab](https://gitlab.com/gitlab-org/gitlab-ce) as an authentication and Git hosting service. We modify and proxy it to get the functionality we need.
The graphs get too complicated if we try to add all the possible data-flows but here is the rough data-flow for submission of a project.

![](docs/planned.png)

Services used are:

- [nginx-config](https://github.com/monostable/kitnic-nginx-config) to configure Nginx to serve the frontend and all services.
- [partinfo](https://github.com/monostable/kitnic-partinfo) for getting part information for BOMs.
- [gitlab-config](http://github.com/monostable/kitnic-gitlab-config) configuring GitLab to be used for authentication and Git hosting.
- [gitlab-proxy](https://github.com/monostable/kitnic-gitlab-proxy) for requests that need to access GitLab API but need any kind of added functionality like unauthenticated access or modifying projects (which needs additional hooks to trigger processing).

### Roadmap

- [ ] GitLab and Accounts
- [x] Modify GitLab and integrate with login in Kitnic frontend
- [x] Build frontend for basic account settings
- [ ] Make GitLab source of user projects
- [ ] Upload submissions and editing
- [ ] Allow for file upload to GitLab
- [ ] Gerber plotter processing for KiCAD and Eagle
- [ ] BOM extraction processing
- [ ] BOM Builder
- [ ] Get retailer info out of [partinfo](https://github.com/monostable/kitnic-partinfo)

### Requirements

- [Nodejs](https://nodejs.org) >= 6
Expand Down
15 changes: 15 additions & 0 deletions docs/current.dot
@@ -0,0 +1,15 @@
digraph current {
rankdir=RL
edge [style=dotted];
user [shape=star];
frontend -> user;
partinfo -> frontend;
"git-clone-server" -> frontend;
freegeoip -> frontend
subgraph cluster_01 {
"Server Side" [shape=none];
partinfo;
"git-clone-server";
freegeoip
}
}
Binary file added docs/current.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/makefile
@@ -0,0 +1,9 @@
all: planned.png current.png

%.png: %.dot
dot -Tpng $< -o $@

clean:
rm -f *.png

.PHONY: all clean
23 changes: 23 additions & 0 deletions docs/planned.dot
@@ -0,0 +1,23 @@
digraph current {
rankdir=LR;
user [shape=star];
user -> frontend [dir=both];
frontend -> "gitlab proxy";
"gitlab proxy" -> gitlab;
gitlab -> "process project";
partinfo -> "process project";
"process project" -> "project server";
"process project" -> frontend;
"gitlab proxy" -> "process project";
"project server" -> frontend;
subgraph cluster_01 {
color=none;
user frontend;
}
subgraph cluster_02 {
{rank=same;
"Server Side" [shape=none];
gitlab partinfo "project server";
"gitlab proxy" "process project";}
}
}
Binary file added docs/planned.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 41aa6b2

Please sign in to comment.