websolutions/scaffold

The Laravel Framework.

v0.4 2018-09-04 14:44 UTC

This package is not auto-updated.

Last update: 2024-05-09 00:27:28 UTC


README

Installation Steps

  1. Require the Package

You can create your new Scaffold app with the following command:
composer create-project websolutions/scaffold test

  1. Add Google Credentials

Next make sure to create a Firestore project and add path to file with your service account credentials to .env file:

GOOGLE_APPLICATION_CREDENTIALS = "GCFSCredentials.json"

To get started with Cloud Firestore:
1. Create a Cloud Firestore project
-> Open the Firebase Console and create a new project.
-> In the Database section, click the Get Started button for Cloud Firestore.
-> Select a starting mode for your Cloud Firestore Security Rules - Locked mode.
-> Click Enable.
2. Set up your development environment
To authenticate from your development environment, set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to a JSON service account key file. You can create a key file on the API Console Credentials page after setting up a service account. Download the key file to your project and public folders.

You will also need to add Firebase credentials to your app.
Add Firebase API key to your .env file:

FIREBASE_API_KEY = YOUR_API_KEY

Add Firebase credentials to your resource/assests/js/app.js file:
let config = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
projectId: "<PROJECT_ID>",
storageBucket: ".appspot.com",
messagingSenderId: "<SENDER_ID>",
};

Add Firebase to your app
1. Select your Firebase project from the console.
To add Firebase to your app, you'll need a Firebase project and a short snippet of initialization code that has a few details about your project. 2. From the project overview page in the Firebase console, click Add Firebase to your web app.
3. Set up your development environment
Copy and paste your project's customized code snippet to your resource/assests/js/app.js file of your app and add FIREBASE_API_KEY to your .env file.
4. Dont forget to enable Firebase Authentication via email and password.
You can do this from the project overview page in the Firebase console

After you can run npm following commands:
npm install
npm run dev

  1. Run Seeders

Lastly, you can seed your Firestore project.
To do this simply run:
php artisan db:seed

Start up a local development server with php artisan serve. Visit http://localhost:8000/login and log into the system as admin with credentials:
email: admin@admin.com
password: 123456