Create a Hacker News clone.
- PHP 8x
- Laravel 8x
- HTML
- CSS
- TailwindCSS
- JavaScript
- Alpine.js
- SQLite
- Dark mode
- Mobile friendly
- As a user I should be able to create an account.
- As a user I should be able to login.
- As a user I should be able to logout.
- As a user I should be able to edit my account email, password and biography.
- As a user I should be able to upload a profile avatar image.
- As a user I should be able to create new posts with title, link and description.
- As a user I should be able to edit my posts.
- As a user I should be able to delete my posts.
- As a user I'm able to view most upvoted posts.
- As a user I'm able to view new posts.
- As a user I should be able to upvote posts.
- As a user I should be able to remove upvote from posts.
- As a user I'm able to comment on a post.
- As a user I'm able to edit my comments.
- As a user I'm able to delete my comments.
- As a user I'm able to delete my account along with all posts, upvotes and comments.
You need:
When you're ready you can:
- Clone this repo
git clone https://github.com/evelynfredin/hackernews.git
-
Navigate to the right directory
$ cd /path/to/directory/
-
Install dependencies
composer install
- Copy the
.env.example
file
cp .env.example .env
- Set up an application key
php artisan key:generate
- Create a Symlink for showing and storing avatars
php artisan storage:link
- Get a server running
php artisan serve
-
Database cannot be found using the path defined in
.env.example
. Remove and update config/database.php withdatabase_path('database.sqlite')
→('database.db')
instead. -
It is possible to delete other users accounts by changing the form id to another users.
-
It would be good to regenerate session id on login as to prevent session fixation attacks. Auth:attempt does not do this by default.
-
Avatar upload does not handle PostTooLargeException.
-
Consider using resource controllers for your CRUD routes.
-
Passing in old values as shown on register would be good for post description as to not lose post content on invalid url/title.
-
Gorgeous design, dark mode looks stunning!
-
"No comments" redirect in /comments leads to /submit for posts instead of showing existing posts to comment on.
-
The use of tailwind component classes for styling is very clean!
-
Overall code and functionality is excellent, it looks like you really learned and utilized as much as you possibly could!
MIT License
Evelyn Fredin