Skip to content

3zbumban/php-reddit-clone

Repository files navigation

Readme

description

A fullstack Reddit-style web app with PHP, Vue.js, Docker:

  • Backend: Plain PHP with a JSON REST API using Composer
  • Frontend: Vue.js single-page application
  • Database: MariaDB using Propel ORM
  • Environment: Dockerized for easy setup and development

Features

  • User signup and login with username and password
  • Create threads, posts, comments on posts
  • Voting system for posts

A solid starting point for PHP developers to learn fullstack development with a clean backend-frontend split and containerized setup.

screenshot

quickstart 🚀

configuration

# create .env files from sample
cp ./app/.env.sample ./app/.env
cp ./client/.env.sample ./client/.env

docker compose

docker compose up
# notice: you must wait until composer has installed all dependencies
# and migrations have been executed
# client runs on http://localhost:3031/

further configuraition

  • everything should be ready to go as long as ports 3031 and 3030 are availiables
  • you can modify settings like ports and credentials in
    • docker-compose.yml (→ ports, db credentails)
    • ./app/.env ( → jwt secret)
    • ./app/propel.json (→ db credentials)
    • ./client/.env (→ backend uri)
    • client.nginx.conf (→ nginx config)
    • php.nginx.conf (→ nginx config)

runing db migrations if needed

# if you have a fresh db exec into php docker container and run migrations
docker exec -it php-docker-starter-php-1 bash
cd /app
./vendor/bin/propel migration:up
  • sql dump can be found in ./docs/sqldump.sql but should't be necessary as migrations are runned automatically by docker compose

appliaction architecture

database schema

reference

backend

frontend

About

A fullstack Reddit-style web app with Plain PHP REST-API, Auth, Vue.js Frontend fully dockerized

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published