Name: alpha
Owner: BBC
Description: The alpha.bbc platform
Created: 2017-06-15 12:59:15.0
Updated: 2017-10-11 08:58:23.0
Pushed: 2017-09-19 00:22:47.0
Size: 61
Language: Makefile
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
The alpha.bbc platform.
BBC Alpha is a platform which is intended to do a number of things:?
There are no plans for a “BBC Beta” at this time.
This is an experiment, and it may fail completely.
You will need:
mod_php5
, but other servers such as Lighttpd and Nginx ought to work fine if appropriately configured.All of the above can be installed on most Linux distributions using your system's package manager.
On macOS, Apache and PHP 5 are provided out of the box (see this article for instructions on enabling Apache), but Autoconf, Automake, and their own dependencies will require installation?either by building from source, or by using distributions such as MacPorts.
Alpha uses GNU Autoconf and Automake, a build system which has is very popular throughout the Unix world for distributing open source software, because the scripts and Makefiles it generates have minimal external dependencies and can be updated easily using tools available in nearly every distribution in common use. Autoconf and Automake also ensure that packaging is straightforward, because it supports well-known configuration parameters and things like the DESTDIR
variable for installing to a staging root.
If you?re going to build a Git clone, you will need to perform slightly different inital steps to if you?re working with a distribution tarball:
t clone https://github.com/bbc/alpha
alpha
t submodule update --init --recursive
toreconf -i
whereas if you've downloaded a tarball:
r zxvf /path/to/alpha-X.Y.Z.tar.gz
alpha-X.Y.Z
Then, you can invoke the configure
script, and build the tree:
configure
ke
Finally, you can install a built tree to a local directory (defaulting to /opt/bbc/share/alpha
):
do make install
You can alter the installation prefix by providing the usual Autoconf options:
configure --prefix=/usr
ke
do make install
Alpha has some specific options for overriding its installation paths (see also Serving Alpha
, below):
Option | Meaning
———————–|——————————————————-
--with-webdir
| Install web-facing resources to the provided path instead of ${prefix}/share/alpha
--with-componentsdir
| Install bundled components to the provided path instead of ${webdir}/components
--with-staticdir
| Install static resources to the provided path instead of ${webdir}/static
Note that where command-line tools or daemons are built, they will be installed to ${bindir}
, ${sbindir}
, and so on: that is, their installation locations will be affected by --prefix
, but not by the above three options.
To aid in development, a built tree can be served directly, simply by pointing a virtual host at the experience/public
directory. The build logic creates symbolic links within the tree to ensure that the web server can find the right resources in the right locations. If they don?t exist already, the build logic will also create config.php
files for you so that you can serve the site straight away. A sample configuration for Apache 2.x is provided in experience/config/apache2.conf
, and contributions of similar configurations for other web servers are welcome.
If you run sudo make install
from the top-level directory, by default Alpha will install to /opt/bbc/share/alpha
, which will contain three key subdirectories, amongst others:
public
contains the Experience Layer document root
static
contains the Experience Layer static resources
components
contains any components, each of which has its own public
and static
directories.
You can use symbolic links or mod_alias
(or your web server?s equivalent) to serve all three sets of resources from a single virtual host?this is the way that the source tree is arranged once it?s been built.
You can serve any combination of the three on separate virtual hosts, or even physical hosts?just ensure that the config.php
files are updated to specify the correct STATIC_ROOT
and COMPONENTS_ROOT
definitions.
By default the static resources for each component are bundled into the component directory itself. If you specify --with-staticroot=/path/to/directory
when you invoke the configure
script, all of the static resources will be installed into this directory instead of their normal locations.
You might then choose, for example, to serve all of these static resources from a low-specification virtual machine or an Amazon S3 bucket, with suitable caching in front of them.
The Alpha architecture consists of several layers:
The experience layer is responsible for HTML page generation and fetching data from the service layer in order to do that.
Generated pages include server- or edge-side includes (SSIs and ESIs), depending upon configuration, which are calls to the component layer to generate page fragments based upon specific fragments.
The experience layer includes templates for the different kinds of pages that Alpha serves: for example, there?s a template for clips, another for news stories, one for the homepage, and so on.
Components are small, focussed services whose purpose is to generate page fragments which can be incorporated into an Alpha web page either through server-side incudes (SSIs) or edge-side includes (ESIs).
An example of a component is the BBC Media Player, which is used by News, iPlayer, and so on to provide audio and video playback in the browser. By encapsulating it as a component, the page template doesn?t have to worry about embed codes, and so on?instead, it can provide the programme ID (PID) to the media player component and incorporate whatever HTML it returns. If we then wish to try out an alternative media player?for example one which provides virtual reality capabilities?we can do that within Alpha by switching to a different component on those pages with minimal complication.
Components can be written in any language, provided they have an endpoint which will emit HTML page fragments in response to an HTTP request.
An example (written in PHP) can be found in the boilerplate component.
The service layer already exists at the BBC, and it powers the live BBC Online site, as well as the various mobile and digital TV apps. Alpha re-uses these existing services in order to be able to serve the same content to users as BBC Online does today.
Examples of existing services include PIPs (which keeps track of programme information), Electron (which looks after content-managed pages), and CPS (the BBC News content management system).
Bug reports and feature requests relating to Alpha specifically should be filed via Github issues.
Please do not file requests asking about programmes, news reporting, or similar: they're not specific to BBC Alpha, and the team has no control over these sorts of things.
Issues with the live BBC Online site should be submitted using the How can I report a technical fault on BBC Online?
links.
This project has been released by the BBC as open source software. A team within the BBC is responsible for its day-to-day maintenance, but contributions from others are welcome.
If you?d like to contribute to Alpha, fork this repository and commit your changes to the
develop
branch.
For larger changes, you should create a feature branch with a meaningful name, for example one derived from the issue number.
Once you are satisfied with your contribution, open a pull request and describe the changes you?ve made and a member of the development team will take a look.
This is an open source project which is actively maintained and developed by a team within Design and Engineering. Please bear in mind the following:?
Except where otherwise stated, this project is licensed under the terms of the Apache License, Version 2.0