gabriel-dehan / dyson-sphere-blueprints

A community website to share dyson sphere program blueprints
47 stars 11 forks source link

DSP Blueprints

Community website to share Dyson Sphere Program blueprints.

Official website: https://www.dysonsphereblueprints.com

Table of content

Roadmap

See the roadmap/todo file

Changelog

Latest: 4.4.0

Previous versions

Find the rest in the CHANGELOG

Contribute

Pull requests are always welcome, if you want a copy of the production or staging database for development purposes (meaning all emails and passwords will be randomized, I am not just gonna give away personal information to whoever wants them), just send me an email or open a ticket and we'll see to that.

Setting up

Install ruby dependencies

bundle install

Install node dependencies

yarn

Then set up the database, either using docker or your own postgresql instance. Once done, you can run the migrations and create the database:

rails db:create db:migrate db:seed

If migrations are failing the first time, just re-run them again.

You should then be able to run the application:

rails s

Seeding

The main thing you'll need to setup is to create a Mod for the blueprints. Currently there are 3 mods in production, 2 are legacy and one is for the base game. A Mod contains a field version which is a JSON like that:

{
  "0.8.19.7662" => {
    "uuid4" => "0.8.19.7662-1627063708",
    "breaking"=>true,
    "created_at"=>"2021-07-23T18:08:28.644+00:00"
  }
}

breaking is used for the display of blueprints compatibility from one version of the mod / game to another. You can also go in lib/tasks/mod.rake and have a look at the tasks, those tasks were used to seed the mods in staging and production:

noglob rake 'mod:fetch_base_game_latest[0.8.19.7662]' # Forces a game version to be added
noglob rake 'mod:fetch_base_game_latest' # Fetches the latest game versions from the Steam News API
noglob rake 'mod:flag_breaking[Dyson Sphere Program, 0.8.19.7662]'

The task rake mod:fetch_latest used to be to retrieve MultiBuild version from the Thunderstore API but we don't need it anymore.

Environment

For proper development, you also will need a .env file at the root of the project. It needs to have the following environment variables:

DISCORD_CLIENT_ID=XXX
DISCORD_CLIENT_SECRET=XXX
AWS_S3_ACCESS_ID_KEY=XXX
AWS_S3_ACCESS_SECRET_KEY=XXX
AWS_S3_REGION=eu-west-1
AWS_S3_BUCKET=dyson-sphere-blueprints
AWS_CLOUDFRONT_URL=https://XYZ.cloudfront.net

Most of those are not needed to be able to work on most features, but if you want images to display and be able to upload images for instance you will need to setup an AWS S3 and Cloudfront. An example can be found in .env.sample

Build development environment

You can also build a development environment with docker compose.

Using the docker-compose.yml, will start the following services:

$ docker compose up -d

to connect each service, use these credentials:

The above configuration is written in .env.sample. You can simply copy it and it should be enough.

$ cp .env.sample .env

Rake tasks

There are a few rake tasks that you can use:

rake mod:fetch_base_game_latest[PATCH] # creates a new version in the DB, use like this: rake 'mod:fetch_base_game_latest[0.8.19.7662]'
rake blueprint:recompute_data # updates all blueprints summary if you have made any changes to it
rake mod:fetch_latest # currently legacy, but fetches the latest versions of all mods handled (MultiBuild and MultiBuildBeta)

Our lovely sponsors

Contributors

Deploy

This project is currently hosted on Heroku. Notes to self: rubocop-daemon start Make sure the Gemfile has the proper platforms set:

$ bundle lock --add-platform x86_64-linux

Staging

Copy prod DB to staging

heroku pg:backups:restore `heroku pg:backups:url --app dyson-sphere-blueprints` DATABASE_URL --app dyson-sphere-blueprints-stage

License

Important: this license only applies to the logic and application in itself and does not pertain to any data or assets coming from the game Dyson Sphere Program which is the intellectual property of Youthcat Studio.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004

Copyright (C) 2004 Sam Hocevar sam@hocevar.net

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

You just DO WHAT THE FUCK YOU WANT TO.