Giter Site home page Giter Site logo

cdev147 / mirlo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from funmusicplace/mirlo

0.0 0.0 0.0 12.49 MB

An open source audio distribution and patronage platform

Home Page: https://mirlo.space/

License: GNU General Public License v3.0

Shell 0.04% JavaScript 0.96% TypeScript 96.80% CSS 0.14% HTML 0.37% Dockerfile 0.09% Pug 1.60%

mirlo's Introduction

Mirlo

A RESTful API and client.

Main libraries:

Contributing

Download and install

For the API:

git clone <repository>
cd mirlo
cp .env.example .env
docker-compose up

Go to localhost:3000/docs and see the Swagger API docs.

This should run the seeding script by default. If it doesn't do so, you can add run the seed by running:

docker exec -it blackbird-api npx prisma db seed

For the client:

cd client
cp .env.example .env
yarn
yarn start

Background Jobs

Making changes to background jobs.

Changes in background jobs aren't detected. You'll need to restart the docker container for them:

docker-compose up -d --force-recreate --no-deps background

Workers (Uploading Music, Images, Etc)

If you want to upload music or upload images, you'll need a worker running.

docker exec -it blackbird-api node src/jobs/queue-worker.js run

NOTE: this is done automatically by the blackbird-background container in docker.

NOTE: In local development you can see the worker queue at /admin/queues on the server

Running migrations

Migrations will run automatically on docker-compose up. To make changes to the database, change the schema.prisma file and then run:

docker exec -it blackbird-api npx prisma migrate dev

If your typescript for prisma is ever out of date, you can re-generate it with:

docker exec -it blackbird-api npx prisma generate

Stripe

By default Mirlo uses Stripe as its payment processor.

NOTE: Every 90 days you'll have to re-log-in to the stripe CLI with stripe login

To test webhooks, you'll have to run this:

stripe listen --forward-to localhost:3000/v1/webhooks/stripe

This will forward all stripe webhooks to your localhost:3000, and send them to the checkout/webhook URL. It'll also spit out a STRIPE_WEBHOOK_SIGNING_SECRET. You'll need to set that in the .env file.

Then to trigger a specific workflow:

# this is what's needed to store a subscription
stripe trigger checkout.session.completed --add checkout_session:metadata.userId=3 --add checkout_session:metadata.tierId=2

You'll also want fake Stripe data. You can find the details on that here.

CRON Jobs

Some cron jobs exist:

docker exec -it blackbird-api yarn ts-node src/jobs/every-minute-tasks.ts

MinIO

You can access dev MinIO at localhost:9001 with the MINIO_ROOT_USER and MINIO_ROOT_PASSWORD you set in .env

Database

If you want to do logging in the database, you need to uncomment the log line in the prisma/prisma.ts file.

Tests

See the test/README.md instructions.

Apple Chip Errors w/ Docker

If you get errors when running the backbird-api and blackbird-background service like Error relocating /usr/lib/libgcc_s.so.1: unsupported relocation type 7, you'll need to follow these steps.

  1. In terminal run softwareupdate --install-rosetta
  2. In Docker Desktop, go to Settings -> General and ensure Use Rosetta for x86/amd64 emulation on Apple Silicon is checked.
  3. Delete any previously created images
  4. Run DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose up

Credits

A lot of the code here was originally written for the Resonate API and UI

mirlo's People

Contributors

louislouisekay avatar simonv3 avatar timglorioso avatar dependabot[bot] avatar cdev147 avatar chickensoupwithrice avatar bentooth avatar

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.