Code Monkey home page Code Monkey logo

elite-backend's Introduction

elite-backend

A project to provide open source way to play with Elite: Dangerous market data, ships and mod locations and ideally create a meta-platform that will be easy to use and re-use for all developers, so they can just focus on writing the app of their dreams, and not waste time on redoing what already was done. If time allows I also want to write a simple website to do provide users with simple web interface to common functions like finding commodity, traderoute, ships etc.

This of course is far road away, but certainly reachable within a reasonable timeframe. In the end, it's just data and representing it in REST way that is easy to extend and deploy + writing integration with existing sources.

Live demo

Live version of master branch of this code can be found at http://elite.x20x.co.uk/. Anonymous users have read access and so far write access is restricted to registered users.

Set-up steps

Dependencies

Installation

Vagrant (1.5+ required)

  1. Copy settings.py.template as settings.py and make sure to input your SQL details in approperiate place. I highly advise against running db on the same, tiny, vagrant box.
  2. Command to buid and provision the box is vagrant up
  3. When it is done the service should be reachable at your localhost on port 9191, if it isn't - it will be on the virtual boxes IP (depends on how is network configured on your end).

Optional - import the data (skip if you already have populated database)

  1. Populate the database with commands vagrant ssh -c "python3 /opt/elite-backend/manage.py migrate" and vagrant ssh -c "python3 /opt/elite-backend/manage.py refreshdata". This WILL take a while, how longexactly depends primarily on performance of your SQL server (very insert-heavy operation).

Manual installation (for those hailing from 20th century)

  1. Install python dependencies by running pip install -r requirements.txt.
  2. Copy settings.py.template as settings.py and make sure to input your SQL details in approperiate place.
  3. Run database migration with command python manage.py migrate
  4. Populate the database with command python manage.py refreshdata. This WILL take a while, how long exactly depends primarily on performance of your SQL server (this is very insert-heavy operation).
  5. Optionally you can also run tests, to do so use command python manage.py test

Running and usage

Once everything is set up and shining, then all left to do is to type python manage.py runserver and it's alive! When you steer to the bound ip and port, you will find that at /api there is a neat web-interface that allows for easy browsing of the API structure and data. You can also manipulate it from django admin (/admin).

Master branch points at latest release point. If you want most recent version then feel free to pull from dev branch, which is copied over to master when milestone is reached.

Commands

urltest

manage.py urltest [options] is command for testing all generated urls (including dynamically generated). Options:

  • -q - allows for quick testing urls. Command will return exit-code 2 after first encounter dead url
  • -t - allows to specify how many times potentially broken url will be re-checked before considered dead.
  • -m - allows to choose model from which urls for testing will be generated

Issues? Grievances? Complains? Feature requests? Ideas?

Please leave them at github or contact me by email.

Credits

I always give credit where it's due, so it's worth to mention couple projects.

elite-backend's People

Contributors

laszlowaty avatar

Stargazers

Aida Paul avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

laszlowaty

elite-backend's Issues

Abaility to set ship layouts

We already got the schemas for ships and models, now we need a way to apply one to another. With this we should also assign default layout for each ship

Filtering for urltester

It would be mighty helpful to be able to specify what do we want to test with urltester, for example we may want to test only handful of models, not all of them, which will make it run faster and thus it will be more useful during development

OSError(99, 'Cannot assign requested address')

There is nasty error. While trying to check huge number of urls using few threads(5) and after a while i get error:

('Connection aborted.', OSError(99, 'Cannot assign requested address'))

It happens when program is trying to make:
requests.get(url).status_code
Lines: 82 and 99

Automate the build with vagrant

Lets step up the set-up and integrate it with vagrant so building it clear will be as easy as vagrant destroy and vagrant up.

Refactor refreshdata

Apparently django comes with very cool get_or_create function on their models, lets abuse that as we can remove most of the private functions with it.

Commodity finder

A start on road to trade-finding tool, find specific commodity for starting station given.

Basic test suites

Right now there are no real tests going on which is unnaceptable - how are we supposed to know whether it works or not? Some basic tests are in need, at the very least a runner that will click through all possible links (including dynamicly generated ones).

System display

A simple django app inside of this project that will consume our own api in order to display details of a system and stations in it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.