Skip to content

Instantly share code, notes, and snippets.

@mohamedhafezqo
Last active January 10, 2020 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohamedhafezqo/78ae0457218beec6b4bdc607d4558f33 to your computer and use it in GitHub Desktop.
Save mohamedhafezqo/78ae0457218beec6b4bdc607d4558f33 to your computer and use it in GitHub Desktop.

Create a basic Blog

  • Phase 1 (Articles, Comments)

Tech Stack

  • symfony 4.3 skeleton https://symfony.com/releases/4.3

Prerequisites

  • PHP version 7.x
  • Mysql version 5.7 or version 8
  • Composer https://getcomposer.org/

Setup by Docker/Docker-Compose

  1. Clone the repo.
  2. run docker-compose build
  3. then run docker-compose up -d
  4. open sh inside docker container docker-compose exec php sh
  • 4.1. run composer install
  • 4.2. then run sh start.sh
  • 4.3. then exit
  1. then run docker-compose up -d
  • Oh! you can find out the application in http://localhost:8888/articles
  • And you can access the database from here http://localhost:8899 username: root pass: sqlpass

What I finished

  • GET http://localhost:8888/articles
  • Response
[
    {
        "id": 1,
        "title": "Aspernatur.",
        "description": "Rerum et est molestiae dolores. Sequi quos rerum mollitia iusto.",
        "published_at": "2020-01-09T19:17:09+03:00",
        "comments": [
            {
                "id": 1,
                "name": "Britney Greenholt",
                "email": "kenya.hansen@klocko.info",
                "comment": "Natus ab sit quis suscipit aut. Dignissimos sequi minima animi modi. Sit qui et in beatae rerum."
            }
        ]
    }
]
  • GET http://localhost:8888/articles/1
  • Response
{
        "id": 1,
        "title": "Aspernatur.",
        "description": "Rerum et est molestiae dolores. Sequi quos rerum mollitia iusto.",
        "published_at": "2020-01-09T19:17:09+03:00",
        "comments": [
            {
                "id": 1,
                "name": "Britney Greenholt",
                "email": "kenya.hansen@klocko.info",
                "comment": "Natus ab sit quis suscipit aut. Dignissimos sequi minima animi modi. Sit qui et in beatae rerum."
            }
        ]
    }

Class diagram

Class Diagram

Unit Testing

  • TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment