https://github.com/sagnikrivud/google-drive-importer
Google drive media import through public shareable URLs
https://github.com/sagnikrivud/google-drive-importer
api lumen-framework mysqli php8
Last synced: 12 months ago
JSON representation
Google drive media import through public shareable URLs
- Host: GitHub
- URL: https://github.com/sagnikrivud/google-drive-importer
- Owner: sagnikrivud
- License: mit
- Created: 2024-03-27T05:23:41.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T10:17:10.000Z (about 2 years ago)
- Last Synced: 2025-01-14T18:11:38.391Z (over 1 year ago)
- Topics: api, lumen-framework, mysqli, php8
- Language: PHP
- Homepage:
- Size: 242 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Google Drive Media Uploader (Public share URLs)

### Version

## Compatibility
- [PHP (8.0)](https://reintech.io/blog/installing-php-8-on-ubuntu-22)
- [Composer (2.0)](https://getcomposer.org/download)
- [Lumen (10.0)]()
- [Apache or Nginx](https://ubuntu.com/tutorials/install-and-configure-apache#2-installing-apache)
- [Mysql](https://dev.mysql.com/doc/mysql-getting-started/en/)
## Setup & Installation
> Clone the repo
```sh
$ git clone https://github.com/sagnikcapital/Google-Drive-Up-loader.git
```
> Create .env file
```sh
$ cp .env.example .env
```
> Composer install
```sh
$ composer install
```
> Generate Application Key
```sh
$ php -r "echo bin2hex(random_bytes(16));"
```
- Copy the string and paste at `.env` at `APP_KEY` value
> Or, You can generate the App key by using this Custom command
```sh
$ php artisan application:secret
```
- As Lumen does not provide Default key Generate command
> Update the Google Api key at .env (Refer: https://console.cloud.google.com/apis/)
```env
GOOGLE_API_KEY='your-google-api-key'
```
> Generate google client json file and put the file under application/public/Google/
> Fill the DB details at .env
```env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=''
DB_USERNAME=''
DB_PASSWORD=''
```
```sh
$ php artisan migrate
```
> Add permission to Storage folder
```sh
$ chmod -R 775 storage
```
> Configure .htaccess file
```php
RewriteEngine On
RewriteBase /
# Redirect to public directory
RewriteRule ^(.*)$ public/$1 [L]
# Disable directory listing
Options -Indexes
```
> Run dev server at `8000` port at Local System
```sh
$ php -S localhost:8000 -t public
```
### Setup Superviser for Queue Job
```sh
$ sudo apt-get install supervisor
```
```sh
$ sudo systemctl status supervisor
```
> Follow this documentation: https://cloudkul.com/blog/how-to-install-and-configure-supervisor-on-ubuntu-20-04/
### Custom make Job command
```sh
$ php artisan make:job SampleJob
```
> File will be generate at app/Jobs/SampleJob.php
### Custom make Service command
```sh
$ php artisan make:service SampleService
```
> File will be generate at app/Services/SampleService.php
### Clear application cache
```sh
$ php artisan cache:remove
```
### Lumen log viewer

- Refer: https://github.com/rap2hpoutre/laravel-log-viewer (Lumen part)
> Open `/logs`
### Make Custom Commands
```sh
$ php artisan make:command SampleCommand
```
> File will generate at app/Console/Commands/
### Add this Package to Lumen to prevent Http Bridge Error
```sh
$ composer require symfony/psr-http-message-bridge
```
### Create the Queue config file from vendor
```sh
$ cp vendor/laravel/lumen-framework/config/queue.php config/queue.php
```
> After that at `bootstrap/app.php` add this line
```php
$app->configure('queue');
```
```sh
$ php artisan queue:table
```
```sh
$ php artisan queue:failed-table
```
- Refer: https://lumen.laravel.com/docs/10.x/queues
## Create Logging Configuration Files
```sh
$ cp vendor/laravel/lumen-framework/config/logging.php config/logging.php
```
```php
$app->configure('logging');
```
## Install Illuminate Mail for Mailing feature
```sh
$ composer require composer require illuminate/mail:* --with-all-dependencies
```
- [May be differ from Official document](https://lumen.laravel.com/docs/10.x/mail)
```php
$app->configure('mail');
```
## Install Redis for Lumen
```sh
$ composer require illuminate/redis:* --with-all-dependencies
```
> Add this code to `boostrap/app.php`
```php
$app->register(Illuminate\Redis\RedisServiceProvider::class);
```
## Fractal
- Fractal provides a presentation and transformation layer for complex data output, the like found in RESTful APIs, and works really well with JSON. Think of this as a view layer for JSON/YAML/etc.
- When building an API it is common for people to just grab stuff from the database and pass it to json_encode(). This might be passable for "trivial" APIs but if they are in use by the public, or used by mobile applications then this will quickly lead to inconsistent output.
```sh
$ composer require league/fractal
```
Refer: https://github.com/thephpleague/fractal
### Home

### Additional Supported Environment

### SQS Supported

### Redis Queue Supported

## API Documentation
| API URL | Parameters | Method |
|-------------------------|---------------------|----------|
| `api/import/media` | `public url` | POST |
Public Share URL(Example):

-------------------------------------------------------------------------
https://www.dropbox.com/scl/fi/d9irp59qqlmfe0nvwcxn6/my-logo-1.mp3?dl=1
-------------------------------------------------------------------------
With Best regards,
### [Sagnik Dey](https://in.linkedin.com/in/sagnik-dey-483423a9)
## 💻 Tech Stack
                    
       