diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..40f4a27 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,62 @@ +# Restalo Code of conduct + +## Our pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our collective +and our community a harassment-free experience for everyone, regardless of age, +body size, disability, ethnicity, sex characteristics, gender identity and +expression, level of experience, education, socio-economic status, nationality, +personal appearance, race, religion, or sexual identity and orientation. + +## Our standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others’ private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our responsibilities + +The Restalo project maintainers are responsible for the clarity of the information they provide +and are expected to take appropriate and fair corrective action in response to +any instances of unacceptable behavior. + +The Restalo project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this code of conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +Three strikes will be given to any contributor who does not follow the code of +conduct, with the third strike resulting in a permanent ban from the community. + +## Scope + +Since there is no physical event linked to the project Restalo, the code of conduct will +apply to all interactions between members of the community, including but not +limited to: + +* The use of the project’s code repositories +* The use of the project’s communication channels + + +## Attribution + +This Restalo code of conduct is inspired from the [Contributor Covenant][homepage], +version 1.4, available at \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0707110 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,52 @@ +# Contributing to Restalo + +First off, thank you for considering contributing to Restalo. It's people like you that make Restalo such a great tool. + +## Code of Conduct + +This project and everyone participating in it is governed by the [Restalo Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [contact@restalo.com](mailto:contact@restalo.com). + +## How Can I Contribute? + +### Reporting Bugs + +This section guides you through submitting a bug report for Restalo. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. + +Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). + +#### Before Submitting A Bug Report + +* **Perform a [cursory search](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aissue+archived%3Afalse+sort%3Aupdated-desc+user%3ARestalo+)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one. + +#### How Do I Submit A Good Bug Report? + +Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](#before-submitting-a-bug-report) your bug is related to, create an issue on that repository and provide the following information by filling in [the template](.github/ISSUE_TEMPLATE/bug_report.md). + +Explain the problem and include additional details to help maintainers reproduce the problem: + +* **Use a clear and descriptive title** for the issue to identify the problem. +* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started the Restalo, e.g. which command exactly you used in the terminal, or how you started Restalo otherwise. When listing steps, **don't just say what you did, but explain how you did it**. +* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). +* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. +* **Explain which behavior you expected to see instead and why.** +* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. +* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below. + +### Pull Requests + +The process described here has several goals: + +- Maintain Restalo's quality +- Fix problems that are important to users +- Engage the community in working toward the best possible Restalo +- Enable a sustainable system for Restalo's maintainers to review contributions + +Please follow these steps to have your contribution considered by the maintainers: + +1. Make sure you are following all the guidelines in the [code of conduct](.github/CODE_OF_CONDUCT.md) +2. After you submit your pull request, verify that all status checks are passing
What if the status checks are failing?If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.
+3. While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. + +## Any questions? + +Don't hesitate to ask! Open an issue and we'll do our best to help you out. \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2572feb --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [2024] [Restalo] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 9e18577..553d15b 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,76 @@ -# Projet - Restalo +# Restalo -Le meilleur logiciel de réservation en restauration! +Restalo is an API for managing restaurant reservations. It provides functionalities for creating and managing +reservations, searching for restaurants and reservations, and reviewing restaurants. -## Requis +[![Java](https://img.shields.io/badge/java-21-blue)](https://www.oracle.com/java/technologies/javase-jdk21-downloads.html) +[![junit](https://img.shields.io/badge/junit-4.13.2-blue)](https://junit.org/junit4/) +[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven/apache-maven.svg)](https://maven.apache.org) +[![Known Vulnerabilities](https://snyk.io/test/github/samiusss/restalo/badge.svg)](https://snyk.io/test/github/samiusss/restalo) +[![GitHub Actions](https://github.com/samiusss/restalo/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/samiusss/restalo/actions) +[![Checkstyle](https://img.shields.io/badge/checkstyle-8.45-blue)](https://checkstyle.org) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing +purposes. + +### Prerequisites - Java 21 - Maven 3.x -## Commandes +### Installation -### Compilation +Clone the repository: -``` -mvn compile +```bash +git clone https://github.com/username/restalo.git +cd restalo ``` -### Exécution +Build the project: +```bash +mvn clean install ``` -mvn exec:java + +Run the project: + +```bash +mvn spring-boot:run ``` -### Run Docker Image +Docker build image +```bash +docker build -t restalo . ``` + +Docker run image + +```bash docker compose up -d ``` -### Stop Docker Image +Docker stop image -``` +```bash docker compose down -v ``` -### Choose persistence - -``` -In SystemProperty, choose the persistence with -Dpersistence=... (mongo or inmemory) -``` +## Open Source files -### For conecting to the database +For more information about the project and how to contribute, please refer to the following files: -``` -Create a mongo username and password though the Edit Configuration window, -and connect with the URL structure provided. -``` +- [CONTRIBUTING](CONTRIBUTING.md) +- [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) +- [LICENSE](LICENSE) + +## License +This project is lisenced under the MIT License - see the [LICENSE](LICENSE) file for details. +## Acknowledgments +Thanks to all contributors who participated in this project and helped make it better. diff --git a/exercices/tp4.md b/exercices/tp4.md index 88d3a23..04e7e9e 100644 --- a/exercices/tp4.md +++ b/exercices/tp4.md @@ -168,102 +168,85 @@ En ce qui concerne l'outil de mesure de métrique, nous utilisons Sentry pour ca ### Analyse Détaillée: ![Local Image](../images/tp4/SentryDetail.png) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +## **Open Source** +### **Questions** + +**1. Nommez 3 avantages à contribuer à des projets open source en tant qu'entreprise et justifiez en quoi cela peut être bénéfique pour tous.** + +En tant qu'entreprise, contribuer à des projets open source peut être bénéfique pour plusieurs raisons. Tout d'abord, +cela permet de réduire les coûts de développement en utilisant des solutions déjà existantes et en les adaptant à ses +besoins. De plus, une grande partie de contributeurs sont des gens très bien formés ayant des compétences poussées dans +le domaine, ce qui permet de bénéficier de leur expertise sans avoir à les embaucher. Cela permet donc de gagner du +temps et de l'argent pour l'entreprise qui peut se concentrer sur d'autres aspects de son activité. + +Ensuite, avoir un produit open source permet de laisser libre cours à la communauté et aux utilisateurs du produit de +trouver et rajouter des fonctionnalités et cas d'utilisation précis et qui peuvent être très intéréssants +pour le produit final. Cela permet d'avoir un produit plus complet et plus adapté aux besoins des utilisateurs. + +Enfin, cela permet de renforcer la réputation de l'entreprise en tant qu'acteur engagé dans la communauté open source. +Cela peut attirer des talents et des clients qui sont sensibles à ces valeurs et qui veulent travailler avec des +entreprises qui partagent leurs valeurs. Cela peut également permettre de se démarquer de la concurrence et de gagner +en visibilité sur le marché. Par exemple, parmi les compagnies utilisant le plus l'open source on peut facilement en +citer plusieurs qui sont très populaires et qui ont une très bonne réputation, comme Google, Facebook et Microsoft. + +**2. Décrivez 3 défis qu'impose la mise en place d'un projet open source et justifiez.** + +La mise en place d'un projet open source peut poser plusieurs défis. Tout d'abord, il faut s'assurer que le code est +de qualité et bien documenté pour faciliter la contribution de la communauté. Cela permet également d'avoir des +contributions de meilleure qualité et de diminuer les issues de support, car certaines choses dans le code pourraient +être incomprises du public. Il est impératif que les mainteneurs du projet énoncent clairement leur vision pour le +projet et les standards de qualité à respecter pour que les contributions soient acceptées et intégrées dans le projet. + +Ensuite, il faut gérer les issues et les contributions de la communauté pour s'assurer qu'elles sont à jour et conformes +aux standards de l'entreprise. En effet, une liste de issues à jour permet non seulement d'attirer de nouveaux +contributeurs qui peuvent observer le sérieux du projet et le suivi effectué, mais aussi de maintenir un contrôle +intellectuel sur le projet malgré un grand nombre de contributeurs. Avoir de la documentation qui permet de comprendre +quels sont les différents rôles au sein du répértoire et les différents droits et pouvoirs de chacun permet d'avoir une +meilleure clarté. La communication se doit également d'être publique et documentée pour éviter les malentendus et les +conflits. + +Enfin, l'instauration d'un code de conduite que ce soit pour les événements associés au projet, les commits des +contributeurs ou au niveau de la communication permet grandement au mainteneurs du projet de maintenir un contrôle et +surtout de les aider à prendre des décisions en cas de conflit ou de problème. Cela permet également de créer un +environnement sain et inclusif pour la communauté open source. En effet, déjà qu'il est très difficile pour un +mainteneur de dire Non à un contributeur, avoir des règles claires et des conséquences pré-établies permet de +faciliter la tâche du mainteneur à prendre des décisions dans certaines situations. + +**3. Quelle information vous a-t-elle le plus surprise à propos de l'open source?** + +Parmi les choses qui nous ont le plsu impressionné sur l'open source est le fait qu'il paraît que le open source est +tout autant, si ce n'est plus sécuritaire que le code propriétaire. En effet, le fait que le code soit ouvert permet à +la communauté de le regarder et de le tester, ce qui permet de trouver et de corriger les failles de sécurité plus +rapidement. De plus, le fait que le code soit ouvert permet également de vérifier que le code ne contient pas de +backdoors ou de failles intentionnelles, ce qui peut être un risque avec le code propriétaire. Cela permet donc de +renforcer la sécurité du code et de réduire les risques pour les utilisateurs. Cela peut être un argument de poids pour +convaincre les entreprises de passer à l'open source et de contribuer à des projets open source. + +[Top 10 Misconceptions about open source software] +(https://www.hotwaxsystems.com/hotwax-blog/ofbiz/the-top-10-misconceptions-about-open-source-software) + +### **Notre Code de conduite** + +Notre code de conduite est adapté de la [Contributor Covenant] +(https://www.contributor-covenant.org/version/1/4/code-of-conduct.html) version 1.4. Nous avons choisi ce modèle +principalement, car il est très complet et qu'il est utilisé par de nombreux projets open source. Il est important pour +nous de créer un environnement sain et inclusif pour notre communauté open source, et ce code de conduite nous permet +de poser des bases solides pour cela. Nous avons également ajouté quelques éléments spécifiques à notre projet pour +répondre à nos besoins spécifiques et à notre vision du projet. + +### **License** + +Nous avons choisi la licence MIT pour notre projet open source. Nous avons choisi cette licence principalement, car elle +est très permissive et permet à quiconque d'utiliser, de modifier et de distribuer notre code sans restrictions. De plus, la licence +MIT est très populaire et bien connue, ce qui facilite la compréhension et l'acceptation de notre projet par les +utilisateurs et les contributeurs qui voudraient potentiellement l'utiliser. Enfin, la licence MIT est compatible avec +de nombreuses autres licences open source, ce qui permet de faciliter l'intégration de notre projet dans d'autres +projets open source dans le futur. Dans notre cas, il n'a pas été nécessaire pour nous de choisir une license comme +Apache 2.0, car nous ne sommes pas une entreprise et nous n'avons pas de brevets à protéger. Nous n'avions pas non plus +à utiliser une license GPL, car nous ne voulions pas imposer de restrictions sur l'utilisation du code par les +utilisateurs et les contributeurs. + +[The Legal Side Of Open Source](https://opensource.guide/legal/#which-open-source-license-is-appropriate-for-my-project) # 4. Sécurité Logiciel