Giter VIP home page Giter VIP logo

betkudos-backend's Introduction

Crypto SportsBook

Installing

To get the project running you will need to install the dependencies and also run the database seeders.

This project was built on top of Laravel Framework and uses Laravel Sail for development environment.

Project dependencies

  • PHP 8.0 or higher
  • composer 2.0 or higher
  • Docker
  • docker-compose
  • Nodejs + yarn

Firstly you will need to install the composer dependencies by running the command bellow:

composer install

Then we will install NPM dependencies, which will allow Laravel Octane to reload the server workers on file changes by using Chokidar. To do so we will use yarn to install the dependencies.

yarn

Now you will need to create a .env file with all the required environment vars. You can just make copy from .env.example and fill the new .env file with the right values.

Database vars on .env.example are already ready for using Laravel Sail, so you will don't need to change this

To make a copy you can just run:

cp .env.example .env

Once all dependencies have been installed and .env filled with the right values we will generate our application key required by Laravel by running:

php artisan key:generate

Now we will run Laravel Sail to build the containers and get them running. To get more info about Laravel Sail check the docs

First, make the sail file executable

sudo chmod +x ./sail

and then run the containers

./sail up

Or to run the containers in detached mode use this instead:

./sail up -d

if you want to stop the containers (in detached mode) run the following

./sail down

Database Setup

Now all containers should be up and running, then it's time to run the database seeders and insert all the data the project needs to work as expected. As mentioned above you don't need to define database env vars to use Sail if you make a copy from .env.example. So you just need to run the migrations.

First, you should migrate the database tables:

./sail artisan migrate

If everything worked as expected you should now run the database seeders. The command bellow will run the /database/seeders/DatabaseSeeder.php file which will insert all the data needed.

./sail artisan db:seed

Now we have everything we need on our database.

Laravel Passport

All the authentication flow Login/Register was built on top of Laravel Passport which is a package to build API authentication with OAuth2. To get the authentication working you will need to create the Laravel Passport password client which will be used on our authentication flow from the SPA.

To create the Passport password client you should run the following command:

./sail artisan passport:client --password

Now you should fill the PASSPORT_PASSWORD_CLIENT_ID and PASSPORT_PASSWORD_CLIENT_SECRET vars on your .env file with the result of the command above. The PASSPORT_PASSWORD_CLIENT_ID value should be 1 if you are creating a fresh database.

betkudos-backend's People

Contributors

altrusl avatar

Stargazers

 avatar  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.