Skip to content

Latest commit

 

History

History
83 lines (52 loc) · 3.42 KB

readme.md

File metadata and controls

83 lines (52 loc) · 3.42 KB

PHPLaravelGymManagementSystem 2.0

A simple and yet easy to install gym management system built with Laravel 5.5 and ReactJS

  1. package management.
  2. members managements.
  3. services and activities.
  4. more

For professional support please email me at johndavedecano@gmail.com

Installation

  1. Initial setup
$ git clone git@github.com:johndavedecano/PHPLaravelGymManagementSystem.git project
$ cd project
$ composer install
$ cp .env.example .env # THEN EDIT YOUR ENV FILE ACCORDING TO YOUR OWN SETTINGS.
$ php artisan migrate
$ php artisan db:seed
$ php artisan serve
  1. have a coffee, nothing to do here;

Usage

I wrote a couple of articles on this project that explain how to write an entire sample application with this boilerplate. They cover the older version of this boilerplate, but all the concepts are the same. You can find them on Sitepoint:

Just be aware that some options in the config/boilerplate.php file are changed, so take a look to it.

WARNING: the articles are old and Laravel 5.1 related. Just use them as "inspiration". Even without updated tutorials, they should be enough.

You don't have to worry about authentication and password recovery anymore. I created four controllers you can find in the App\Api\V1\Controllers for those operations.

For each controller there's an already setup route in routes/api.php file:

  • POST api/auth/login, to do the login and get your access token;
  • POST api/auth/refresh, to refresh an existent access token by getting a new one;
  • POST api/auth/signup, to create a new user into your application;
  • POST api/auth/recovery, to recover your credentials;
  • POST api/auth/reset, to reset your password after the recovery;
  • POST api/auth/logout, to log out the user by invalidating the passed token;
  • GET api/auth/me, to get current user data;
  • and more...

A Separate File for Routes

All the API routes can be found in the routes/api.php file. This also follow the Laravel 5.5 convention.

Secrets Generation

Every time you create a new project starting from this repository, the php artisan jwt:generate command will be executed.

Configuration

You can find all the boilerplate specific settings in the config/boilerplate.php config file.

Creating Endpoints

You can create endpoints in the same way you could to with using the single dingo/api package. You can read its documentation for details. After all, that's just a boilerplate! :)

However, I added some example routes to the routes/api.php file to give you immediately an idea.

Tests

If you want to contribute to this project, feel free to do it and open a PR. However, make sure you have tests for what you implement.

In order to run tests:

  • create a homestead_test database on your machine;
  • run phpunit;

If you want to specify a different name for the test database, don't forget to change the value in the phpunix.xml file.

Feedback

I currently made this project for personal purposes. I decided to share it here to help anyone with the same needs. If you have any feedback to improve it, feel free to make a suggestion, or open a PR!