Skip to content

Neucore - Alliance Core Services

License

Notifications You must be signed in to change notification settings

tkhamez/neucore

This branch is 1560 commits behind main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

76e62d3 · Aug 10, 2019
Aug 10, 2019
Aug 4, 2019
Aug 10, 2019
Aug 4, 2019
Jun 23, 2019
Apr 6, 2019
Jul 6, 2019
Aug 10, 2019
Jun 22, 2019
Jun 22, 2019
Dec 26, 2017
Dec 26, 2017
Jul 28, 2019
May 5, 2019
Aug 4, 2019
Aug 4, 2019
May 12, 2019
Jun 22, 2019
Jun 22, 2019
May 5, 2019
Mar 30, 2019
Jul 6, 2019
Mar 30, 2019
Apr 29, 2019

Repository files navigation

Build Status Maintainability Rating

Neucore

An application for managing access for EVE Online players to external services of an alliance.

Table of Contents

Overview

Objectives:

  • Management of groups for players.
  • An API for applications to read these groups (and more).
  • Access to ESI data of all members.
  • Login via EVE SSO.

For more information, see the doc directory, including Documentation, an API overview, and some screenshots.

This project consists of two applications, the Backend and the Frontend.

A preview/demo installation is available at https://neucore.herokuapp.com.

Installation

EVE API Setup

App Setup

Server Requirements

  • PHP >=7.1.3 with Composer, see backend/composer.json for necessary extensions
  • Node.js >=8.12.0 with npm (tested with LTS versions 8 and 10, npm 6)
  • MariaDB or MySQL Server (tested with MySQL 5.7, 8.0 and MariaDB 10.3, 10.4)
  • Apache or another HTTP Server
    • Set the document root to the web directory.
    • A sample Apache configuration is included in the Vagrantfile file and there is a .htaccess file in the web directory.
    • A sample Nginx configuration can be found here docker-nginx.conf
  • Java 8+ runtime (only for openapi-generator)

If your're using the pre-build releases, you only need PHP, a Database and a HTTP Server (not Composer, Node.js or Java).

Install/Update

Clone the repository or download the distribution (the distribution does not require Composer, Node.js or Java).

Copy backend/.env.dist file to backend/.env and adjust values or set the required environment variables accordingly.

Make sure that the web server can write to the log and cache directories, by default backend/var/logs and backend/var/cache.

Please note that both the web server and console user write the same files to the cache directory, so make sure they can override each other's files, e. g. by putting them into each other's group (the app uses umask 0002 when writing files and directories).

If available, the app uses the APCu cache in production mode. This must be cleared during an update (depending on the configuration, restart the web server or php-fpm).

Archive file

If you downloaded the .tar.gz file, you only need to run the database migrations and seeds and clear the cache.

If you are using a different cache directory, you must first copy or generate the Doctrine proxy cache files:

cp -R backend/var/cache/proxies /path/to/your/cache/proxies
# or
cd backend
vendor/bin/doctrine orm:generate-proxies

Then execute (adjust cache path if necessary)

cd backend
rm -rf var/cache/di
vendor/bin/doctrine-migrations migrations:migrate --no-interaction
bin/console doctrine-fixtures-load
Git

If you have cloned the repository, you must install the dependencies and build the backend and frontend:

./install.sh
# or
./install.sh prod

Cron Job

Set up necessary cron jobs, e. g. 3 times daily (adjust user and paths):

0 4,12,20 * * * neucore /var/app/backend/bin/run-jobs.sh

The output is logged to backend/var/logs.

First login and Customization

Read the backend documentation on how to make yourself an admin, then you can navigate to "Admin" -> "Settings" and change texts, links and images that are specific to your installation.

Using Vagrant

Only tested with Vagrant 2 + libvirt.

  • vagrant up creates and configures the virtual machine.
  • If the Vagrant file changes, run vagrant provision to update the VM.
  • vagrant destroy will completely remove the VM.

Please note that the rsync synchronization method used is a one-way synchronization from host to virtual machine that is performed each time vagrant up or vagrant reload is executed. See https://www.vagrantup.com/docs/synced-folders for other methods.

The Vagrant setup will create the file backend/.env with correct values for the database connection. The values for the EVE application must be adjusted.

Using Docker

Create the backend/.env file.

Execute the following to start the containers and build the app:

$ export UID

$ docker-compose up -d

# Install backend
$ docker-compose run composer install
$ docker-compose run composer composer compile

# Generate OpenAPI JavaScript client
$ docker-compose run java /app/frontend/openapi.sh

# Build frontend
$ docker-compose run node npm install
$ docker-compose run node npm run build

# Install Swagger UI
$ docker-compose run node npm install --prefix /app/web

Browse to http://localhost:8080

Stop containers: docker-compose stop

Create database for unit tests

$ docker exec neucore_db sh -c 'mysql -e "CREATE DATABASE IF NOT EXISTS neucore_test" -pneucore'
$ docker exec neucore_db sh -c 'mysql -e "GRANT ALL PRIVILEGES ON neucore_test.* TO neucore@\"%\" IDENTIFIED BY \"neucore\"" -pneucore'

Known problems:

  • Unit tests that need the database don't work: "Aborted connection to db" errors.

Deploy on Heroku

You can deploy the application on a free Heroku account.

  • Create a new app
  • Add a compatible database, e. g. JawsDB Maria.
  • Add the necessary config vars (see backend/.env.dist file) and set the following:
    • BRAVECORE_LOG_PATH=php://stderr
  • Add build packs in this order:
heroku buildpacks:add heroku/java
heroku buildpacks:add heroku/nodejs
heroku buildpacks:add heroku/php

Final notes

Origin

The software was originally developed for the Brave Collective, when CCP shut down the old API and we had to replace our Core system.

This is also where the name "Neucore" comes from.

Related Software

Contact

If you have any questions or feedback, you can contact Tian Khamez on Tweetfleet Slack (get invites here).

TOC

Just a quick reminder to myself of how to generate the tables of contents:

npm install -g markdown-toc
markdown-toc README.md -i
markdown-toc doc/documentation.md -i
markdown-toc doc/API.md -i
markdown-toc backend/README.md -i
markdown-toc frontend/README.md -i