Skip to content

Shoutz0r/backend

Repository files navigation

Shoutz0r (Backend)

License CodeFactor Security Rating Maintainability Rating

  1. Introduction
  2. Development
  3. Composer commands
  4. Building & Using the docker container
  5. Kindly Supported by
  6. Sponsor this project

Introduction

This is the backend of Shoutz0r, consisting of both the API and the Worker.

Built using Laravel, GraphQL (Lighthouse) & Apollo.

API Docs can be found over at shoutzor.com.
Documentation has yet to be written. Feel free to ask any questions in the discussions.

Development

The steps listed below assume you have PHP installed locally and are using a linux-based workspace environment.

Install Shoutz0r

  1. Open your .env file
    • Set APP_KEY: Run php artisan key:generate --show and put the generated output here
    • change DB_HOST to 127.0.0.1 (there's a known-issue where localhost will cause the connection to fail)
    • change REDIS_HOST to 127.0.0.1 or localhost
  2. Run docker compose -f docker-compose.yml -f docker-compose.dev.yml up mysql redis and wait for MySQL to become ready.
  3. Run composer install to install all dependencies of the backend.
    • If you already did this before, you can skip this step.
  4. In a separate terminal run composer install-shoutzor-dev.
    • If you want to reinstall shoutzor, you can run composer fresh-install-shoutzor-dev instead
      (⚠️ WARNING ⚠️ This will drop ALL TABLES!)
  5. If the installation completes, open your .env and change:
    • DB_HOST back to mysql
    • REDIS_HOST back to redis
  6. You can now go back to the running docker compose command and hit CTRL + C to shut down those containers.

Run Backend containers

To start the full backend, you can now run docker compose -f docker compose.yml -f docker compose.dev.yml up

  • Building the images might take a while

  • This will start all required services for the backend and worker to function. After those have started, the backend and worker will be started too.

  • The backend and worker will be watching for changes and restart automatically.

  • For production environments you can run docker compose up instead. (Assuming Shoutz0r has been installed)

Composer commands:

Command Explanation
composer install-shoutzor Installs shoutzor for production environments
composer fresh-install-shoutzor ⚠️ Drops all tables, then installs shoutzor for production environments
composer install-shoutzor-dev Installs shoutzor for development environments (adds mock data)
composer fresh-install-shoutzor-dev ⚠️ Drops all tables, then installs shoutzor for development environments (adds mock data)
composer add-mock-data Generates and adds mock data to the database using DevelopmentSeeder

Kindly supported by

Sponsor this project

Shoutz0r is being developed entirely in my spare time.
If you like this project, please consider sponsoring it using the button in the sidebar of this repo (or click here ).
Every little bit helps to buy me a beer or pizza, which keeps me going!

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages