Git Product home page Git Product logo

builder-server-master's Introduction

Builder Server

Exposes endpoints for the Builder.

RUN

Check .env.example and create your own .env file. Some properties have defaults.

#Create database (Only the first time)
createdb <DatabaseName>

# Update env. The DEFAULT_USER_ID is important

# Update state
npm i
npm run migrate up

# Only once
npx ts-node ./scripts/parseS3Pools.ts
npx ts-node ./scripts/updateProjectThumbnails.ts

# On each asset pack change
npm run seed

# Start
npm start

Rewrites to S3

Also S3 but behind auth

Take into account that /v1/ correspond to the version that you specify in the file .env with API_VERSION

S3 structure

projects
|____PROJECT_ID
| |____manifest.json
| |____pool.json
| |____east.png
| |____north.png
| |____preview.png
| |____south.png
| |____thumbnail.png
| |____west.png
asset_packs
|____ASSET_PACK_ID.png
contents
|____HASH1
|____HASH2
|____HASH3

#Extra Info If you are usign windows subsystem, you will need to start the postgresql service each time

sudo service postgresql start

Running external services locally with Docker Compose

If you have docker running on your machine and want to have external dependencies running locally on your machine, you can use the docker-compose file present in the repo to do it in a simple and centralized way and avoid the hassle of configuring each one of them independantly.

First, run all services simultaneously with:

docker-compose up -d

-d or --detach will run the processes on the background instead of running on the terminal which executed the command. You can ignore this flag if you don't care about it.

Before running the builder-server, make sure that the following .env variables are set correctly so the services run by docker-compose work as expected.

CONNECTION_STRING='postgres://admin:password@localhost:5432/builder-server'
AWS_ACCESS_KEY=admin
AWS_ACCESS_SECRET=password
AWS_BUCKET_NAME=builder-server
AWS_STORAGE_URL=http://localhost:9000

You can then run the builder-service normally as instructed in RUN

This method also provides some utilities to facilitate developer experience with a database viewer that can be accessed in http://localhost:8080, as well as an object storage viewer in http://localhost:9001 .

builder-server-master's People

Contributors

fancygeekguru avatar

Watchers

JTTech avatar

builder-server-master's Issues

Clear Collection issue

I am using mongodb 4.7.0 in my package.json
"mongodb": "^4.7.0",

but when I try to clear collection, by using remove, it doesn't work.
what's wrong? This is my code.

  const dbConnect = dbo.getDb()
  dbConnect
    .collection(req.query.collection_name)
    .remove()
    .then((data) => {
      res.status(200).send(data)
    })
    .catch((error) => {
      res.status(400).send(error)
    })

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.