Code Monkey home page Code Monkey logo

homefinder-server's Introduction

HomeFinder-Server

Bienvenue dans HomeFinder-Server, application serveur qui fournit une API pour permettre à des utilisateurs de chercher des maisons disponibles pour l'achat. Cette application est conçue pour être utilisée en tandem avec HomeFinder, une application mobile.

Endpoints

Les endpoints sont les URLs que vous pouvez appeler pour interagir avec l'API. Voici les endpoints disponibles dans HomeFinder-Server:

Register [POST]

https://homefinder-ktor-server.herokuapp.com/auth/register

Cet endpoint permet à un utilisateur de créer son compte en fournissant des informations telles que le sername,firstname, lastname, password et email.

{
    "username" : "john_doe",
    "password" : "JohnDoe",
    "email" : "[email protected]",
    "firstName": "John",
    "lastName" : "Doe"
}

Login [POST]

https://homefinder-ktor-server.herokuapp.com/auth/login

Cet endpoint permet à un utilisateur de se connecter en fournissant leur adresse email et leur mot de passe. Si les informations d'identification sont correctes, un jeton d'accès est renvoyé en tant qu'objet JSON avec le champ token.

Exemple Requête :

{
    "username" : "john_doe",
    "password" : "JohnDoe"
}

Exemple Resultat :

{
    "token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJIb21lRmluZGVyQXVkaWVuY2UiLCJyb2xlIjoiVVNFUiIsImlzcyI6Imh0dHA6Ly8wLjAuMC4wOjgwODAiLCJleHAiOjE2Nzg2MTIxNjEsInVzZXJJZCI6IjY0MDQ2OThjNWVlNzc5MDI1Njg3NjMwZCJ9.y7iUfkLgldDAl3sYHwpSqmUn2RNsNQIVFmtSx-bguhk"
}

Houses [GET]

https://homefinder-ktor-server.herokuapp.com/api/v1/houses

Cet endpoint renvoie toutes les maisons disponibles dans la base de données. Les maisons sont renvoyées en tant qu'objet JSON avec les champs suivants: id, title, address, description, price, type, bedrooms, bathrooms, owner et images. Bearer associé dans le Header de la requête avec le token reçu lors de l'authentification, on peut à présent voir l'ensemble des maisons.

Exemple de résultat:

{
	"success": true,
	"message": "OK",
	"prevPage": 1,
	"nextPage": 3,
	"data": [
		{
			"id": "640d727e3ab37e185f9bc984",
			"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry",
			"images": [],
			"price": 98500,
			"address": {
				"id": "6409597e47767d7fef95d232",
				"number": "2501",
				"street": "Boulevard des Forges",
				"city": "Trois-Rivières",
				"province": "Québec",
				"postalCode": "G8Z 3L9",
				"country": "Canada"
			},
			"bedrooms": 3,
			"bathrooms": 1,
			"area": 1500,
			"type": "CONDO",
			"yearBuilt": 2000,
			"pool": false,
			"owner": {
				"id": "640d727d3ab37e185f9bc983",
				"username": "Jonathan Sillon",
				"firstName": "Jonathan",
				"lastName": "Sillon",
				"email": "[email protected]",
				"phone": "819 111 1111"
			}
		}
	],
	"lastUpdated": 1678610362309
}

Vous avez la possibilté de determiner la page et la limite sur la requête comme ceci :

https://homefinder-ktor-server.herokuapp.com/api/v1/houses?page=2
https://homefinder-ktor-server.herokuapp.com/api/v1/houses?page=2&limit=5

Licence

MIT License

Copyright (c) 2023 Josue Lubaki

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.

homefinder-server's People

Contributors

josue-lubaki avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.