Skip to content

Microservice to hold all assets information of your application

Notifications You must be signed in to change notification settings

ldmarz/ms-assets

Repository files navigation

API Template

Team Chat MIT License Continuous Integration Swift 4.1

ms-assets is a Vapor 3 based microservice to hold all assets information of your application using Minio, so you can select your storage provider

Assets workflows

  • Upload file using PreSignedURL WorkFlow

Swift 4.1

Installation 📦

  • Go to the root folder and run the next command
    $ vapor build
  • Create a database PostgreSQL we are using docker for this
    $ docker run --name postgres -e POSTGRES_DB=assets -p 5432:5432 -e POSTGRES_PASSWORD=123456 -d postgres
  • Create a minio instance
// We recommend to generate your own keys
$ docker run -p 9000:9000 --rm --name minio1 \
  -e MINIO_ACCESS_KEY="36J9X8EZI4KEV1G7EHXA" \
  -e MINIO_SECRET_KEY="ECk2uqOoNqvtJIMQ3WYugvmNPL_-zm3WcRqP5vUM" \
  -v ~/Documents/minion-data/data:/data \
  -v ~/Documents/minion-data/config:/root/.minio \
  minio/minio server --config-dir /root/.minio /data
  • Duplicate the .env.TEMPLATE to .env and set your values
    $ cp .env.TEMPLATE .env

Running the project 🚀

  • Go to the root folder and run the next command
    $ vapor run

Documentation 📄

The documentation for this microservice its written using Swagger

There are two ways to use:

Docker use:

  • Create a database PostgreSQL we are using docker for this
    $ docker run --rm -p 8081:8080 swagger API/swagger-ui
  • With the application running you can use http://localhost:8080/docs/swagger.yml in the swagger input to get the docs

Docker hub:

  • Get the documentation in http://localhost:8080/docs/swagger.yml
  • Paste documentation into https://app.swaggerhub.com

Running the tests

We recommend run tests with xcode

Note: In order to test works correctly you must have the minio and database configured

About

Microservice to hold all assets information of your application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published