Skip to content

Orion-Software-Engineering/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orion Meet Backend

⚡Express


Production ✨

Reviewed and tested stable app version https://orion-meet.herokuapp.com/

Testing đź’«

Staging area for new features https://orion-meet-testing.herokuapp.com/



API Documentation

Main URL: https://orion-meet.herokuapp.com/

Sign In

End Point: /api/auth/signin
Method: POST
Request Body:

{
    "username" : " ",
    "password" : " "
}

Response: 200 Ok

{
    "roles": [
        " "
    ],
    "id": "",
    "username": "",
    "email": " ",
    "accessToken": ""
}

Sign Up

End Point: /api/auth/signup
Method: POST
Request Body:

NB: with gender male == true and female == false

{
    "username": " ",
    "email": " ",
    "password": " ",
    "dob": " ",
    "gender": "true",
    "roles": [
        " ",
        " ",
        " "
    ]
}

NB: When user signs up a mail is sent to their email address for email verification. For calls made from the app, roles... should be omitted.
Response: 200 Ok

{
    "message": "user registered successfully",
    "userId": " "
}

NB: When user signs up a mail is sent to their email address for email verification. For calls made from the app, roles... should be ommitted.

Request For Re-setting Password

End Point: /api/resetPassword
Method: POST
Request Body:

{
    "email": " "
}

Response: 200 Ok
Password Reset link has been sent to your mail.

Request For Admin Content

End Point: /api/test/admin
Method: GET
Request Header:

Host
User-Agent
Accept
Accept-Encoding
Connection
x-access-token

NB: In Request headers access token for the admin should be set in order to make a successful request.

Request For Public Content

End Point: /api/test/all
Method: GET
Request Header:

Host
User-Agent
Accept
Accept-Encoding
Connection

Request For Moderator Content

End Point: /api/test/mod
Method: GET
Request Header:

Host
User-Agent
Accept
Accept-Encoding
Connection
x-access-token

Request For User Content

End Point: /api/test/all
Method: GET
Request Header:

Host
User-Agent
Accept
Accept-Encoding
Connection
x-access-token

Get User Matches

End Point: /api/test/matches/ID
Method: GET
No request body.

Listing All Users

End Point: /api/test/users
Method: GET
Request Headers:

x-acces-token

Response: 200 Ok

{
    "users": [
        {
            "id": " ",
            "username": " ",
            "password": " ",
            "dateOfBirth": " ",
            "isMailVerified": " ",
            "createdAt": " ",
            "updatedAt": " "
        }
    ]
}

Get Username From ID

End Point: /api/user
Method: GET
Request Body:

{
    "userId": ""
}

Get User Profile

End Point: /api/user/profile/ID
Method: GET
Request Body: null

Update User Bio

End Point: /api/user/bio
Method: POST
Request Body:

{
    "userId": "",
    "bio": ""
}

Interests

NB: "ID" is the user ID for the user.

Get Interests Of A User.

End Point: /api/interest/ID
Method: GET

Set Interests Of A User.

End Point: /api/interest/ID
Method: POST
Request Body:

{
    "interests": [
        "sports",
        "photography",
        "comedy"
    ]
}

Response: 200 Ok

[
    [
        {
            "userId": " ",
            "roleId": " ",
            "createdAt": " ",
            "updatedAt": " "
        }
    ]
]

Adding Interests For A User.

End Point: /api/interests/ID
Method: PUT
Request Body:

{
    "interests": [
        "science"
    ]
}

Response: 200 Ok

[
    {
        "userId": " ",
        "roleId": " ",
        "createdAt": " ",
        "updatedAt": " "
    }
]

Removing Interests For A Particular User.

End Point: /api/interests/ID
Method: DELETE
Request Body:

{
    "interests": [
        "sorts"
    ]
}

Location

Get Location

End Point: /api/user/location/:userId
Method: GET
No Request body:

{
  "latitude": "",
  "longitude": ""
}

Update User Location

End Point: /api/user/location
Method: POST
Request body:

{
  "userId": "",
  "latitude": "",
  "longitude": ""
}

Get Matches Based On Location

End Point: /api/test/match/location/:id
Method: GET
No Request body:

{
  "userId": "",
  "username": "",
  "bio": "",
  "proximity": ""
}

Instant Messaging

Create Conversation

End Point: /api/conversation/
Method: PUT
Request Body:

{
    "userId": ""
}

Get Conversation

End Point: /api/conversation/:conversationId
Method: GET
Request Body: null

Get Message

End Point: /api/message/ID
Method: GET
Request Body: null

Get Messages From Conversation

End Point: /api/messages/ID
Method: GET
Request Body: null

Get Last Message From Conversation

End Point: /api/message/last/:ID
Method: GET
Request Body: null

Add Message To Conversation

End Point: /api/messages/
Method: PUT
Request Body:

{
    "userId": "",
    "messageText": "",
    "conversationId": ""
}

Remove Message From Conversation

End Point: /api/message
Method: DELETE
Request Body:

{
    "messageId": ""
}

Response: 200 Ok
1

Add User To Conversation

End Point: /api/conversation/user
Method: PUT
Request Body:

{
    "userId": "",
    "conversationId": ""
}

Events

Upload Event

End Point: /api/event
Method: POST
Request Body:

{
    "name": "",
    "date": "",
    "time": "",
    "venue": "",
    "location":  "longitude latitude",
    "organizers": "",
    "mcs": "",
    "guests": "",
    "age_restriction": "",
    "description": "",
    "organizer": "",
    "cover_image": "",
    "ticket_price": decimal,
    "interests": [
        "",
        "",
        ""
    ]
}

Get Event

End Point: /api/event/id
Method: GET

Get All Events

End Point: /api/events
Method: GET

Delete Event

End Point: /api/event/id
Method: DELETE

Update Event

End Point: /api/event/id
Method: PUT
Request Body:

{
    "name": "",
    "date": "",
    "time": "",
    "venue": "",
    "location": "latitude longitude",
    "organizers": "",
    "mcs": "",
    "guests": "",
    "age_restriction": "",
    "description": "",
    "organizer": "",
    "cover-image": "",
    "ticket_price": decimal,
    "interests": [
        "",
        "",
        ""
    ]
}

Get event matches

End Point: /api/events/:id
Method: GET
No Request Body.

Like an event

End Point: /api/event/like
Method: POST
Request Body:

{
  "eventId": "",
  "userId": ""
}

Unlike and event

End Point: /api/event/unlike
Method: POST
Request Body:

{
  "eventId": "",
  "userId": ""
}

Get number of likes for an event

End Point: /api/event/likes/:id
Method: GET
No Request Body

Remove User From Conversation

End Point: /api/conversation/user
Method: DELETE
Request Body:

{
    "userId": "",
    "conversationId": ""
}

Get Users of Conversation

End Point: /api/conversation/users/all/ID
Method: GET
Request Body: null

Get Conversations Of User

End Point: /api/conversation/user/all/ID
Method: GET
Request Body: null

Delete user Account

End Point: /api/account/delete
Method: POST
Request Body:

{
  "usedId" : "",
  "username": "",
  "password": ""
}

About

Repository for the backend of Orion Meet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages