Please read along to set up your own Bloggist instance.
There are some things you will need before you can get started developing with Bloggist.
- Apache/Nginx (This guide was built using Nginx on Ubuntu Server 22.04. You can also use MAMP or XAMPP, which are available for both macOS and Windows)
- MySQL server (database server)
- VS Code (code editor)
- Beekeeper Studio (database management software)
- Git (version control management)
- Composer (PHP package manager)
- NPM (JS package manager)
-
Clone the repository into your development environment.
git clone https://github.com/elvisblanco1993/bloggist.git
-
Move into the project directory.
cd bloggist
-
Create the environment file.
cp .env.example .env
for UNIX based systems, andcopy .env.example .env
on MS Windows -
Install back-end dependencies (this includes all packages Bloggist depends on).
composer install
-
Install front-end dependencies.
npm install
-
Generate application key (this will help with encryption and security).
php artisan key:generate
-
Create database.
-
Open a terminal window, and access your MySQL server
sudo mysql -u root -p;
-
Create your database and assign permissions
CREATE DATABASE bloggist; CREATE USER 'bloggist'@'localhost' IDENTIFIED BY '{YOUR_PASSWORD}'; ALTER USER 'bloggist'@'localhost' IDENTIFIED WITH mysql_native_password BY '{YOUR_PASSWORD}'; GRANT ALL PRIVILEGES ON bloggist.* to 'bloggist'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES; EXIT;
Replace {YOUR_PASSWORD} with a strong, secure password.
-
-
Add your database credentials to Bloggist.
Now that you created your database, database username and password, it is time to connect your instance to it.
To do so, open your .env file, and modify the following lines.
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=bloggist DB_USERNAME=bloggist DB_PASSWORD=SET_YOUR_PASSWORD_HERE
-
Run migrations (this will create your database tables).
php artisan migrate
-
Generate front-end assets.
Run
npm run build
if you are deploying on production, ornpm run dev
if you are deploying on a staging site want live reload
Now your Bloggist site should be up and running.
If you are deploying your site on a production environment, you will need to enable SSL certificates to ensure all traffic from and to your server is fully secure. You can follow this guide on how to get a free certificate from Let's Encrypt.