Skip to content

Commit

Permalink
Updated talawa api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anwersayeed committed Aug 4, 2024
1 parent ca1fa03 commit bc72e7d
Show file tree
Hide file tree
Showing 1,267 changed files with 7,743 additions and 7,665 deletions.
4 changes: 2 additions & 2 deletions docs/talawa-api-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Core features include:

## Table of Contents

\<!-- toc --\>
<!-- toc -->

- [Talawa Components](#talawa-components)
- [Documentation](#documentation)
- [Videos](#videos)

\<!-- tocstop --\>
<!-- tocstop -->

## Talawa Components

Expand Down
4 changes: 2 additions & 2 deletions docs/talawa-api-docs/_media/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Table of Contents

\<!-- toc --\>
<!-- toc -->

- [Our Pledge](#our-pledge)
- [Our Standards](#our-standards)
Expand All @@ -16,7 +16,7 @@
- [4. Permanent Ban](#4-permanent-ban)
- [Attribution](#attribution)

\<!-- tocstop --\>
<!-- tocstop -->

## Our Pledge

Expand Down
48 changes: 24 additions & 24 deletions docs/talawa-api-docs/_media/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If you are new to contributing to open source, please read the Open Source Guide

## Table of Contents

\<!-- toc --\>
<!-- toc -->

- [Code of Conduct](#code-of-conduct)
- [Ways to Contribute](#ways-to-contribute)
Expand All @@ -33,7 +33,7 @@ If you are new to contributing to open source, please read the Open Source Guide
- [Internships](#internships)
- [Community](#community)

\<!-- tocstop --\>
<!-- tocstop -->

## Code of Conduct

Expand Down Expand Up @@ -94,7 +94,7 @@ Make sure you have read the [Documentation for Setting up the Project](INSTALLAT
The process of proposing a change to Talawa API can be summarized as:

1. Fork the Talawa API repository and branch off `develop`.
1. Your newly forked repository can be cloned locally using `git clone \<YOUR FORKED REPO URL\>`.
1. Your newly forked repository can be cloned locally using `git clone <YOUR FORKED REPO URL>`.
1. Make the Palisadoes Foundation's repo your `git upstream` for your local repo.
1. Make the desired changes to the Talawa API source.
1. Run the app and test your changes.
Expand All @@ -110,7 +110,7 @@ The process of proposing a change to Talawa API can be summarized as:
```
2. Test using these commands (Single test):
```
npm run test -- -t \<Name_of_Test\>
npm run test -- -t <Name_of_Test>
```
3. Here are some useful testing resources:
1. Documentation:
Expand Down Expand Up @@ -139,9 +139,9 @@ The process of proposing a change to Talawa API can be summarized as:
3. Remember to add the `Repository Upload Token` for your forked repo. This can be found under `Settings` of your `codecov.io` account.
4. Use the value of this token to create a secret named CODE_COV for your forked repo.
5. You will see your code coverage reports with every push to your repo after following these steps
1. After making changes you can add them to git locally using `git add \<file_name\>`(to add changes only in a particular file) or `git add .` (to add all changes).
1. After adding the changes you need to commit them using `git commit -m '\<commit message\>'`(look at the commit guidelines below for commit messages).
1. Once you have successfully commited your changes, you need to push the changes to the forked repo on github using: `git push origin \<branch_name\>`.(Here branch name must be name of the branch you want to push the changes to.)
1. After making changes you can add them to git locally using `git add <file_name>`(to add changes only in a particular file) or `git add .` (to add all changes).
1. After adding the changes you need to commit them using `git commit -m '<commit message>'`(look at the commit guidelines below for commit messages).
1. Once you have successfully commited your changes, you need to push the changes to the forked repo on github using: `git push origin <branch_name>`.(Here branch name must be name of the branch you want to push the changes to.)
1. Now create a pull request to the Talawa repository from your forked repo. Open an issue regarding the same and link your PR to it.
1. Ensure the test suite passes, either locally or on CI once a PR has been created.
1. Review and address comments on your pull request if requested.
Expand All @@ -154,21 +154,21 @@ To do we will help you setup an upstream and origin for your repository, which w

#### Setting up Upstream and Origin

After cloning your forked repository, your origin remote is pointing to your fork (`\{\{GITHUB USERNAME\}\}/talawa-api`). To stay up to date with the main `PalisadoesFoundation/talawa-api` repository, add it as a remote called upstream. You'll first need to move into the `talawa-api` directory that was created by the clone operation.
After cloning your forked repository, your origin remote is pointing to your fork (`{{GITHUB USERNAME}}/talawa-api`). To stay up to date with the main `PalisadoesFoundation/talawa-api` repository, add it as a remote called upstream. You'll first need to move into the `talawa-api` directory that was created by the clone operation.

```
$ cd talawa-api
$ git remote add upstream https://github.com/PalisadoesFoundation/talawa-api.git
$ git remote -v
origin https://github.com/\{\{GITHUB USERNAME\}\}/talawa-api.git (fetch)
origin https://github.com/\{\{GITHUB USERNAME\}\}/talawa-api (push)
origin https://github.com/{{GITHUB USERNAME}}/talawa-api.git (fetch)
origin https://github.com/{{GITHUB USERNAME}}/talawa-api (push)
upstream https://github.com/PalisadoesFoundation/talawa-api.git (fetch)
upstream https://github.com/PalisadoesFoundation/talawa-api.git (push)
```

The git remote -v command at the end shows all your current remotes.

Now you can pull in changes from `PalisadoesFoundation/talawa-api` by running `git pull upstream \{\{branch\}\}` and push your changes to your fork by running `git push origin \{\{branch\}\}`.
Now you can pull in changes from `PalisadoesFoundation/talawa-api` by running `git pull upstream {{branch}}` and push your changes to your fork by running `git push origin {{branch}}`.

We have established a clean setup now. We can make any changes we like and push it to this forked repository, and then make a pull request for getting the changes merged into the original repository. Here's a nice picture explaining the process ([image source](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki/Lesson-Save-your-Code-Revisions-Forever-with-Git)).

Expand All @@ -184,31 +184,31 @@ git fetch upstream
git reset upstream/develop --hard
```

Now we make a new branch (with `git checkout -b \{\{ BRANCH_NAME \}\}` ), do the changes on the branch, add and commit them (with `git add . && git commit -m \{\{ COMMIT_MESSAGE \}\}` ), push the branch to forked repository (with `git push origin \{\{ BRANCH_NAME \}\} --force` ), and make a PR from Github interface (from our new branch to the `develop` branch of `PalisadoesFoundation/talawa-api` s).
Now we make a new branch (with `git checkout -b {{ BRANCH_NAME }}` ), do the changes on the branch, add and commit them (with `git add . && git commit -m {{ COMMIT_MESSAGE }}` ), push the branch to forked repository (with `git push origin {{ BRANCH_NAME }} --force` ), and make a PR from Github interface (from our new branch to the `develop` branch of `PalisadoesFoundation/talawa-api` s).

We use a different branch to make changes so that we can work on multiple issues while still having a clean version in develop branch.

## Type checking and code quality

On making a PR, we use GitHub actions to check that your code is properly formatted, doesn't have typescript type errors and is properly linted. Here are the checks:-

\<br/\>
<br/>

### Type checking code files

\<br/\>
<br/>

We make use of official typescript compiler(tsc) to check the codebase for type errors.

To check for type errors use this command:-

npm run typecheck

\<br/\>
<br/>

### Linting code files

\<br/\>
<br/>

We make use of `eslint` to enforce a strict linting convention in code.

Expand All @@ -222,11 +222,11 @@ To check and fix lint errors in code use this command:-

Eslint might throw lint errors even after running the `lint:fix` command as those lint errors require manual intervention to be fixed. You have to fix those lint errors manually.

\<br/\>
<br/>

### Formatting code files

\<br/\>
<br/>

We make use of `prettier` to enforce a strict formatting convention in code.

Expand All @@ -238,7 +238,7 @@ To fix formatting issues in code use this command:-

npm run format:fix

\<br/\>
<br/>

### Generating Table of Contents

Expand All @@ -255,16 +255,16 @@ npx markdown-toc -i README.md
```

Remember to replace `README.md` with the name of the file you want to generate table of contents for.
\</br\>
</br>
For more information on how to use `markdown-toc` package, visit [this link](https://www.npmjs.com/package/markdown-toc).

### Automation using husky

\<br/\>
<br/>

We are using the package `Husky` to run git hooks that run according to different git workflows.

\<br/\>
<br/>

#### Pre-Commit hook

Expand All @@ -274,7 +274,7 @@ If you don't want these pre-commit checks running on each commit, you can manual

git commit -m "commit message" --no-verify

\<br/\>
<br/>

#### Post-Merge hook

Expand All @@ -284,7 +284,7 @@ If you don't want this hook to run, you can manually opt out of this using the `

git pull --no-verify

\<br/\>
<br/>

### GraphQL Voyager

Expand Down
32 changes: 16 additions & 16 deletions docs/talawa-api-docs/_media/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document provides instructions on how to set up and start a running instanc

# Table of Contents

\<!-- TOC --\>
<!-- TOC -->

- [Talawa-API Installation](#talawa-api-installation)
- [Table of Contents](#table-of-contents)
Expand Down Expand Up @@ -77,7 +77,7 @@ This document provides instructions on how to set up and start a running instanc
- [Changing default talawa-api port](#changing-default-talawa-api-port)
- [Testing](#testing)

\<!-- toc --\>
<!-- toc -->

- [Installation Steps Summary](#installation-steps-summary)
- [Prerequisites](#prerequisites)
Expand Down Expand Up @@ -150,7 +150,7 @@ This document provides instructions on how to set up and start a running instanc
- [Changing default talawa-api port](#changing-default-talawa-api-port)
- [Testing](#testing)

\<!-- tocstop --\>
<!-- tocstop -->

# Installation Steps Summary

Expand Down Expand Up @@ -197,9 +197,9 @@ First you need a local copy of `talawa-api`. Run the following command in the di

![Image of user's clone](public/markdown/images/install2.png)

1. Clone the repository to your local computer (replacing the values in `\{\{\}\}`):
1. Clone the repository to your local computer (replacing the values in `{{}}`):
```bash
$ git clone https://github.com/\{\{YOUR GITHUB USERNAME\}\}/talawa-api.git
$ git clone https://github.com/{{YOUR GITHUB USERNAME}}/talawa-api.git
cd talawa-api
git checkout develop
```
Expand Down Expand Up @@ -632,7 +632,7 @@ Your MongoDB installation may include either the `mongo` or `mongosh` command li
There are a few more steps that need to be done in a Windows environment.

1. Download the MongoDB Shell from the tools section at the following link:[Mongo Shell](https://www.mongodb.com/try/download/shell)
1. Extract the downloaded shell folder, locate the `mongosh` application, and paste it to the following location: `Program Files` -\> `MongoDB` -\> `bin`.
1. Extract the downloaded shell folder, locate the `mongosh` application, and paste it to the following location: `Program Files` -> `MongoDB` -> `bin`.
1. You will find the mongosh application inside the `bin` folder]
1. Add the path of the location where you pasted the `mongosh` application to your system's environment variables.
1. In a separate terminal, run the `mongod` command to start the local instance of the database.
Expand Down Expand Up @@ -779,15 +779,15 @@ If the parameter value is set to `true`, you should be able to see colorized log
There are different logging levels that can be configured by setting this parameter. The severity order of levels are displayed numerically ascending from most important to least important.

```
levels = \{
levels = {
error: 0,
warn: 1,
info: 2,
http: 3,
verbose: 4,
debug: 5,
silly: 6
\}
}
```

On setting this parameter value, log messages are displayed in the console only if the `message.level` is less than or equal to the `LOG_LEVEL` set.
Expand Down Expand Up @@ -877,7 +877,7 @@ These are some important URLs for coding and troubleshooting :
- If you navigate to the endpoint you and see a `JSON` response like this it means talawa-api is running successfully:
```
\{"talawa-version":"v1","status":"healthy"\}
{"talawa-version":"v1","status":"healthy"}
```
2. The graphQL endpoint for handling `queries` and `mutations` is this:
Expand Down Expand Up @@ -915,7 +915,7 @@ If Talawa Mobile App is installed on a Real Mobile Device, follow the below step
1. Now, use this IP address (`192.168.0.105` in our case) to access the API instance using the following URL pattern:

```
http://\{IP_Address\}:4000/graphql
http://{IP_Address}:4000/graphql
```

For example:
Expand Down Expand Up @@ -1001,15 +1001,15 @@ You can skip these instructions for now if you don't have running instance of Ta
2. In the `mongosh` terminal use the following commands to edit the `appuserprofiles` collections data:
1. Find the user:
```
const currentUser = db.users.findOne(\{ firstName: '\<user's first name\>'\})
const currentUser = db.users.findOne({ firstName: '<user's first name>'})
```
2. Elevate permission of this user in its `AppUserProfile`, i.e. set `isSuperAdmin` to `true`:
```
db.appuserprofiles.updateOne(\{ _id_: currentUser.appUserProfileId \},\{ $set: \{ isSuperAdmin: true \}\})
db.appuserprofiles.updateOne({ _id_: currentUser.appUserProfileId },{ $set: { isSuperAdmin: true }})
```
3. To verify the details were updated correctly use:
```
db.appuserprofiles.findOne(\{ _id_: currentUser.appUserProfileId \})
db.appuserprofiles.findOne({ _id_: currentUser.appUserProfileId })
```
**Note**: You can make the edit via any of these two methods.
Expand All @@ -1023,15 +1023,15 @@ These are some other factors to consider
If port `4000` is not free on your system you can pass a custom environment variable named `PORT` to the script to make it use a different port on your system's localhost. Here's the syntax for it:
```
PORT=\<CUSTOM_PORT_VALUE\> npm run dev
PORT=<CUSTOM_PORT_VALUE> npm run dev
```
where `\<CUSTOM_PORT_VALUE\>` is whatever value you want the `PORT` to be.
where `<CUSTOM_PORT_VALUE>` is whatever value you want the `PORT` to be.
Whatever you pass will be substituted as the value for port and talawa-api development server on that port.
```
http://localhost:\<CUSTOM_PORT_VALUE\>/
http://localhost:<CUSTOM_PORT_VALUE>/
```
For example using this command:
Expand Down
4 changes: 2 additions & 2 deletions docs/talawa-api-docs/_media/ISSUE_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In order to give everyone a chance to submit a issues reports and contribute to

## Table of Contents

\<!-- toc --\>
<!-- toc -->

- [Issue Management](#issue-management)
- [New Issues](#new-issues)
Expand All @@ -17,7 +17,7 @@ In order to give everyone a chance to submit a issues reports and contribute to
- [Monitoring the Creation of New Issues](#monitoring-the-creation-of-new-issues)
- [General Guidelines](#general-guidelines)

\<!-- tocstop --\>
<!-- tocstop -->

---

Expand Down
4 changes: 2 additions & 2 deletions docs/talawa-api-docs/_media/PR_GUIDELINES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## Table of Contents

\<!-- toc --\>
<!-- toc -->

- [Pull Request Guidelines](#pull-request-guidelines)
- [Pull Requests and Issues](#pull-requests-and-issues)
- [Testing](#testing)
- [Pull Request Processing](#pull-request-processing)
- [Only submit PRs against our `develop` branch, not the default `main` branch](#only-submit-prs-against-our-develop-branch-not-the-default-main-branch)

\<!-- tocstop --\>
<!-- tocstop -->

# Pull Request Guidelines

Expand Down
8 changes: 4 additions & 4 deletions docs/talawa-api-docs/app/functions/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## default(req, res)

\> **default**(`req`, `res`): `any`
> **default**(`req`, `res`): `any`
Express instance itself is a request handler, which could be invoked without
third argument.
Expand All @@ -25,11 +25,11 @@ third argument.

### Defined in

[src/app.ts:14](https://github.com/PalisadoesFoundation/talawa-api/blob/1f38da5423898626c6ebfa24896a9c3d008195c6/src/app.ts#L14)
[src/app.ts:14](https://github.com/PalisadoesFoundation/talawa-api/blob/6712e9940a5702665afc506fa9f6e9d7e1dc7991/src/app.ts#L14)

## default(req, res, next)

\> **default**(`req`, `res`, `next`): `void`
> **default**(`req`, `res`, `next`): `void`
### Parameters

Expand All @@ -45,4 +45,4 @@ third argument.

### Defined in

[src/app.ts:14](https://github.com/PalisadoesFoundation/talawa-api/blob/1f38da5423898626c6ebfa24896a9c3d008195c6/src/app.ts#L14)
[src/app.ts:14](https://github.com/PalisadoesFoundation/talawa-api/blob/6712e9940a5702665afc506fa9f6e9d7e1dc7991/src/app.ts#L14)
Loading

0 comments on commit bc72e7d

Please sign in to comment.