/bloggy

a frog blog app

Primary LanguagePHP

logo

EN

Bloggy is a web blog app written in PHP using the Symfony framework. It offers a beautiful user interface that lets you write posts, comment on them, end even set your own avatar. It also features an administration panel that lets you CRUD everything. Bloggy was written as a uni project for the Interactive System subject.

PL

Bloggy to aplikacja webowa, będąca blogiem internetowym, napisana w PHP z użyciem frameworka Symfony. Oferuje przepiękny interfejs użytkownika pozwalający na pisanie postów i komentarzy, a nawet ustawienie własnego awatara. Zawiera również potężny panel administratora, który pozwala na CRUDowanie wszystkim (chodzi o zawartość - takie rzeczy może robić tylko admin). Aplikacja napisana jako zaliczenie na przedmiot System interakcyjny - projekt.

A short guide to set up bloggy on your machine

  1. Install Docker and Docker Compose on your machine
  2. Clone the git repository to your directory of choice
git clone https://github.com/flashdens/bloggy.git
  1. Build the containers with ./build.env.sh
  2. Enter the php container with docker-compose exec php bash
  3. Specify the MySQL database connection URL in the .env file, for example:
DATABASE_URL=mysql://symfony:symfony@mysql:3306/symfony?serverVersion=5.7
  1. Install necessary packages, set up the database and load example content to it wih:
  composer install
  bin/console doctrine:migrations:migrate
  bin/console doctrine:fixtures:load
  1. The app should be accessible at localhost:8000. You can find the login credentials at app/src/DataFixtures/UserFixtures.

Database structure

db structure

Screenshots

Screenshot 1

Screenshot 2

Screenshot 3

What is inside?

  • Apache 2.4.25 (Debian)
  • PHP 8.1 FPM
  • MySQL 8.0.x (5.7)
  • NodeJS LTS (latest)
  • Composer
  • Symfony CLI
  • xdebug
  • djfarrelly/maildev

Requirements

Installation

  • (optional) Add
127.0.0.1   symfony.local

in your host file.

  • Run build-env.sh (or build-env.ps1 on Windows box)

  • Enter the PHP container:

docker-compose exec php bash
  • To install Symfony LTS inside container execute:
cd app
rm .gitkeep
git config --global user.email "you@example.com"
symfony new ../app --full --version=lts
chown -R dev.dev *

Container URLs and ports

  • Project URL
http://localhost:8000

or

http://symfony.local:8000
  • MySQL

    • inside container: host is mysql, port: 3306
    • outside container: host is localhost, port: 3307
    • passwords, db name are in docker-compose.yml
  • djfarrelly/maildev i available from the browser on port 8001

  • xdebug i available remotely on port 9000

  • Database connection in Symfony .env file:

DATABASE_URL=mysql://symfony:symfony@mysql:3306/symfony?serverVersion=5.7

Useful commands

  • docker-compose up -d - start containers
  • docker-compose down - stop contaniners
  • docker-compose exec php bash - enter into PHP container
  • docker-compose exec mysql bash - enter into MySQL container
  • docker-compose exec apache bash - enter into Apache2 container