Ce projet concerne la conception d’une application web qui a pour objectif de présenter des biens immobiliers au grand public et de permettre la prise de contact (dans l’optique d’une location courte ou longue durée). Le projet est composé d'une interface utilisateur (front-office), un espace d'administration (back-office) et d'une base de données (API).
Utilisation du plugin i18n pour gérer le multilingue. Les traductions sont stockés dans deux fichiers JSON. Documentation officielle
Utilisation d'un calendrier interactif pour l'affichage de la disponibilité de chaque appartement. Un composant Calendar.js est disponible en front-office. Documentation officielle
Utilisation du framework UI React Material UI pour quelques composants: Buttons, TextFields, Cards, Loader... Documentation officielle
Utilisations d'un carousel d'images pour l'affichage de photos d'appartements en page d'accueil grâce au module React Responive Carousel. Documentation officielle
Back-office développé avec l'aide de Material-UI. Documentation officielle
Utilisation de la librairie Nodemailer. Documentation officielle
Se rendre dans le fichier services/mailer.js.
Le premier email est déstiné au client et le deuxième à l'admin.
Il prend en compte la langue actuelle du site pour le mail ultilisateur.
Modification du contenu des emails :
-
Phrase d'intro : de la ligne 120 à 123 et à la ligne 368
-
Liste récapitulative : de la ligne 180 à 192 et de la ligne 423 à 427
-
Liens Facebook et youtube : ligne 130/231 et ligne 462/463
Gestion de l'envoi d'email de la ligne 482 à 518.
exemple:
const mailOptionsUser = {
from: `"Valiris Résidence" <${process.env.MAIL_USER}>`,
to: body.email,
subject: `Valiris Résidence - ${lang === 'en' ? 'Summary of your request' : 'Récapitulatif de votre demande'}`,
html: outputUser
};git config --global core.autocrlf input(just re-clone if already cloned).
Install dependencies and the migration tool :
npm i
npm i -g db-migrate db-migrate-mysqlCopy the environnement variables :
cp .env.sample .env
This .env file allows to change the way the Node server connects to the database, but you probably won't have to change any of those variables unless you want to deploy the app yourself and connect it to a specific DB.
Install Docker on your OS.
docker-compose up --buildThat will install and run the app with all its dependencies (including the DB) in isolated containers. With this single command, you will have a fully functionnal API listening by default on localhost:3000.
You will also have two running DB servers (one for developpement and one for running automated tests), accessible respectively on localhost:3307 and localhost:3308 with the user root and the password root.
Alternatively, you can just bring up the db and run the app outside a container :
docker-compose up db #(wait until the console stop outputing stuff)
npm run migrate
npm run start-watchThat may be useful when developpping since you won't have to rebuild and re-run the NodeJS container every time when a change is made in the code.
npm run tests:setup-db #(wait until the test DB is accessible at localhost:3308)
npm run tests:migrate-db
npm run testInstall MySQL (5.7) on your OS.
Then, create two MySQL server instances, both accessible with the user root and the password root :
- One listening on port 3307 with an empty database called
valiris_api_database. - One listening on port 3308 with an empty database called
valiris_api_database_test.
npm run migrate
npm run start-watchnpm run tests:migrate-db
npm run testYou can access the docs at localhost:3000/api-docs
- React.js - Bibliothèque JavaScript (front-end)
- Node.js - Environnement d'exécution JavaScript (back-end)
- Express - Infrastructure d'applications web Node.js (back-end)
- Vianney alias @vboualt
- Nathan alias @nathanguillaumin
- Hugo alias @K0Si-003
