Skip to content

Commit 2b49016

Browse files
sumitra19jhadependabot[bot]palisadoesiamsaumyaHrishikesh-Bhagwat
authored
Develop update (PalisadoesFoundation#301)
* Bump y18n from 4.0.0 to 4.0.1 Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] <[email protected]> * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * fix: Create INSTALLATION.md File (PalisadoesFoundation#220) * Updated INSTALLATION.md Node js is not needed for Docker installation * Deleted docs folder * Fixes PalisadoesFoundation#222 * Add files via upload * Update CONTRIBUTING.md * Update CONTRIBUTING.md * Update PR-guidelines.md * Update CONTRIBUTING.md * Update issue.yml * Bump hosted-git-info from 2.8.8 to 2.8.9 Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](npm/hosted-git-info@v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] <[email protected]> * Create linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Create test.js * Update test.js * Update test.js * Update test.js * Update test.js * Update test.js * Update linter.yml * Update linter.yml * Delete test.js * Update linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Update linter.yml * Create lint.yml * Update linter.yml * Delete lint.yml * Update linter.yml * bug issue#223 resolved * bug fix issue PalisadoesFoundation#223 * Delete chats.spec.js * Delete chats.spec.dev.js * Create chats.spec.js * Updated branching strategy in CONTRIBUTING.md * bug: PalisadoesFoundation#253 netmask bump * bug: PalisadoesFoundation#253 netmask bump * Pagination for members of organization * feat: PalisadoesFoundation#263 Added i18n, error interface library * bugFix: PalisadoesFoundation#254 Bumped up node-notifier * feat: PalisadoesFoundation#263 fixed error objects * feat: PalisadoesFoundation#263 fixed naming conventions * feat: PalisadoesFoundation#263 fixed linting * feat: PalisadoesFoundation#263 fixed errors * feat: PalisadoesFoundation#263 format graphql error object * feat: PalisadoesFoundation#263 Fixed plural validation error handling * feat: PalisadoesFoundation#263 Added util function * feat: PalisadoesFoundation#263 Added hindi translations * feat: PalisadoesFoundation#263 Added hindi translations * feat: PalisadoesFoundation#263 Added comments for error classes * feat: PalisadoesFoundation#263 Added ['hi', 'en', 'zh', 'fr', 'sp'] supported languages * feat: PalisadoesFoundation#263 Packaged errors and talawa-request-context as library * feat: PalisadoesFoundation#263 Packaged errors and talawa-request-context as library * feat: PalisadoesFoundation#263 Fixed eslint errors * Update pull_request_template.md * Feature/logging (PalisadoesFoundation#267) * feat: PalisadoesFoundation#264 logger * feat: PalisadoesFoundation#264 removed nanoid * feat: PalisadoesFoundation#264 added custom libs * feat: PalisadoesFoundation#264 added custom libs * feat: PalisadoesFoundation#264 removed request tracing * feat: PalisadoesFoundation#264 Used custom lib logger * feat: PalisadoesFoundation#264 Compatible request tracing via logger * feat: PalisadoesFoundation#264 Logging error message * Update Installation.md (PalisadoesFoundation#270) Clarify more with the required steps for installation. * Pagination added for posts by organisation (PalisadoesFoundation#273) * pagination added for posts by org * es lint fix * Model and Schema update for appLanguage (PalisadoesFoundation#281) * model and schema update * language update mutation added * language code added * lng * bugFix: PalisadoesFoundation#288 ws package upgrade (PalisadoesFoundation#293) * bug fix : events can be removed by event admins or org admins only (PalisadoesFoundation#271) * bug fix : events can be removed by event admins or org admins only * replaced .filter method with .includes * replaced errors with error objects for translation * Schema Update to avoid master failure (PalisadoesFoundation#299) * changes for workflow update Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Peter Harrison <[email protected]> Co-authored-by: Saumya Pandey <[email protected]> Co-authored-by: Hrishikesh-Bhagwat <[email protected]> Co-authored-by: ShubhamBhardwaj <[email protected]> Co-authored-by: mihdas <[email protected]> Co-authored-by: ssaumyaa7 <[email protected]> Co-authored-by: DangaRanga <[email protected]> Co-authored-by: Jason Gayle <[email protected]> Co-authored-by: impiyush83 <[email protected]> Co-authored-by: Uttam kumar <[email protected]> Co-authored-by: Akshat Garg <[email protected]>
1 parent 6b4b670 commit 2b49016

File tree

141 files changed

+18745
-6516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+18745
-6516
lines changed

.env.sample

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 👋 Welcome, we're glad you're setting up an installation of Talawa-api. Copy this
2+
# file to .env or set the variables in your local environment manually.
3+
4+
5+
# Generate a unique random key, you can use `openssl rand -hex 32` in terminal
6+
ACCESS_TOKEN_SECRET=
7+
8+
# Generate a unique random key, you can use `openssl rand -hex 32` in terminal
9+
REFRESH_TOKEN_SECRET=
10+
11+
# if you are using DOCKER use this mongodb url
12+
# mongodb://mongo:27017/talawa-api
13+
# if you are using hosted mongodb, mongodb connection string will look like this
14+
# mongodb+srv://<username>:<password>@<server_url>/<db_name>?retryWrites=true&w=majority
15+
# for local instance use this connection string
16+
# mongodb://localhost:27017/<db_name>?retryWrites=true&w=majority
17+
18+
MONGO_DB_URL=
19+

.github/workflows/linter.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: PR workflow
2+
on: pull_request
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: stefanoeb/[email protected]
9+

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ nodemon.json
33
.idea/
44
.env
55
images/
6+
.vscode

.readthedocs.yml

-22
This file was deleted.

CODE_OF_CONDUCT.md

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual identity
11+
and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the
27+
overall community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or
32+
advances of any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email
36+
address, without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official e-mail address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at [The Palisadoes Foundation](http://www.palisadoes.org/)
64+
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series
87+
of actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or
94+
permanent ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within
114+
the community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.0, available at
120+
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127+
at [https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Thank you for your interest in contributing to Talawa API. Regardless of the siz
33

44
If you are new to contributing to open source, please read the Open Source Guides on [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/).
55

6+
## Code of Conduct
7+
A safe environment is required for everyone to contribute. Read our [Code of Conduct Guide](https://github.com/PalisadoesFoundation/talawa-api/blob/master/CODE_OF_CONDUCT.md) to understand what this means. Let us know immediately if you have unacceptable experiences in this area.
8+
9+
No one should fear voicing their opinion. Respones must be respectful.
10+
611
## Ways to Contribute
712
If you are ready to start contributing code right away, we have a list of [good first issues](https://github.com/PalisadoesFoundation/talawa-api/labels/good%20first%20issue) that contain issues with a limited scope.
813

@@ -27,16 +32,13 @@ Make sure you are following [issue report guidelines](https://github.com/Palisad
2732
#### Pull Requests
2833
[Pull Request guidelines](https://github.com/PalisadoesFoundation/talawa/blob/master/PR-guidelines.md) is best resource to follow to start working on open issues.
2934

30-
#### Git Flow
31-
For Talawa API, we utilize the GitFlow branching model. GitFlow is geared towards efficiently tracking development and managing releases. The model makes parallel development efforts easy and safe by isolating new development efforts from completed work.
35+
#### Branching Strategy
3236

33-
The different types of branches we may use are:
34-
* Feature branches (feature/branch-name)
35-
* Release branches (release/1.XX)
36-
* Bug branches (bugfix/branch-name)
37-
* Hotfix branches (hotfix/branch-name)
37+
For Talawa API, we had employed the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `master` branch:
3838

39-
Detailed document containing how GitFlow works: https://nvie.com/posts/a-successful-git-branching-model/
39+
- `develop`: For unstable code and bug fixing
40+
- `alpha-x.x.x`: For stability teesting
41+
- `master`: Where the stable production ready code lies
4042

4143
### Contributing Code
4244
Code contributions to Talawa come in the form of pull requests. These are done by forking the repo and making changes locally.
@@ -56,8 +58,15 @@ The process of proposing a change to Talawa API can be summarized as:
5658
10. Ensure the test suite passes, either locally or on CI once a PR has been created.
5759
11. Review and address comments on your pull request if requested.
5860

59-
### GSoC
60-
If you are participating in the 2021 Summer of Code, please read more about us and our processes [here](http://www.palisadoes.org/gsoc/)
61+
### Internships
62+
63+
We have internship partnerships with a number of organizations. See below for more details.
64+
65+
#### GSoC
66+
If you are participating in the 2021 Summer of Code, please read more about us and our processes [here](https://palisadoesfoundation.github.io/talawa-docs/docs/internships/gsoc/gsoc-introduction)
67+
68+
#### GitHub Externship
69+
If you are participating in the 2021 GitHub Externship, please read more about us and our processes [here](https://palisadoesfoundation.github.io/talawa-docs/docs/internships/github/github-introduction)
6170

6271
### Community
6372
The Palisadoes Foundation has a Slack channel where members can assist with support and clarification. Click [here](https://join.slack.com/t/thepalisadoes-dyb6419/shared_invite/zt-nk79xxlg-OxTdlrD7RLaswu8EO_Q5rg) to join our slack channel.

INSTALLATION.md

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Installation
2+
3+
Talawa API can be setup to run via `Docker` or node's default package manager `Npm`.
4+
5+
## Docker
6+
7+
Follow these steps to get the api running using docker
8+
9+
1. Install <strong>Docker</strong> if you have not installed it.
10+
2. Clone this repo to your local machine
11+
12+
```sh
13+
git clone https://github.com/PalisadoesFoundation/talawa-api
14+
cd talawa-api
15+
```
16+
17+
3. Create `.env` file in the root directory of the project
18+
`.env` file is used to store the secret or environment variables.
19+
20+
```sh
21+
touch .env
22+
```
23+
24+
4. Copy (ACCESS_TOKEN_SECRET= , REFRESH_TOKEN_SECRET= , MONGO_DB_URL= ) from the `.env.sample` to your local `.env` and fillup these credentials with your own randomly generated secrets.
25+
26+
5. You will have to set these variables in `.env` to provide the necessary secrets and connection url.
27+
28+
Please go through the .env.sample documentation accordingly and configure your `.env`.
29+
30+
- ACCESS_TOKEN_SECRET
31+
- REFRESH_TOKEN_SECRET
32+
- MONGO_DB_URL
33+
34+
6. Now that the enviornment variables are setup. Run the following commands in the terminal.
35+
36+
This command will build the docker image.
37+
38+
```sh
39+
sudo docker-compose build
40+
```
41+
42+
This command will run the container, just use the following command to run the server in future.
43+
44+
```sh
45+
sudo docker-compose up
46+
```
47+
48+
## Standard Installation
49+
50+
Follow these steps to get the api running using npm
51+
52+
1. Install these dependencies if you don't already have them
53+
- [MongoDB](https://docs.mongodb.com/manual/administration/install-community/)
54+
- [Nodejs](https://nodejs.org/en/)<br>
55+
<strong>Note:</strong><em>If you do not have MongoDB on your own system, you can proceed with the connection string. Please ensure the right access permissions and firewall openings for the VM/server where the MongoDB is hosted.</em>
56+
2. Clone this repo to your local machine
57+
58+
```sh
59+
git clone https://github.com/PalisadoesFoundation/talawa-api
60+
cd talawa-api
61+
npm install
62+
```
63+
64+
3. Create `.env` file in the root directory of the project
65+
`.env` file is used to store the secret or environment variables.
66+
67+
```sh
68+
touch .env
69+
```
70+
71+
4. Copy (ACCESS_TOKEN_SECRET= , REFRESH_TOKEN_SECRET= , MONGO_DB_URL= ) from the `.env.sample` to your local `.env` and fillup these credentials with your own randomly generated secrets.
72+
73+
5. Fill out the following fields:
74+
75+
- ACCESS_TOKEN_SECRET
76+
- REFRESH_TOKEN_SECRET
77+
- MONGO_DB_URL
78+
79+
Please go through the .env.sample documentation accordingly and configure your `.env`.
80+
81+
6. Install required node packages
82+
83+
```sh
84+
npm install
85+
```
86+
87+
7. Now that we have all the packages, execute the following command to run the server.
88+
89+
NB: You only have to execute the following command to run the server in future.
90+
91+
```sh
92+
npm run start
93+
```
94+
95+
## Testing
96+
97+
```sh
98+
npm run test
99+
```
100+
101+
### Standard Installation vs Docker
102+
103+
Docker downloads a lot of large images, if you are short on storage or with slow internet connection prefer using standard development installation.

PR-guidelines.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ In order to give everyone a chance to submit a pull request and contribute to th
66

77
1. Do not start working on any open issue and raise a PR unless it is assigned to you.
88
2. Pull requests must be based on [open issues](https://github.com/PalisadoesFoundation/talawa-api/issues) available.
9-
3. Each contributor may only create one pull request at a time. We have this rule in place due to our limited resources - if everyone was allowed to post multiple pull requests we will not be able to review them properly. It is also better for contributors because you can focus on creating one quality PR - so spend time making sure it is as good as it can be.
10-
4. If the pull request's code quality is not up to par, or it would break the app, it will more likely be closed. So please be careful when creating a PR.
11-
5. Please follow the [PR template](https://github.com/PalisadoesFoundation/talawa-api/blob/master/templates/pr-template.md). Ensure the PR title clearly describes the problem it is solving. In the description, include the relevant issue number, snapshots and videos after changes added.
12-
6. If you are borrowing code, please disclose it. It is fine and sometimes even recommended to borrow code, but we need to know about it to assess your work. If we find out that your pull request contains a lot of code copied from elsewhere, we will close the pull request.
13-
7. All pull request must have test units. If for some reason it is not possible to add tests, please let us know and explain why. In that case, you'll need to tell us what steps you followed to manually test your changes.
14-
8. No Work In Progress. ONLY completed and working pull requests, and with test units, will be accepted. A WIP would fall under rule 4 and be closed immediately.
15-
9. Please do not @mention contributors and mentors. Sometimes it takes time before we can review your pull request or answer your questions but we'll get to it sooner or later. @mentioning someone just adds to the pile of notifications we get and it won't make us look at your issue faster.
16-
10. Do not force push. If you make changes to your pull request, please simply add a new commit as that makes it easy for us to review your new changes. If you force push, we'll have to review everything from the beginning.
17-
11. PR should be small, easy to review and should follow standard coding styles.
18-
12. If PR has conflicts because of recently added changes to the same file, resolve issues, test new changes and submit PR again for review.
19-
13. PRs should be atomic. That is, they should address one item (issue or feature)
20-
14. After submitting PR, if you are not replying within 48 hours then in that case we may need to assign issue to other contributors based on priority of the issue.
9+
3. [Use this method to automatically close the issue when the PR is completed.](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue)
10+
4. Each contributor may only create one pull request at a time. We have this rule in place due to our limited resources - if everyone was allowed to post multiple pull requests we will not be able to review them properly. It is also better for contributors because you can focus on creating one quality PR - so spend time making sure it is as good as it can be.
11+
5. If the pull request's code quality is not up to par, or it would break the app, it will more likely be closed. So please be careful when creating a PR.
12+
6. Please follow the [PR template](https://github.com/PalisadoesFoundation/talawa-api/blob/master/templates/pr-template.md). Ensure the PR title clearly describes the problem it is solving. In the description, include the relevant issue number, snapshots and videos after changes added.
13+
7. If you are borrowing code, please disclose it. It is fine and sometimes even recommended to borrow code, but we need to know about it to assess your work. If we find out that your pull request contains a lot of code copied from elsewhere, we will close the pull request.
14+
8. All pull request must have test units. If for some reason it is not possible to add tests, please let us know and explain why. In that case, you'll need to tell us what steps you followed to manually test your changes.
15+
9. No Work In Progress. ONLY completed and working pull requests, and with test units, will be accepted. A WIP would fall under rule 4 and be closed immediately.
16+
10. Please do not @mention contributors and mentors. Sometimes it takes time before we can review your pull request or answer your questions but we'll get to it sooner or later. @mentioning someone just adds to the pile of notifications we get and it won't make us look at your issue faster.
17+
11. Do not force push. If you make changes to your pull request, please simply add a new commit as that makes it easy for us to review your new changes. If you force push, we'll have to review everything from the beginning.
18+
12. PR should be small, easy to review and should follow standard coding styles.
19+
13. If PR has conflicts because of recently added changes to the same file, resolve issues, test new changes and submit PR again for review.
20+
14. PRs should be atomic. That is, they should address one item (issue or feature)
21+
15. After submitting PR, if you are not replying within 48 hours then in that case we may need to assign issue to other contributors based on priority of the issue.

0 commit comments

Comments
 (0)