Download the repository and run index.php on a PHP-server.
Appen hämtar data från en live databas på heroku. Ett CMS för att editera den databasen är inte skapat ännu. Korten renderas dynamiskt baserat på datan i databasen. Författare, content, datum, likes och färg hämtas därifrån. (Färger som kan användas är röd, blå och grön). Tanken är att korten ska kunna expanderas med detta är inte implementerat ännu. Korten är uppbyggda i CSS-grid och går mellan en till tre kolumner baserat på bredd.
Koden är uppdelad i komponenterna header, main och footer. Kort-logiken sker i main.php. variabeln $data importeras från server-connection.php
Funktion för like-knapp och spara-knapp är inte implementerat ännu.
Review (Martin):
- Love the thought of functionality to save the articles for i'm assuming reading later on the site. Nice touch for articles which im just quickly skimming through now but would like to deep dive later on when i have more time.
- The way of hiding the cards with a div with a transparent gradient looks super clean.
- First card is not properly aligned with the rest of the cards on desktop view or tablet. (Resolved)
- Some parts of the text is showing beneath the div hiding the content. (Resolved)
- Have left ?> showing on the bottom of the page beneath all the cards. (Resolved)
- As for php, nicely broken down into reusable components such as header, footer etc
- Prob don't want to expose password string in expert_author publicly on github, but rather place it in an .env file. (Resolved?)
- Don't know if posts are sorted or not as they're all the same date. (Resolved)
- body.php is highly readable, very easy to understand so seems like something easy to maintain so big + there, also nice touch of being able to set corresponding color in database.
- Can't find a functions.php file so not much to comment on regarding functions made in php. I guess a case could be made for server-connection.php as it has a defined function, code looks good and types have been declared, should include strict_types to enable typesafety.