Skip to content

Repository files navigation

La Gazette de L-INFO

A full-stack parody news website built in PHP — developed as a personal project to practice server-side web development, database design, and session management.

Students submit fake news, editors publish articles, and readers can comment and react. The site runs on a custom Docker stack with Apache, PHP 8.3, and MariaDB — no framework, no shortcuts.

The project is currently in progress — the core article system and authentication are functional, with search, pagination, and the editorial interface still being built.


Screenshots

Home page

Home page Three dynamic article sections — top stories, most commented, and random picks — all queried live from the database.

Article page

Article page Full article view with author credit, publication date, and a comment section for authenticated users.

News feed

News feed Paginated article listing, grouped by month of publication.

Login

Login page Login form with session creation and password verification.

Registration

Registration page Multi-step registration with full server-side validation and hashed password storage.

Editorial desk

Editorial desk Meet the fictional editors and photographers — presented with bios and photos.

Subscription

Subscription page Newsletter subscription form with field validation and error feedback.

Database structure

Database MariaDB schema viewed in phpMyAdmin — tables, columns, and relationships.


Tech stack

  • PHP 8.3 — server-side logic, templating, session handling
  • MariaDB — relational database (articles, users, comments)
  • Apache 2 — web server
  • Docker & Docker Compose — containerised development environment
  • phpMyAdmin — included in the Docker stack for database management
  • HTML5 / CSS3 — frontend markup and styling, no framework

Getting started

Prerequisites: Docker Desktop installed and running.

The Docker images used here are not on Docker Hub — they are defined in the Dockerfile and must be built locally first.

# 1. Clone the repository
git clone https://github.com/T-Guyon/fac-parody.git
cd fac-parody

# 2. Build the custom Docker images (one-time setup)
docker build --tag=alpine-apache-php8.3 --target=apache-php8.3-config .
docker build --tag=alpine-mariadb --target=mariadb-config .

# 3. Start the database container and import the schema
docker compose up -d db
docker exec -i mariadb_c mariadb -uroot -proot_pass < database/gazette_bd.sql

# 4. Start all containers
docker compose up -d

The site is then available at http://localhost:8080.

Stop everything:

docker compose down

Services

Service URL Credentials
Website http://localhost:8080 —
phpMyAdmin http://localhost:8080/phpmyadmin root / root_pass

Project structure

fac-parody/
├── php/
│   ├── bibli_generale.php   # Generic helpers — DB connection, HTML output, XSS protection
│   ├── bibli_gazette.php    # App config (DB constants, session helpers, nav rendering)
│   ├── article.php          # Single article view with comments
│   ├── actus.php            # Paginated news feed
│   ├── connexion.php        # Login — session creation, password_verify()
│   ├── inscription.php      # Multi-step registration with validation
│   ├── nouveau.php          # New article form (authenticated editors only)
│   ├── edition.php          # Edit an existing article
│   ├── compte.php           # User profile page
│   ├── redaction.php        # Editorial desk — team presentation
│   ├── recherche.php        # Article search (in progress)
│   └── deconnexion.php      # Session teardown and redirect
├── styles/                  # Gazette-specific stylesheet
├── html/                    # Static pages (archives, legacy views)
├── images/                  # Site assets — masthead, author photos, article thumbnails
├── upload/                  # User-uploaded article images
├── docs/
│   └── screenshots/         # Screenshots for this README
├── database/
│   └── gazette_bd.sql       # Full database schema + seed data
├── index.php                # Entry point — dynamic homepage
├── Dockerfile               # Multi-stage build: PHP+Apache image and MariaDB image
├── compose.yaml             # Docker Compose — db + app services, shared network
├── .gitignore
└── README.md

Features

Public access

  • Browse the homepage — top stories, most commented, and random picks pulled live from the database
  • Read any article in full
  • Search articles by title or summary (in progress)

Registered users

  • Create an account via multi-step registration with full server-side validation
  • Log in and maintain a persistent session across pages
  • Post comments on articles
  • Delete your own comments

Editors (elevated role, set in the database)

  • Publish new articles
  • Edit existing articles

Security

  • Passwords hashed with password_hash() / verified with password_verify()
  • All HTML output escaped with a custom htmlProtegerSorties() wrapper to prevent XSS
  • SQL queries use mysqli_real_escape_string() for input sanitisation
  • Session destroyed on logout with cookie invalidation
  • Protected pages check authentication state before rendering

Database

The schema is built around three main tables:

Table Role
utilisateur Registered users — login, hashed password, editor flag
article Published articles — title, body, date, author reference
commentaire User comments linked to articles

The full schema with seed data is available in database/gazette_bd.sql.


Roadmap

  • Article search with multi-criteria filtering
  • Pagination on the news feed
  • Article image upload for editors
  • "No image" fallback to none.jpg
  • Show edit option to the article's own author
  • Link from article footer to author's editorial page

Author

[T-Guyon] — L2 Computer Science student
[https://github.com/T-Guyon] · [https://www.linkedin.com/in/th-guyon/]

About

Parody news website built in PHP, HTML & CSS - with authentication, role management, and a Docker stack.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages