Open c-lliope opened 6 years ago
Theoretically, we should be able to copy over the server/
directory into its own repo, set it up on its own server, and be good to go.
I'll work on getting something set up on DigitalOcean, and document the process.
gem install droplet_kit
bin/deploy
script from the engine repo, passing in the access token:
bin/deploy ACCESS_TOKEN_HERE
Note: this process is insecure in that it leaves the access token in the user's command history. Access tokens should be promptly removed when they are no longer needed.
Further note: at this time the
deploy
script hasn't been merged into theengine
repo. See https://github.com/assembleapp/engine/pull/1.
Okay, we now have a reproducible script to deploy assembleapp/engine to DigitalOcean. At the end of the process we get a static IP address to connect to.
Confirmed that the spun-up server can power a local development copy of SLIM.
To connect the frontend to the spun-up server, you need to change the proxy
setting in package.json
to match the IP address of the server.
After that, there's the slightly cumbersome task of setting up the SLIM database tables.
The README asks you to run a few create table
postgres commands. Previously, you could do this by booting up the server's database console with cd server && rails db
.
Since we're no longer connecting to a server on our local machine, you now need to either SSH into the server to run the command (shortcut: ssh root@IP_ADDRESSS 'cd engine && rails db'
), or put a debugger statement in this repo's src/App.js
componentDidMount()
function, and run a few commands against the Assemble API:
this.assemble.run("slim")`
create table samples (
id text not null,
partNo text not null,
customer text not null,
item text not null,
status text not null,
received_by text not null,
received_at timestamp not null,
released_by text,
released_at timestamp,
primary key(id)
);
`
this.assemble.run("slim")`
create table results (
id serial primary key,
sample_id text not null,
test_name text not null,
result text not null,
entered_by text not null,
entered_at timestamp not null,
pass boolean not null
);
`
this.assemble.run("slim")`
create table specification (
id serial primary key,
partno text not null,
test_name text not null,
test_method text not null,
criteria text not null,
judgement text not null,
created_by text not null,
created_at timestamp not null
);
`
So, long story short is that SLIM is a pain to set up now, but it works. If we're comfortable hard-coding an IP address in this repo (which I'm not), we can get the online demo working again on Netlify.
I've made a couple issues to track the next steps:
Since the demo app for this repo and for mattyayoh/nimbusPOS both rely on a backend server... that doesn't yet exist, both sites are broken.
The goal of this issue is to fix both sites by giving them a backend to talk to.