Source code for the Erlang.org website.
Setting up Erlang.org locally
Setting up Erlang.org using docker
Then connect to http://localhost:8080 and enjoy.
Use Erlang/OTP 18.3. Follow the instructions on https://github.com/kerl/kerl to install Erlang/OTP.
Edit and rename the file
rel/ops.config. It contains the configuration information and tells the application which port (by default
8080) to host the website on and which database to pull information from.
By default, Erlang.org connects to a PostgresSQL database called
erlang_org, using the username
postgres and password
Create a database
CREATE DATABASE erlang_org;
Import the sample data:
$ psql erlang_org < erlang_org_data
Run the following command to start the server:
$ make run
The website will be available at http://localhost:8080.
Since this project is built with sumo_db, it's code structure uses the repository pattern. Therefore, the code is organized in the following folders:
- handlers: In it you will find handlers for cowboy. For example,
erlang_docs_handleris the one used to serve the
- models: In this folder you will find sumo_db models and repos. For each entity in the system you'll find two modules:
- one of them represents the Abstract Data Type that models the entity (e.g.
erlorg_articlescontains all the functions that allow you to manipulate entities with type
erlorg_articles:article(), but there is no business logic in it). - the other one (with suffix
_repo) contains the business logic associated with the entity. For example, in
erlorg_articles_repoyou'll find functions to create, fetch, list, etc. entities with type
erlorg_articles:article(). These functions only manipulate the internal data for those entities using the functions in the
erlorg_articlesmodule. And they talk to the database using functions in the
sumo:persist/2to store objects.
- stores: In this folder you will find sumo_db stores. This is the place where database specific logic is written. Functions that are specific to the underlying persistence tool we're using (in this case postgreSQL) and not generic are written in
- utils: In this folder we have utility functions to deal with some non-sumo-specific datatypes like binaries, datetimes and cowboy requests.
For more documentation on SumoDB, you can check its hex.pm page and if you want to contribute to this project and you are unsure about where to put your code or how to write it don't hesitate to contact Inaka through their public hipchat room.
Copyright 2016 Industrial Erlang User Group Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.