1
0
mirror of https://github.com/barthuijgen/factorio-sites.git synced 2024-12-04 10:44:44 +02:00
factorio-sites/apps/blueprints
2021-04-23 10:12:02 +02:00
..
prisma Feat: improve blueprint creation, add comments to blueprints 2021-04-22 22:26:43 +02:00
public Change white to transparency in favicon (#97) 2021-04-09 11:28:34 +02:00
specs feat: enable deployment to prd from github action, fix unit tests 2021-04-01 14:44:22 +02:00
src chore: Remove debug logging, move cf beacon to header 2021-04-23 10:12:02 +02:00
.babelrc Add FBE editor for in-browser image rendering, ported database to postgres, updated packages 2021-01-10 22:03:07 +01:00
.eslintrc.json chore: upgrade packages, added next eslint rules 2021-03-30 23:41:54 +02:00
babel-jest.config.json initial commit 2020-10-16 19:37:34 +02:00
gcp-storage-cors.json feat: create build action for production, add configurable public url 2021-04-01 14:09:58 +02:00
index.d.ts Added several ways of generating images, factorioprints scraper and a lot of updates to the main site 2020-10-22 15:53:06 +02:00
jest.config.js jest and test updates 2021-03-20 22:31:48 +01:00
next-env.d.ts Add FBE editor for in-browser image rendering, ported database to postgres, updated packages 2021-01-10 22:03:07 +01:00
next.config.js Change csp to report only 2021-04-17 13:04:15 +02:00
README.md chore: Linting fixes 2021-03-29 00:11:42 +02:00
tsconfig.json chore: nx migrate latest 2021-03-30 23:21:54 +02:00
tsconfig.spec.json initial commit 2020-10-16 19:37:34 +02:00

Blueprints application

Setting up the project

  • Add a .env.local file to apps/blueprints/ with the following values
POSTGRES_DB=factorio-blueprints
POSTGRES_USER=factorio-blueprints
#POSTGRES_HOST=127.0.0.1
#POSTGRES_PASSWORD=local
STEAM_WEB_API_KEY=(optional, for steam login)
GOOGLE_APPLICATION_CREDENTIALS="full/path/to/json-key-file.json"
GCP_BLUEPRINT_STRINGS_BUCKET=blueprint-strings
GCP_BLUEPRINT_IMAGES_BUCKET=blueprint-images
  • Add a .env file to apps/blueprints/prisma with a database connection url like
DATABASE_URL="postgresql://factorio-blueprints:local@127.0.0.1:5432/factorio-blueprints"
  • Run DB migration
cd apps/blueprints && npx prisma migrate deploy --preview-feature
  • Run local app
nx serve

Deploying

  • docker build -t eu.gcr.io/factorio-sites/blueprints --file blueprints.Dockerfile .
  • docker tag eu.gcr.io/factorio-sites/blueprints eu.gcr.io/factorio-sites/blueprints:dev
  • docker push eu.gcr.io/factorio-sites/blueprints

Google cloud environment

If deploying nextjs assets to google storage, set cors options gsutil cors set ./gcp-storage-cors.json gs://bucket_name