Skip to content

shini161/Senteur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Senteur

Senteur is a school project: a small web shop focused on perfumes, built with plain PHP (no full framework), MySQL, and Docker so the same environment runs everywhere.

The goal is to show you can structure a PHP app clearly (routing, controllers, models, views), persist data in a relational schema, and ship something a teacher can run with one command.


What this repo contains

  • A Docker stack: Nginx (web server) → PHP-FPM (app) → MySQL (database).
  • A custom “mini framework” folder under src/Core/ (router, request/response, database helper — to be wired as you implement features).
  • MVC-style folders: controllers, models, services, views.
  • A database schema in docker/mysql/init.sql (brands, products, variants, images, users, reviews, etc.).

Stack

Layer Technology
Language PHP 8.3 (see docker/php/Dockerfile)
Web server Nginx
App server PHP-FPM
Database MySQL 8
Containers Docker Compose

How to run it

Prerequisites: Docker with Compose, ports 8080 and 3306 free (or change mappings in docker-compose.yml).

  1. Clone the repository and enter the project directory.

  2. Copy environment file:

    cp .env.example .env

    Adjust values if you change database credentials in Compose.

  3. Start containers:

    docker compose up --build
  4. Open http://localhost:8080

    • Nginx listens on host 8080 and forwards PHP to the app container.
    • Until routing and views are implemented, you may see an empty page with HTTP 200 — that still means Nginx and PHP-FPM are working.
  5. Stop: Ctrl+C, or in another terminal: docker compose down.

MySQL note: init.sql runs only when MySQL initializes a new data volume. If you change the schema later, you may need to reset the volume or apply migrations manually — see docs/PROJECT_STRUCTURE.md.


Environment variables

Defined in .env (see .env.example):

  • APP_ENV, APP_DEBUG — local development flags (you can read them in bootstrap.php later).
  • DB_* — host mysql matches the Compose service name; use these when you connect with PDO in Database.php.

Database diagram

Entity-relationship overview of the Senteur schema.

The diagram is generated from the current schema defined in docker/mysql/init.sql.

Senteur Database Diagram


Project layout

senteur/
├── docker/                 # Docker-only: Nginx config, PHP Dockerfile, MySQL init SQL
├── public/                 # Web root (index.php, assets, uploads)
├── src/
│   ├── Core/               # Router, Request, Response, Database, base Controller
│   ├── Controllers/
│   ├── Models/
│   ├── Services/
│   ├── Views/
│   ├── routes.php
│   └── bootstrap.php
├── docs/
│   └── PROJECT_STRUCTURE.md   # Deeper folder-by-folder explanation
├── .env.example
├── docker-compose.yml
└── README.md

More detail: docs/PROJECT_STRUCTURE.md


License

This is a School project, so it has no License.

About

Senteur Shop is a School Project to make a simple site about something we want to sell (parfumes in my case), using PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors