StratisBitcoinFullNode icon indicating copy to clipboard operation
StratisBitcoinFullNode copied to clipboard

[Swagger] Create Branding

Open imclint21 opened this issue 5 years ago • 15 comments

Make a Swagger Branding

The idea is to have a custom Swagger with some branding details / style.

image

imclint21 avatar May 24 '19 01:05 imclint21

Nice.

codingupastorm avatar May 24 '19 02:05 codingupastorm

Important thing: The feature Stratis.Bitcoin.Features.Api is used as a project reference, so in each projet that use it, like Stratis.StratisD, the DLL is copied into the output folder, the problem is my changes add a wwwroot folder with some assets.

So I added a copy feature in the .csproj of Stratis.Bitcoin.Features.Api to copy the wwwroot folder in the output, like this:

  <ItemGroup>
    <Content Update="wwwroot\**\*.*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

My question is, does this will be a problem ? and also if I rename the wwwroot folder in swagger by example.

imclint21 avatar May 24 '19 13:05 imclint21

About the Stratis Color codes, can have some precisions, I don't know if the color that I use is the good.

Fixed f8d062a19f43d87c6084e8578538f105cd6fbc73

imclint21 avatar May 24 '19 15:05 imclint21

Another point: Maybe we can display an information on the swagger about the network that is ran, if it's bitcoin network, stratis network etc

I said this because when I launch Stratis.StratisD or Bitcoin.BitcoinD I don't see any differences in the swagger.

imclint21 avatar May 27 '19 11:05 imclint21

@clintnetwork top of the page looks great, but bottom part little bit confused me.

@noescape00 what do you think?

kogot avatar May 28 '19 14:05 kogot

Yes yes, you right, the try out design is not finished, for now its less readable it's true.

In fact I made this PR to have a base and discuss about the direction to take. 👍

imclint21 avatar May 28 '19 15:05 imclint21

@kogot I agree with you. Let's see how it will look like once the design is done

noescape00 avatar May 28 '19 17:05 noescape00

Way better now from a readability perspective. Is it the final version?

kogot avatar May 30 '19 09:05 kogot

No no, we had some ideas with @dangershony to create a multipages swagger with an embedded wallet maybe or other features.

I also opened this PR to brainstorm about that.

imclint21 avatar May 30 '19 10:05 imclint21

@clintnetwork multipage can be done in following PRs, if you find a good stable swagger customized UI I say we can consider pushing it.

dangershony avatar May 30 '19 11:05 dangershony

I create a ResourceFileProvider to serve assets from resources because I get some issues using EmbeddedFileProvider, if someone can help me.

imclint21 avatar Jun 03 '19 22:06 imclint21

I had an old dashboard project for stratis and I was using EmbeddedFileProvider but a lot of time passed (more than 2 years!) here https://github.com/MithrilMan/Stratis.Bitcoin.Dashboard/blob/56c98c199b2ea873c13b69ae123c3fe53a761ed5/Stratis.Bitcoin.Dashboard/Startup.cs

what kind of problem did you have? try to take a look at the code if it may help you, otherwise I'll try to remember how I was using it

MithrilMan avatar Jun 03 '19 22:06 MithrilMan

Ha nice @MithrilMan just trying to use EmbeddedFileProvider to embed the wwwroot folder in resources and use it but I don't know why but it does not works, maybe you can fork my PR and try to implement EmbeddedFileProvider

imclint21 avatar Jun 04 '19 11:06 imclint21

@clintnetwork ok if I'll find the time I'll try that

MithrilMan avatar Jun 07 '19 15:06 MithrilMan

@MithrilMan are you on the slack ?

imclint21 avatar Jun 11 '19 11:06 imclint21