Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic scaffold for web app #11

Merged
merged 1 commit into from Mar 14, 2018

Conversation

Projects
None yet
2 participants
@butlerx
Copy link
Collaborator

commented Mar 13, 2018

add stimulus for clientside app
rocket for api and file serving
handlebar templating
webpack to build js and scss

@butlerx butlerx requested a review from GoldenBadger as a code owner Mar 13, 2018

@butlerx butlerx force-pushed the butlerx:enhanchment/server branch from c3e9b08 to d33b379 Mar 13, 2018

@GoldenBadger

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2018

What does one need to do to build and run this?

@butlerx

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 13, 2018

I've added build instructions

this also won't build on stable or beta due to rocket

@butlerx butlerx force-pushed the butlerx:enhanchment/server branch from f226ae3 to 8b1a302 Mar 14, 2018

@GoldenBadger

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2018

Can you rebase and squash this yourself to make the commit history less weird? :P

@butlerx butlerx force-pushed the butlerx:enhanchment/server branch 2 times, most recently from 5a60d91 to eeb97ed Mar 14, 2018

@GoldenBadger

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2018

The build instructions give this error:

     Running `target/debug/good_stv --server`
error: The following required arguments were not provided:
    <seats>

USAGE:
    good_stv <seats> --server

For more information try --help

@butlerx butlerx force-pushed the butlerx:enhanchment/server branch from eeb97ed to fd03d20 Mar 14, 2018

@GoldenBadger

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2018

I believe in clap you can group mutually exclusive options. So if --server is passed it ignores all other arguments which are otherwise required.

@butlerx

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 14, 2018

I've been looking at the doc and i can't seem to find it

@GoldenBadger

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2018

I believe this will do what you want: https://docs.rs/clap/2.31.1/clap/struct.ArgGroup.html

@butlerx

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 14, 2018

that's exactly what I'm looking for, thanks.

@butlerx butlerx force-pushed the butlerx:enhanchment/server branch 2 times, most recently from 679e1c4 to 844ee3c Mar 14, 2018

src/main.rs Outdated
extern crate clap;
extern crate csv;
extern crate env_logger;
#[macro_use]
extern crate failure;
#[macro_use]
#[macro_use(log, info, debug)]

This comment has been minimized.

Copy link
@GoldenBadger

GoldenBadger Mar 14, 2018

Contributor

I think this should be replaced by just #[macro_use(log)] and then all logging macros are called as log::error! etc.

This comment has been minimized.

Copy link
@GoldenBadger

This comment has been minimized.

Copy link
@butlerx

butlerx Mar 14, 2018

Author Collaborator

I attempted this and got compiler errors in std.rs

failed to resolve. Not a module `log`

its possible I'm missing something

This comment has been minimized.

Copy link
@butlerx

butlerx Mar 14, 2018

Author Collaborator

i now see what i was missing

src/main.rs Outdated

use std::io;

use clap::{App, Arg};
use rocket_contrib::Template;

This comment has been minimized.

Copy link
@GoldenBadger

GoldenBadger Mar 14, 2018

Contributor

Nit: remove this newline and sort these alphabetically.

src/main.rs Outdated

use failure::{Error, ResultExt};
use stv::*;
use routes::*;

This comment has been minimized.

Copy link
@GoldenBadger

GoldenBadger Mar 14, 2018

Contributor

Nit: sort these alphabetically. failure should also be in the group above.

Add Basic Scaffolding for web interface
Add js and css for webapp, with stimulus, scss and webpack.
Add rocket server, with handlebars Templating.
Add build instructions.

@butlerx butlerx force-pushed the butlerx:enhanchment/server branch from 844ee3c to f5b8d01 Mar 14, 2018

@GoldenBadger
Copy link
Contributor

left a comment

LGTM. I think we should definitely split up the CLI and server binaries soon though.

@GoldenBadger GoldenBadger merged commit b8d51a3 into redbrick:master Mar 14, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.