Project status: Pre-production staging branch. Expect text content changes.
This branch contains the source for the next release of the MultiBit Production website.
Much of the groundwork for this website was put in place by Saivann Carigan - thanks from the MultiBit team!
From a technical point of view this project uses
- Java - Primary language of the app
- Maven - Build system
- Dropwizard - Self-contained web server
- HTML5 and CSS - All pages are simple HTML5
- LESS - LESS is compiled into CSS to provide succinct stylesheets
Why Dropwizard? We don't want the complexity that comes with an application server or an external servlet container. Dropwizard gives us the simplicity we crave.
We looked at Jekyll, and while it's a great technology, we found it a bit limiting for what we needed from our website.
We follow the "master-develop" branching strategy.
This means that the latest release is on the "master" branch (the default) and the latest release candidate is on the "develop" branch. Any issues are addressed in feature branches from "develop" and merged in as required.
If you are already familiar with Java and Maven you can skip ahead to the Build and Preview section.
Some of the technology used when building the site may be unfamiliar at first so you'll need to install some supporting code first. It should only take a few minutes and you'll be up and running.
If you intend to do a lot of work involving the underlying Java code you'll need an IDE. We recommend Intellij (best) or Eclipse. Both are available as free downloads.
If you just want to edit CSS and HTML you can do it all with a text editor and some console commands.
There are two ways to run up the project depending on whether you have access to a Java IDE or not.
Import the project as a Maven project in the usual manner.
To start the project you just need to execute SiteService.main()
as a Java application. You'll need a runtime configuration
that passes in server site-config.yml
as the Program Arguments.
Open a browser to http://localhost:8080/ and you should see the site.
Assuming that you've got Java and Maven installed you'll find it very straightforward to get the site running. Just clone from GitHub and do the following:
cd <project root>
mvn clean install
java -jar target/site-<version>.jar server site-config.yml
where <project root>
is the root directory of the project as checked out through git and <version>
is the version
as found in pom.xml
(e.g. "3.0.0") but you'll see a .jar
in the target
directory so it'll be obvious.
All commands will work on *nix without modification, use \ instead of / for Windows.
Open a browser to http://localhost:8080/ and you should see the site.
Nobody wants to waste time getting stuff done, so here are some processes that we follow to make changes to the site efficiently.
If you are running the application within an IDE do the following:
- Create a runtime configuration for
mvn generate-resources
call it "Maven Resources" - Start the
SiteService
process and leave it running continuously - For CSS, use Firebug/Developer Tools to preview the effect you're after then locate the
main.less
file and edit to accommodate your changes otherwise - For HTML just edit the appropriate file under
src/main/resources/views/html
- Run "Maven Resources" to compile
main.less
tomain.css
and copy all updated resources totarget
- Refresh your browser and verify that Dropwizard serves the resource as a 200 OK rather than 304 NOT MODIFIED if the change is not apparent
If you're running via the command line your workflow is unfortunately a little less efficient.
- Run up the site application as detailed in the earlier sections
- Use Firebug/Developer Tools to preview the effect you're after
- For CSS, use Firebug/Developer Tools to preview the effect you're after then locate the
main.less
file and edit to accommodate your changes otherwise - For HTML just edit the appropriate file under
src/main/resources/views/html
- Stop the site application process (CTRL+C)
- Run
mvn package
to rebuild with the newly generatedmain.css
- Restart with
java -jar target/site-<version>.jar server site-config.yml
- Refresh your browser to observe the change
Clearly an IDE is the better way to go if you think you will have a lot of editing work that will need an incremental approach.
Bitcoin is a global currency and so this site has many translations. If you'd like to contribute your own translation for the pages on offer please use this process:
- Find the two letter ISO 639-1 code for your language (fr, en, jp etc)
- Copy existing html files from
src/main/resources/views/html/{lang}/
according to your source language (e.g. you're a French to Japanese expert so base onfr
and copy tojp
) - Paste new html files to
src/main/resources/views/html/{lang}/
according to your target language - Repeat for image files in
src/main/resources/assets/images/{lang}
this is for language-specific screenshots that are applicable - Translate all
.html
and image files as required then issue a pull request
The following are for administrators of the site and don't affect most people.
Use src/main/resources/views/ftl/base.ftl
to change static elements like the alert and download version.
Before pushing to GitHub the site.xml
and atom.xml
files need to be regenerated. This is done by executing
the normal Maven build but adding a profile parameter as well:
mvn -DupdateWebSupport=true clean verify
The ASCII art for the startup banner was created using the online tool available at TAAG
Yes. All the code in this repo is under the MIT license so you are welcome to take it and go.
However, this implementation serves the MultiBit site so don't just clone this and run a mirror without first consulting us.
You may be interested in deploying Dropwizard applications on Heroku since their free instances are sufficient for most low to medium traffic sites and they integrate very well with git.
Raise an Issue through GitHub and we'll address it. Before diving in make sure that you've checked to see that the issue has not already been raised by another.