I value keeping my site open source, but as you all know, plagiarism is bad. It's always disheartening whenever I find that someone has copied my site without giving me credit. I spent a non-trivial amount of effort building and designing this iteration of my website, and I am proud of it! All I ask of you all is to not claim this effort as your own.
Before you start, please install this:
Clone the repository:
git clone https://github.com/andikaleonardo/datamine
Navigate to the project directory:
cd datamine
Update PHP dependencies using Composer:
composer update
Install PHP dependencies using Composer:
composer install
Install JavaScript dependencies using NPM:
npm install
Create a .env
file by copying .env.example
and update it with your database configuration:
cp .env.example .env
Generate application key:
php artisan key:generate
Make sure APP_URL
& ASSET_URL
in .env
is defined because laravel pointed to those URL.
APP_URL=https://datamine-13120b40742a.herokuapp.com
ASSET_URL=https://datamine-13120b40742a.herokuapp.com
Migrate the database:
php artisan migrate
Compile Assets:
npm run dev
Start the Local development server:
php artisan serve
http://localhost:8000
Log in to Heroku:
heroku login
Create a new Heroku application:
heroku create your-app-name
Add the Heroku Postgres add-on:
heroku addons:create heroku-postgresql:hobby-dev
Set environment variables in Heroku:
heroku config:set APP_KEY=$(php artisan key:generate --show)
heroku config:set APP_ENV=production
heroku config:set APP_DEBUG=false
heroku config:set APP_URL=https://your-app-name.herokuapp.com
heroku config:set ASSET_URL=https://your-app-name.herokuapp.com
Add a Procfile to the root of your project to instruct Heroku how to run your app. Create a Procfile file with the following content:
web: vendor/bin/heroku-php-apache2 public/
Commit your changes to git:
git add .
git commit -m "Prepare for Heroku deployment"
Deploy your application to Heroku:
git push heroku main
Run database migrations on Heroku:
heroku run php artisan migrate
Access your application on Heroku: Open your web browser and go to https://your-app-name.herokuapp.com