This backend implementation creates several REST architecture based API endpoints for authentication, user registeration and property CRUD operations in the DB for property and housing web-app.
npm install
npm run dev"Accept": "application/json",
"Content-Type": "application/json"
{
"fullname": "Anish Tatke",
"mobile": "9999999999",
"email": "anish@tatke.com",
"password": "Password1@"
}
//Response
{
"message": "User created successfully",
"user": {
"profile_picture": null,
"_id": "9ca44c6c-f90a-4ca5-95e4-96eccdd3c258",
"fullname": "Anish Tatke",
"role": "admin"
"mobile": "9999999999",
"email": "anish@tatke.com",
"password": "$2a$15$pgrja5CO1MtRowk1vkrfVeyPodtTKxAzBJQ5Ho0yl9JdWxjszEPyC",
"__v": 0
}
}"Accept": "application/json",
"Content-Type": "application/json"
{
"email": "anish@tatke.com",
"password": "Password1@"
}
//Response
{
"email": "anish@tatke.com",
"token": "System generated jwt token"
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
{
"old_password": "ABc1234$1",
"new_password": "ABc1234$"
}
//Response
{
"message": "Password updated for user: aditya@aditya.com"
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
{
"email": "anish1@tatke.com", //optional
"fullname": "Anish Uday Tatke", //optional
"mobile": "8888888888" //optional
}
//Response
{
"message": "User updated successfully"
}"mimeType": "multipart/form-data"
"x-access-token": "JWT Token here"
{
"key": "profile-picture"
}
//Response
{
"message": "Profile picture updated successfully."
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
//Response
{
"id": "25370253-18ac-409e-b8ea-2fdff0ec1e1c",
"fullname": "Anish Uday Tatke",
"email": "anish1@tatke.com",
"mobile": "8888888888"
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
//Response
{
"users": [
{
"fullname": "Anish Uday Tatke",
"mobile": "8888888888",
"email": "anish1@tatke.com"
},
{
"fullname": "Anish Tatke",
"mobile": "9999999999",
"email": "anish@tatke.com"
}
]
}"Accept": "application/json",
"Content-Type": "application/json"
{
"property_details": {
"property_type" : "bungalow",
"description" : "sea-facing",
"n_bhk" : 15
},
"address" : {
"city" : "Goa",
"area_details" : "Amazing"
},
"quoted_price" : 45855558998552,
"is_approved" : true,
"intrestes" : 200
}
//Response
{
"message": "advertisement created successfully",
"id": "eafd91a8-8bf7-41c9-8997-a130686f2d5b"
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
{
"_id": "eafd91a8-8bf7-41c9-8997-a130686f2d5b",
"property_details": {
"property_type" : "flat",
"description" : "hill-facing",
"n_bhk" : 15
},
"address" : {
"city" : "Maldives",
"area_details" : "Very nice"
},
"quoted_price" : 8595956465161321,
"is_approved" : false,
"intrestes" : 899
}
//Response
{
"message": "advertisement eafd91a8-8bf7-41c9-8997-a130686f2d5b updated successfully"
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
{
"_id":"eafd91a8-8bf7-41c9-8997-a130686f2d5b"
}
//Response
{
"message": "advertisement deleted successfully"
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
//Response
{
"advertisements": [
{
"property_details": {
"property_type": "flat",
"description": "sky-facing",
"n_bhk": 15
},
"address": {
"city": "Maldives",
"area_details": "Very superrr"
},
"images": [],
"_id": "eafd91a8-8bf7-41c9-8997-a130686f2d5b",
"quoted_price": 8595956465161321,
"is_approved": false,
"author": "john@doe.com",
"createdAt": "2021-09-02T13:20:49.669Z",
"updatedAt": "2021-09-02T13:26:34.217Z",
"__v": 0
}
]
}"Accept": "application/json",
"Content-Type": "application/json"
"x-access-token": "JWT Token here"
//Response
{
"advertisements": [
{
"property_details": {
"property_type": "flat",
"description": "sky-facing",
"n_bhk": 15
},
"address": {
"city": "Matheran",
"area_details": "Very superrr"
},
"images": [],
"_id": "eafd91a8-8bf7-41c9-8997-a130686f2d5b",
"quoted_price": 8595956465161321,
"is_approved": false,
"author": "john@doe.com",
"createdAt": "2021-09-02T13:20:49.669Z",
"updatedAt": "2021-09-02T13:26:34.217Z",
"__v": 0
}
]
}