Routes
Overview
The Express backend exposes a few endpoints to manage users and serve static test data to the mobile application.
Base URL: http://localhost:2880/
1 – POST /register
Registers a new user in the MySQL database.
Request body
{
"id": "string", // Unique user identifier (Firebase UID)
"nom": "string", // Last name
"prenom": "string", // First name
"adresse": "string", // Postal address
"neurologue": "string", // Name of the neurologist
"date_naissance": "YYYY-MM-DD", // Date of birth
"mot_code": "string" // Code word defined by the patient
}
warning
All fields are mandatory. The request will return a 400 if one is missing.
Response codes
201 Created– The user was successfully saved to the database.400 Bad Request– One or more fields are missing.500 Internal Server Error– SQL or connection failure.
2 – GET /categories
Returns the list of available test categories, served from the static JSON file located at data/categories.json.
Response example
[
{
"id_category": 1,
"nom": "Langage",
"tests": [
{
"id_test": 12,
"nom": "Répétition mot",
"type": "both"
// ...
}
]
},
...
]
Response codes
200 OK– The file was read and parsed successfully.500 Internal Server Error– Could not read the JSON file.
3 – GET /profil/:uid
Retrieves the full profile of a user from the utilisateurs table using their UID.
URL parameters
:uid– Firebase UID corresponding to theidfield in the database.
info
User authentication is managed by Firebase.
The uid is generated by Firebase during user registration and used as a unique identifier across the system.
Example
GET /profil/abc123
Response example
{
"id": "abc123",
"nom": "Doe",
"prenom": "John",
"date_naissance": "1990-01-01",
"adresse": "12 rue Exemple, Paris",
"neurologue": "Dr Dupont",
"mot_code": "LapinBleu"
}
Response codes
200 OK– User found.404 Not Found– No user with the provided UID.500 Internal Server Error– Database error.
Summary
| Method | Route | Description |
|---|---|---|
| POST | /register | Add a new user to the database |
| GET | /profil/:uid | Retrieve profile of a user |
| GET | /categories | Return test categories (JSON) |