Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

This is a tourism platiform for connecting tour guiders and tourists

Notifications You must be signed in to change notification settings

habimanasharif/TOUR_RADAR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOUR_RADAR API

INSTALLATION

Installing Dependencies

Run yarn install -g typescript or npm install -g typescript yarn install or npm i

.env

Create a .env file in the root directory and paste in this

MONGO_URI= 
JWT_SECRET= 
CLIENT_ID =
HOST= 
CLIENT_SECRET =
REDIRECT_URI =
REFRESH_TOKEN =
username = 
password = 
CLOUDINARY_API_KEY = 
CLOUDINARY_API_SECRET = 
CLOUDINARY_NAME = 

Menu

User

Admin

Posts

Likes

Follow

comments

Search

1. User SignUp: MUTATION

Body

mutation Example {
  signUp(
    input:{ firstname:"Habimana",
      lastname:"sharif"  ,
      username:"sharif" ,
      password:"test123",
      email:"[email protected]"
}
  ){
     firstname
    lastname
    username
    password
    email
    profilePicture
    isVerified
    role
    bio
    website
  createdAt
  }
}

Response

{
    "data": {
        "signUp": {
            "firstname": "Habimana",
            "lastname": "sharif",
            "username": "ty_flex",
            "password": "$2b$10$LoiQg9wiSL4jMcLUNVcAIudrl5k34WKyivvy2ZmEX1uc173kTbqTS",
            "email": "[email protected]",
            "profilePicture": "none",
            "isVerified": "false",
            "role": null,
            "bio": "**No Biography**",
            "website": null,
            "createdAt": "1635290132898"
        }
    }
}

2. User LogIn: MUTATION

Body

mutation ex{
    logIn(
    account:"[email protected]"
    password:"drop."
    ){
     username,
     email,
     token
    }
}

Response

{
    "data": {
        "logIn": {
            "username": "keleva96",
            "email": "[email protected]",
            "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Indpenp5c2hhcmlmaXZrQGdtYWlsLmNvbSIsImlkIjoiNjE5ZTZjNzRkYjdiMjc3NTU3MGQyODM4Iiwicm9sZSI6InVzZXIiLCJpYXQiOjE2Mzc3NzMwMjJ9.CTJmnqpG7TWYSDg8t2QzOkpdRg3rLgZo8n7lfI6t6Is"
        }
    }
}

3. User Verify Email: MUTATION

Body

mutation exp{
    verifyEmail(
        token:"eyJhbGciOiJIUzI1NiJ9.d2l6enlzaGFyaWZpdmtAZ21haWwuY29t.eJG2votBkpx957dAHHhfAoLiJLnVxb6CVU8WyX0jD7E"
    )
    { 
        email
    }
}

Response

{
    "data": {
        "verifyEmail": {
            "email": "[email protected]"
        }
    }
}

4. Admin Login

Body

