Contact me

~ / projects / 01

Professional workshop 2, 2026

Library management software that talks to its database through an API I put online myself.

C# client, PHP API, MySQL database, deployment

Architecture5 components

The client has no access to MySQL. It sends HTTP requests (GET, POST, PUT, DELETE) with a JSON body to the API, and only the API talks to the database. Moving the client to another machine or changing the database requires no change on the client side.
Architecture diagram: .msi installer to MediaTekDocuments (installs), MediaTekDocuments to nginx (HTTP / JSON), nginx to REST API (FastCGI), REST API to MySQL (PDO). OVH VPS / UBUNTU WORKSTATION / WINDOWS installs HTTP / JSON FastCGI PDO .msi installerdeployed on workstations MediaTekDocumentsC# / WinForms / .NET 4.7.2 nginxweb server REST APIPHP 8.4 / PHP-FPM MySQLmediatek86

Context

A C# desktop application for library staff: books, DVDs, magazines, orders, subscriptions. It never touches the database directly. Everything goes through a PHP REST API hosted on my VPS.

What was there

The starting WinForms application is half-built. You can search and browse books, DVDs and magazines, and record the arrival of a magazine issue. No login, no orders, and a starter REST API that can only handle a few reads.

The request

Extend the tool for library staff: book and DVD orders with step-by-step tracking, magazine subscriptions, an alert before they expire, and different access depending on the department of the logged-in user. All of it as a real client-server setup, with the API deployed on a server.

What I built6 features

  1. Login by department

    On login, the application fetches the user's department and adapts what they see. One department has no access at all, another loses some tabs, and the subscription alert only shows up for the departments concerned.

  2. Orders and tracking

    A book or DVD order moves forward in steps. Business rules are checked before anything is sent: no going back, no paying for an order that hasn't been delivered, no more changes once it has been paid.

  3. Subscriptions and deadlines

    On startup, a window lists the subscriptions ending within 30 days. Sorting and date calculations are done by MySQL, not by the client.

  4. Completed REST API

    New PHP routes for users, tracking steps, orders and subscriptions. Every route goes through a PDO prepared statement and answers in JSON.

  5. Going to production

    API installed on an OVH VPS running Ubuntu (nginx, PHP-FPM, MySQL), files uploaded with WinSCP, routes tested in Postman. The client ships with a Windows installer.

  6. Quality

    14 MSTest unit tests, SonarLint analysis, a client-side error log in %AppData%, and generated technical documentation.

Code excerpts2 excerpts

Code copied as is from the repositories:

Subscriptions expiring within 30 days SQL
SELECT c.id, c.dateCommande, c.montant, a.dateFinAbonnement, a.idRevue, d.titre
FROM commande c
JOIN abonnement a ON c.id = a.id
JOIN document d ON a.idRevue = d.id
WHERE a.dateFinAbonnement BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 30 DAY)
ORDER BY a.dateFinAbonnement ASC
rest_mediatekdocuments / src/MyAccessBDD.php A subscription is an order: both tables share the same id key, hence the join. All the date logic stays in the database.
Order tracking rules C#
if (commande.IdSuivi == 3)
{
    MessageBox.Show("Cette commande est déjà réglée.");
    return;
}
if (commande.IdSuivi == 2 && suivi.Id == 1)
{
    MessageBox.Show("Impossible de revenir en arrière.");
    return;
}
if (suivi.Id == 3 && commande.IdSuivi == 1)
{
    MessageBox.Show("La commande doit être livrée avant d'être réglée.");
    return;
}
mediatekdocuments / view/FrmMediatek.cs Step 1: in progress, 2: delivered, 3: paid. The checks happen before the API is called. In hindsight, the API should check them too, since another client could call it.

In hindsight4 points

What I would
do differently.

Reread today with a more systems and database minded eye. None of this kept the project from working, but all of it would matter in production.

  1. #1

    Passwords

    The username and password travel in the URL of a GET request and are compared in plain text against the utilisateur table. A URL ends up in the server logs. Today I would send them in a POST and hash the password with password_hash() / password_verify().

  2. #2

    Order numbers

    The API computes the next id with MAX(id) + 1. Two workstations confirming at the same moment can get the same number. An AUTO_INCREMENT key settles it.

  3. #3

    Two writes, no transaction

    An order is saved with two INSERT statements (the commande table, then commandedocument or abonnement). If the second one fails, an orphan order is left behind. Both need to be wrapped in a BEGIN … COMMIT.

  4. #4

    The .env file

    It is committed to the public repository. Secrets have no place in Git: server environment variables instead, and a .env.example in the repository.

Stack20 technologies

Client

  • C#
  • .NET Framework 4.7.2
  • WinForms
  • Newtonsoft.Json
  • MSTest
  • SonarLint

API

  • PHP 8.4
  • PDO
  • Composer
  • phpDocumentor

Data

  • MySQL
  • MySQL Workbench

Infra

  • OVH VPS
  • Ubuntu
  • nginx
  • PHP-FPM

Tools

  • Visual Studio 2022
  • Postman
  • WinSCP
  • Git

Documents4 coming soon

  • Project description sheet AP2 / PDF, coming soon
  • Activity report Summary / PDF, coming soon
  • MSTest results 14 tests / PDF, coming soon
  • Specifications Requirements / PDF, coming soon

BTS SIO framework11 skills

The framework competencies this project puts to work.

B1IT service support and delivery

  • B1.2Handle incidents and requests for support and changes
  • B1.4Work in project mode
  • B1.5Make an IT service available to users

B2Application design and development (SLAM)

  • B2.1.1Model an application solution
  • B2.1.3Develop an application solution
  • B2.1.4Design and build a user interface
  • B2.2.1Gather, analyse and update information about an application solution
  • B2.2.4Update technical and user documentation
  • B2.2.5Design and run tests for the updated components
  • B2.3.1Design or adapt a database
  • B2.3.2Carry out operations on a database