- Assuming you will run in a webserver either on windows (XAMPP/WAMPP/etc) or on Linux where you already have a webserver installed there (Apache2/NGINX/etc).
- PHP - via your webserver
- Mysql - via your webserver
- Node.JS - if you don't have it, you can download it right here.
- Composer - PHP Dependency Manager, if you don't have it, you can download it right here.
- clone this repo (
git clone https://github.com/ereztdev/sia.git
) into your webserver - switch into the repo directory where you pulled the repo: (
cd sia
) - Install PHP dependencies (
composer install
) - environment:
- In the project root, you will have to create an
.env
environment file:cp .env.example .env
- in MySQL create a database and fill out that DB name here (
DB_DATABASE
), do the same for the DB username and password - Fill in your client-id/secret's for google and github OAuth2 apps, if you don't have the ability to create one feel free to contact me, and I'll send you mine.
- In the project root, you will have to create an
- Now our environment is set. Let's go ahead and seed our database, run
php artisan migrate
. - Also, let's seed into our DB our first integer (default 1), run
php artisan db:seed --class=IntegerInitSeeder
- Since we are using AES-256 encryption to generate keys for users to access our API, I chose passport as my keymaker.
Run
php artisan passport:install
to create the keymakers. - Install Node dependencies, run
npm install
. - To finish up, build the Vue.js instance, run
npm run dev
for dev environment, ornpm run prod
for production. - run
php artisan serve
and now you can access the webapp athttp://localhost:8000
.
Registers the user via the API
Attributes To Send
- name <string>
- email <string|email>
- password <string>
- password_confirmation <string>
{
"user": {
"name": string,
"email": string,
"updated_at": string,
"created_at": string,
"id": int
},
"access_token": string
}
Login the user via the API
Attributes To Send
- email <string|email>
- password <string>
{
"user": {
"name": string,
"email": string,
"email_verified_at": string,
"google_id": string,
"github_id": string,
"updated_at": string,
"created_at": string,
},
"access_token": string
}
Returns the current integer
Attributes To Send
- Authorization token <string|"Bearer ">
{
"success": bool,
"data": {
"id": int,
"integer": int,
"created_at": string,
"updated_at": string
},
"message": "success"
}
Returns the next integer
Attributes To Send
- Authorization token <string|"Bearer ">
{
"success": bool,
"data": {
"id": int,
"integer": int,
"created_at": string,
"updated_at": string
},
"message": "success"
}
Returns the updated integer
Attributes To Send
- Authorization token <string|"Bearer ">
- updated_integer <int>
{
"success": bool,
"data": {
"id": int,
"integer": int,
"created_at": string,
"updated_at": string
},
"message": "success"
}