mutation ex{
    AdminLogin(
        username:"admin",
        password:"admin"
    ){
        role
        token
    }

Response

{
    "data": {
        "AdminLogin": {
            "role": "admin",
            "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYWRtaW4iLCJpYXQiOjE2Mzg4NzY0NjZ9.eUzAxkb3LkpOxNKXUgNAQdgTKR9oDNV8N7kr33IQv-4"
        }
    }
}

5. User Request IsGuider Verification: MUTATION

Body

mutation ex{
    verifyGuider(
        cirtificate:"/home/ty-flex/Downloads/m8c20gchf7231.jpg"
    ){
        message
    }
}
  {
    "data": {
        "verifyGuider": {
            "message": "verification successfully requested"
        }
    }
}

7. Admin Fetch Verification Request: Query

Body

query ex {
   verifications{
       cirtificate,
       email,
       username,
   }
}

Response

{
    "data": {
        "verifications": [
            {
                "cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639554589/f1ktspfks8qwytm3bpjd.jpg",
                "email": "[email protected]",
                "username": "josue"
            },
            {
                "cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639437711/jy0yghkwk4mxu6cek36d.jpg",
                "email": "[email protected]",
                "username": "josue"
            },
            {
                "cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639317929/hrul2pnjiajjrwtw8urw.jpg",
                "email": "[email protected]",
                "username": "josue"
            },
            {
                "cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639317303/b2bpvcxk4iiedomuw19k.jpg",
                "email": "[email protected]",
                "username": "josue"
            },
            {
                "cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639316082/ucoawsw80irlauvqe7ga.jpg",
                "email": "[email protected]",
                "username": "josue"
            },
            {
                "cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639309047/ycmeodsnqamcpc80xykz.jpg",
                "email": "[email protected]",
                "username": "josue"
            },
            
        ]
    }
}

8. Admin Verify User: Mutation

Body

mutation ex{
    adminverify(
    email:"[email protected]"
    ){
     username,
     email,
     isGuider,
     firstname,
     lastname,
     isVerified
    }
}

Response

{
    "data": {
        "adminverify": {
            "username": "josue",
            "email": "[email protected]",
            "isGuider": "true",
            "firstname": "Igiraneza",
            "lastname": "Josue",
            "isVerified": "true"
        }
    }
}

9. User-Create-Post-mutation

body

mutation ex{
    createPost(
        input:{
     caption:"To night was lit"
      location:"Kigali,Rwanda"
      content:["/home/ty-flex/Downloads/m8c20gchf7231.jpg","/home/ty-flex/Downloads/m8c20gchf7231.jpg","/home/ty-flex/Downloads/m8c20gchf7231.jpg"]
        }
    ){
    content
    location
    }
}

Response

{
    "data": {
        "createPost": {
            "content": [
                "https://res.cloudinary.com/trio-code/image/upload/v1639757067/p6muxrurlher5pb2ryak.jpg",
                "https://res.cloudinary.com/trio-code/image/upload/v1639757077/urqyb3upmgurlz64baou.jpg",
                "https://res.cloudinary.com/trio-code/image/upload/v1639757082/wfrpe94lfimca37poiup.jpg"
            ],
            "location": "Kigali,Rwanda"
        }
    }
}

10. User Fetch Posts-Query

Body

query ex{
    posts{
        _id
        owner{
            _id
            username
            profilePicture
        }
        likes{
                username
                profilePicture
          
        }
        isLiked
        likesNo
        content
        commentNo
        comments{
            user{
                username
                profilePicture
            }
            content
        }
        location
        createdAt
    }
}

Response

{
    "data": {
        "posts": [
            {
                "_id": "61cab12e91f1cd2ef9a16f26",
                "owner": {
                    "_id": "61c5ccf3a197b25038a11bad",
                    "username": "kelevaj",
                    "profilePicture": "none"
                },
                "likes": [
                    {
                        "username": "kelevaj",
                        "profilePicture": "none"
                    }
                ],
                "isLiked": true,
                "likesNo": 1,
                "content": [
                    "https://res.cloudinary.com/trio-code/image/upload/v1640673556/bsj5cgor6tybtjynb6go.jpg",
                    "https://res.cloudinary.com/trio-code/image/upload/v1640673570/wkqwlhhorynijfmad0lr.jpg",
                    "https://res.cloudinary.com/trio-code/image/upload/v1640673581/ylj4yhjauuxzxw71ovug.jpg"
                ],
                "commentNo": 2,
                "comments": [
                    {
                        "user": {
                            "username": "kelevaj",
                            "profilePicture": "none"
                        },
                        "content": "I would love to pay a vist"
                    },
                    {
                        "user": {
                            "username": "sheezy",
                            "profilePicture": "none"
                        },
                        "content": "this is awesome"
                    }
                ],
                "location": "Kigali,Rwanda",
                "createdAt": 1640673582673
            }
        ]
    }
}

11. User Delete Own Posts-mutation

Body

mutation ex{
    deletePost(id:"61bcbe59c3cc2b437cfcbb26")
    {
        message
    }
}

Response

{
    "data": {
        "deletePost": {
            "message": " Post Deleted Successfully"
        }
    }
}

12 User Like Post-Mutation

Body

mutation ex{
    likePost(postId:"61c325c31b0cf98eda97b771"){
message
}
}

Response

{
    "data": {
        "likePost": {
            "message": " Post liked Successfully"
        }
    }
}

13 User Update Profile-Mutation

Body

mutation ex{
    updateUser(
        input:{
            firstname:"Tyflex"
            lastname:"umuhuza"
            bio:"tyflex is cool"
        }
        ){
        bio
        firstname
        lastname
    }
}

Response

{
    "data": {
        "updateUser": {
            "bio": "tyflex is cool",
            "firstname": "Tyflex",
            "lastname": "umuhuza"
        }
    }
}

14 User Follow Other User-mutation

Body

mutation ex{
    followUser(userId:"61c5d14e7971b5c9a44d78a8")
    {
    message
    }
}

Response

{
    "data": {
        "likePost": {
            "message": " User Followed Successfully"
        }
    }
}

15 User Follow Other User-mutation

Body

mutation ex{
    unfollowUser(userId:"61c5d14e7971b5c9a44d78a8")
    {
    message
    }
}

Response

{
    "data": {
        "likePost": {
            "message": " User UnFollowed Successfully"
        }
    }
}

16 User Fetch User Profile Query

Body

query ex {
    userProfile(
       userId:"61c5ccf3a197b25038a11bad"
    ){
      username
      firstname
      lastname
      bio
      isGuider
      isFollowing
      isUser
      posts{
          _id
          location
          content
          caption
          isLiked
          likesNo
          createdAt
          caption
          likes{
              username
              profilePicture
          }
      }
      followers
      following
      allFollowers{
          username
          profilePicture
      }
      allFollowing{
          username
          profilePicture
      }
    }
}

Response

{
    "data": {
        "userProfile": {
            "username": "kelevaj",
            "firstname": "Umuhuza",
            "lastname": "Clever",
            "bio": "**No Biography**",
            "isGuider": "true",
            "isFollowing": false,
            "isUser": true,
            "posts": [
                {
                    "_id": "61cab12e91f1cd2ef9a16f26",
                    "location": "Kigali,Rwanda",
                    "content": [
                        "https://res.cloudinary.com/trio-code/image/upload/v1640673556/bsj5cgor6tybtjynb6go.jpg",
                        "https://res.cloudinary.com/trio-code/image/upload/v1640673570/wkqwlhhorynijfmad0lr.jpg",
                        "https://res.cloudinary.com/trio-code/image/upload/v1640673581/ylj4yhjauuxzxw71ovug.jpg"
                    ],
                    "caption": "To night was lit",
                    "isLiked": true,
                    "likesNo": 1,
                    "createdAt": 1640673582673,
                    "likes": [
                        {
                            "username": "kelevaj",
                            "profilePicture": "none"
                        }
                    ]
                }
            ],
            "followers": 0,
            "following": 1,
            "allFollowers": [],
            "allFollowing": [
                {
                    "username": "sheezy",
                    "profilePicture": "none"
                }
            ]
        }
    }
}

17 User Update Profile Picture-Mutation

Body

mutation ex {
   updateProfilePicture(picture:"/media/ty-flex/files/greencard/CROPPED-_DSC3111.JPG"){
        message
    }
}

Response

{
    "data": {
        "updateProfilePicture": {
            "message": "Profile Picture Update successfully"
        }
    }
}

18 User Fetch Single Posts Query

Body

query ex{
    fetchSinglePost(postId:"61cab12e91f1cd2ef9a16f26"){
       _id
        owner{
            _id
            username
            profilePicture
        }
        likes{
                username
                profilePicture
          
        }
        isLiked
        likesNo
        content
        commentNo
        comments{
            user{
                username
                profilePicture
            }
            content
        }
        location
        createdAt 
    }

}

Response

{
    "data": {
        "fetchSinglePost": {
            "_id": "61cab12e91f1cd2ef9a16f26",
            "owner": {
                "_id": "61c5ccf3a197b25038a11bad",
                "username": "kelevaj",
                "profilePicture": "none"
            },
            "likes": [
                {
                    "username": "kelevaj",
                    "profilePicture": "none"
                }
            ],
            "isLiked": true,
            "likesNo": 1,
            "content": [
                "https://res.cloudinary.com/trio-code/image/upload/v1640673556/bsj5cgor6tybtjynb6go.jpg",
                "https://res.cloudinary.com/trio-code/image/upload/v1640673570/wkqwlhhorynijfmad0lr.jpg",
                "https://res.cloudinary.com/trio-code/image/upload/v1640673581/ylj4yhjauuxzxw71ovug.jpg"
            ],
            "commentNo": 2,
            "comments": [
                {
                    "user": {
                        "username": "kelevaj",
                        "profilePicture": "none"
                    },
                    "content": "I would love to pay a vist"
                },
                {
                    "user": {
                        "username": "sheezy",
                        "profilePicture": "none"
                    },
                    "content": "this is awesome"
                }
            ],
            "location": "Kigali,Rwanda",
            "createdAt": 1640673582673
        }
    }
}

19 User Remove Profile Picture-Mutation

Body

mutation ex {
    removeProfilePicture{
        message
    }
}

Response

{
    "data": {
        "removeProfilePicture": {
            "message": "Profile Picture Removed successfully"
        }
    }
}

20 User Change Password-Mutation

Body

mutation ex{
    changePassword(
        oldPassword:"123test"
        newPassword:"test123"
    ){
        message
    }
}

Response

{
    "data": {
        "changePassword": {
            "message": "Password Changed Succefully"
        }
    }
}

21 User UnLike Post-Mutation

Body

mutation ex {
    unLikePost(postId:"61cab12e91f1cd2ef9a16f26"){
        message
    }
}
Response
{
    "data": {
        "unLikePost": {
            "message": "Post Unliked Successfully"
        }
    }
}

22 User Search For Other User

Body

mutation ex{
    searchUser(
     search:"sheezy"
    ){
     firstname
    lastname
    username
    password
    email
    profilePicture
    isVerified
    role
    bio
    website
  createdAt
  }
}

Response

        "searchUser": [
            {
                "firstname": "Habiman",
                "lastname": "Sharif",
                "username": "sheezy7",
                "password": null,
                "email": "[email protected]",
                "profilePicture": "none",
                "isVerified": "true",
                "role": null,
                "bio": "**No Biography**",
                "website": null,
                "createdAt": null
            },
            {
                "firstname": "Habiman",
                "lastname": "Sharif",
                "username": "sheezy",
                "password": null,
                "email": "[email protected]",
                "profilePicture": "none",
                "isVerified": "true",
                "role": null,
                "bio": "**No Biography**",
                "website": null,
                "createdAt": null
            }
        ]
    }
}

23 User Comment Post-Mutation

Body

mutation ex  {
    commentPost(
   postId: "61cab12e91f1cd2ef9a16f26"
    content:"this is awesome"
    )

    {
      message  
    }

Response

{
    "data": {
        "commentPost": {
            "message": "comment created successfully"
        }
    }
}

About

This is a tourism platiform for connecting tour guiders and tourists

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •