LUDevNet / lu-explorer

An angular.io webapp that displays LEGO Universe game data

Home Page:https://lu-dev.net/lu-explorer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LuExplorer

General

This project was generated with Angular CLI.

Prerequisites

  • git
  • npm to build the app
  • cargo to build the API server
  • A copy of a LEGO Universe client.

Development setup

Generally, LU-Explorer needs a datasource, which is provided by the Paradox Server. That server provides the data from the game database to the web interface, which makes it a core component of this app.

This needs a paradox.toml config file in the working directory – a minimal example is provided here. The most important part is to point the explorer_spa key to the docs folder in this repo and the cdclient and locale key to a copy of CDClient.fdb and locale.xml respectively.

  1. install npm and cargo (via https://rustup.rs)

  2. install the API server binary with

    $ cargo install --git https://github.com/Xiphoseer/lu-res-api-server.git --branch main
  3. Then, clone this repo and create lu-res and client folders next to it

    $ git clone https://github.com/Xiphoseer/lu-explorer.git
    $ mkdir lu-res client
  4. Put at least locale/locale.xml and res/cdclient.fdb from an LU client into this client folder

  5. You can now build the lu-explorer web-app continuously with

    $ cd lu-explorer
    $ npm install
    $ ng build --watch
  6. Finally, run the API server, which will also serve the web-app

    $ RUST_LOG=info paradox-server

For now, you need to restart that server whenever you change the lu-explorer source. (Issue #1)

Minimal setup

The alternative is to:

  1. point data.apiUrl in src/environments/environment.ts to an existing API server.
  2. point /lu-res in src/proxy.conf.json to a matching version of lu-res.

Then run

$ npm install
$ ng serve

Docker Setup

  1. Build: docker build -t paradox-server
  2. Deploy:

Replace the paths on the left of the mappings to reflect your system:

  docker run -it --rm \
    --name paradox-server \
    -e DOMAIN=your.domain.tld \
    -e USERNAME=<username> \
    -e PASSWORD=<password> \
    -v /path/to/client:/luclient \
    -v /path/to/cache:/cache/lu-res \
    -p 3030:3030 \
    paradox-server

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the docs/ directory. Use the --configuration production flag for a production build. For building to github pages also use --base-href=/lu-explorer/.

Usually, the ng build --configuration production command is used.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

About

An angular.io webapp that displays LEGO Universe game data

https://lu-dev.net/lu-explorer/


Languages

Language:TypeScript 74.1%Language:HTML 22.1%Language:CSS 3.5%Language:JavaScript 0.2%Language:SCSS 0.1%Language:Shell 0.0%