KWoC Backend (2.0.0)

Download OpenAPI specification:Download

KWoC Backend API written in go

Checks api health

Returns a simple string to check if the api is up and running

Responses

Checks the health status of the server and database.

The HealthCheck endpoint examines the operational status of the server and the associated database.

Responses

ping

Ping responds with "pong" and returns the latency

Responses

Fetch Mentor Details

Get mentor details for logged in mentor

Authorizations:
JWT

Responses

Response samples

Content type
application/json
{
  • "createdAt": "string",
  • "deletedAt": {
    },
  • "email": "string",
  • "id": 0,
  • "name": "string",
  • "updatedAt": "string",
  • "username": "string"
}

Fetches the mentor dashboard

Fetches the required details for the mentor dashboard

Authorizations:
JWT

Responses

Response samples

Content type
application/json
{
  • "email": "string",
  • "name": "string",
  • "projects": [
    ],
  • "students": [
    ],
  • "username": "string"
}

Update Mentor Details

Update mentor details for logged in mentor

Authorizations:
JWT
Request Body schema: application/json
required

Fields required for Mentor update.

email
string
name
string

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "name": "string"
}

Response samples

Content type
application/json
[
  • "string"
]

OAuth Authentication

Authenticates a user throught Github OAuth.

Request Body schema: application/json
required

Fields required for authentication.

code
string

Code generated by Github OAuth

type
string

mentor or student

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "type": "string"
}

Response samples

Content type
application/json
{
  • "college": "string",
  • "email": "string",
  • "is_new_user": true,
  • "jwt": "string",
  • "name": "string",
  • "type": "string",
  • "username": "string"
}

Fetches user profile

Fetches the user's profile from the JWT, if it is valid. If invalid, returns an error.

Authorizations:
JWT

Responses

Response samples

Content type
application/json
{
  • "email": "string",
  • "name": "string",
  • "type": "string",
  • "username": "string"
}

Fetches all Projects

Fetches the public details for all the Projects

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Register a Project

Register a new project with the provided details.

Authorizations:
JWT
Request Body schema: application/json
required

Fields required for project registeration

comm_channel
string

Link to a communication channel/platform

description
string

Description for the project

mentor_username
string

Mentor's username

name
string

Name of the project

readme_link
string

Link to the project's README file

repo_link
string

Link to the repository of the project

secondary_mentor_username
string

Secondary mentor's username

tags
Array of strings

List of tags for the project

Responses

Request samples

Content type
application/json
{
  • "comm_channel": "string",
  • "description": "string",
  • "mentor_username": "string",
  • "name": "string",
  • "readme_link": "string",
  • "repo_link": "string",
  • "secondary_mentor_username": "string",
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "status_code": 0
}

Update Project Details

Update project details for the provided project ID.

Authorizations:
JWT
Request Body schema: application/json
required

Fields required for Project update.

comm_channel
string

Link to a communication channel/platform

description
string

Description for the project

id
integer

Id of the project in the database (required)

mentor_username
string

Mentor's username

name
string

Name of the project

readme_link
string

Link to the project's README file

repo_link
string

Link to the repository of the project

secondary_mentor_username
string

Secondary mentor's username (if updated)

tags
Array of strings

List of tags for the project

Responses

Request samples

Content type
application/json
{
  • "comm_channel": "string",
  • "description": "string",
  • "id": 0,
  • "mentor_username": "string",
  • "name": "string",
  • "readme_link": "string",
  • "repo_link": "string",
  • "secondary_mentor_username": "string",
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "status_code": 0
}

Fetches Project Details

Fetches all the details for the Project with the provided ID provided the logged in user owns the project.

Authorizations:
JWT
path Parameters
id
required
integer

Project ID

Responses

Response samples

Content type
application/json
{
  • "comm_channel": "string",
  • "description": "string",
  • "id": 0,
  • "mentor": {
    },
  • "name": "string",
  • "readme_link": "string",
  • "repo_link": "string",
  • "secondary_mentor": {
    },
  • "tags": [
    ]
}

Fetches Overall Stats

Fetches overall stats from the database.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Fetches all Project Stats

Fetches all project stats from the database.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Fetches all Student Stats

Fetches all student stats from the database.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Submit blog link

submit a blog link for a student requires login

Authorizations:
JWT
Request Body schema: application/json
required

Fields required for student bloglink

blog_link
string
username
string

Responses

Request samples

Content type
application/json
{
  • "blog_link": "string",
  • "username": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "status_code": 0
}

Fetches the student dashboard

Fetches the required details for the student dashboard

Authorizations:
JWT

Responses

Response samples

Content type
application/json
{
  • "blog_link": "string",
  • "college": "string",
  • "commit_count": 0,
  • "languages_used": [
    ],
  • "lines_added": 0,
  • "lines_removed": 0,
  • "name": "string",
  • "passed_end_evals": true,
  • "passed_mid_evals": true,
  • "projects_worked": [
    ],
  • "pull_count": 0,
  • "pulls": [
    ],
  • "username": "string"
}

Register a student

Register a new student with the provided details.

Authorizations:
JWT
Request Body schema: application/json
required

Fields required for student registeration

college
string
email
string
name
string
username
string

Responses

Request samples

Content type
application/json
{
  • "college": "string",
  • "email": "string",
  • "name": "string",
  • "username": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "status_code": 0
}