Sign inSign up

redirhub/composer

By redirhub

Updated over 2 years ago

Image
0

1.2K

redirhub/composer repository overview

Backend

branches for
main for production
staging for previewing
develop for dev & test
create new branch for new features

Getting started

Installation

Please check the official laravel installation guide for server requirements before you start. Official Documentation

Alternative installation is possible without local dependencies relying on Docker.

Install all the dependencies using composer

composer install

Copy the example env file and make the required configuration changes in the .env file

cp .env.local .env

Import sql file to your database

dashboard.sql

Docker(Based on Laravel Sail)

To install with Docker, run following commands:

cp .env.local .env
docker run -v $(pwd):/app composer install
sail up -d

The dashboard can be accessed at http://redirhub.test/try_demo.

API Specification

Open API Specification 3


Code overview

Folders

  • app - Contains all the Eloquent models and basic framework
  • modules - Contains the files implementing the modules feature
  • config - Contains all the application configuration files
  • database/factories - Contains the model factory for all the models
  • database/migrations - Contains all the database migrations
  • database/seeds - Contains the database seeder
  • routes - Contains all the api routes defined in api.php file
  • tests - Contains all the application tests
  • tests/Feature/Api - Contains all the api tests

Environment variables

  • .env - Environment variables can be set in this file

Note : You can quickly set the database information and other variables in this file and have the application fully working.


Testing API

Run the laravel development server

php artisan serve

The api can now be accessed at

http://localhost:8000/api

Request headers

RequiredKeyValue
YesContent-Typeapplication/json
YesX-Requested-WithXMLHttpRequest
OptionalAuthorizationToken {JWT}

Refer the api specification for more info.


Authentication

This applications uses JSON Web Token (JWT) to handle authentication. The token is passed with each request using the Authorization header with Token scheme. The JWT authentication middleware handles the validation and authentication of the token. Please check the following sources to learn more about JWT.


Cross-Origin Resource Sharing (CORS)

This applications has CORS enabled by default on all API endpoints. The default configuration allows requests from http://localhost:3000 and http://localhost:4200 to help speed up your frontend testing. The CORS allowed origins can be changed by setting them in the config file. Please check the following sources to learn more about CORS.

Tag summary

Content type

Image

Digest

sha256:037e08459

Size

134.2 MB

Last updated

over 2 years ago

docker pull redirhub/composer