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
Merged

add basic scaffold for web app #11

merged 1 commit into from Mar 14, 2018

Conversation

butlerx
Copy link
Member

@butlerx butlerx commented Mar 13, 2018

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

@GoldenBadger
Copy link
Contributor

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

@butlerx
Copy link
Member Author

butlerx commented Mar 13, 2018

I've added build instructions

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

@GoldenBadger
Copy link
Contributor

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

@GoldenBadger
Copy link
Contributor

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

@GoldenBadger
Copy link
Contributor

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
Copy link
Member Author

butlerx commented Mar 14, 2018

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

@GoldenBadger
Copy link
Contributor

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

@butlerx
Copy link
Member Author

butlerx commented Mar 14, 2018

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

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)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See rwf2/Rocket#109 (comment) for more info.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted this and got compiler errors in std.rs

failed to resolve. Not a module `log`

its possible I'm missing something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i now see what i was missing

src/main.rs Outdated

use std::io;

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove this newline and sort these alphabetically.

src/main.rs Outdated

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Add js and css for webapp, with stimulus, scss and webpack.
Add rocket server, with handlebars Templating.
Add build instructions.
Copy link
Contributor

@GoldenBadger GoldenBadger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants