Skip to content

Commit

Permalink
Added online installation documentation (#2912)
Browse files Browse the repository at this point in the history
* Removed tutorials

* Added the auto-docs

* Updated push.yml
  • Loading branch information
palisadoes authored Jan 26, 2025
1 parent 6c201af commit 836c461
Show file tree
Hide file tree
Showing 410 changed files with 5,133 additions and 644 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
# Create .env file for Talawa API testing environment
- name: Create .env file for Talawa API testing environment
run: cp ./envFiles/.env.ci ./.env

# Setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8.6.12
# Build Talawa API compose testing environment
- name: Build Talawa API compose testing environment
run: docker compose build

# Run tests
- name: Run tests
run: docker compose up --exit-code-from api

# Install dependencies and run tests
- name: Run Tests and Upload Coverage to Codecov
# Copy coverage from container
- name: Copy coverage from container
run: |
pnpm install --frozen-lockfile
pnpm run test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CONTAINER_ID=$(docker ps -aq --filter "ancestor=talawa-api")
docker cp $CONTAINER_ID:/home/talawa/api/coverage ./coverage
# Upload coverage to Codecov
- name: Upload Coverage to Codecov
Expand All @@ -41,3 +39,10 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
files: ./coverage/lcov.info

# Test acceptable level of code coverage
- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v2
with:
path: "./coverage/lcov.info"
min_coverage: 39.0
39 changes: 15 additions & 24 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,26 @@

Welcome to our documentation guide. Here are some useful tips you need to know!

## Table of Contents
# Table of Contents

<!-- toc -->

- [Where to find our documentation](#where-to-find-our-documentation)
- [How to use Docusaurus](#how-to-use-docusaurus)
- [Other information](#other-information)
- [Documentation](#documentation)
- [Table of Contents](#table-of-contents)
- [Where to find our documentation](#where-to-find-our-documentation)

<!-- tocstop -->

## Where to find our documentation

Our documentation can be found in ONLY TWO PLACES:

1. **_Inline within the repository's code files_**: We have automated processes to extract this information and place it in our Talawa documentation site [docs.talawa.io](https://docs.talawa.io/).
1. **_In our `talawa-docs` repository_**: Our [Talawa-Docs](https://github.com/PalisadoesFoundation/talawa-docs) repository contains user edited markdown files that are automatically integrated into our Talawa documentation site [docs.talawa.io](https://docs.talawa.io/) using the [Docusaurus](https://docusaurus.io/) package.

## How to use Docusaurus

The process in easy:

1. Install `talawa-docs` on your system
1. Launch docusaurus on your system according to the `talawa-docs`documentation.
- A local version of `docs.talawa.io` should automatically launched in your browser at http://localhost:3000/
1. Add/modify the markdown documents to the `docs/` directory of the `talawa-docs` repository
1. If adding a file, then you will also need to edit the `sidebars.js` which is used to generate the [docs.talawa.io](https://docs.talawa.io/) menus.
1. Always monitor the local website in your brower to make sure the changes are acceptable.
- You'll be able to see errors that you can use for troubleshooting in the CLI window you used to launch the local website.

## Other information

**_PLEASE_** do not add markdown files in this repository. Add them to `talawa-docs`!
Our documentation can be found in ONLY THREE PLACES:

1. **Inline within the repository's code files**:
1. We have automated processes to extract this information and place it in our Talawa documentation site [docs-api.talawa.io](https://docs-api.talawa.io/).
2. These are placed in the repository's Docusaurus sub-directory `docs/docs/auto-docs`
2. **In the repository's Docusaurus files**:
1. These include manually edited files from our contributors
2. These can be found in the `docs/docs/docs` directory
3. **In our `talawa-docs` repository**:
1. Our [Talawa-Docs](https://github.com/PalisadoesFoundation/talawa-docs) repository contains user edited markdown files that cover information across all the Talawa repositories.
2. That repository generates web pages for our Talawa documentation site [docs.talawa.io](https://docs.talawa.io/) using the [Docusaurus](https://docusaurus.io/) package.
58 changes: 4 additions & 54 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,6 @@
# Development environment setup
# Talawa-API Installation

## Prerequisites
Installation documentation can be found at these locations:

You must have basic competence and experience in the following technologies to be able to set up and work within the development environment of talawa api:

1. Unix based operating systems like linux based distributions, macOS or windows subsystem for linux.
2. Git
3. Github
4. Docker
5. Docker compose
6. Visual studio code with devcontainers
7. Typescript
8. Node.js

## Our recommendations

Linux based distributions are simply the best platform for a very vast majority of use cases related to software development. As such we recommend using popular linux based distributions like fedora, arch, ubuntu, linux mint, debian etc., for having a better experience during software development.

We make heavy of use docker containers in our workflows. Since, containers are a technology built on top of linux, on non-linux platforms they can only be used by emulating linux where they are ran inside linux based virtual machines. So, you should be aware that there are performance penalties and certain limitations with running containers on platforms like macOS and windows.

Though, many of these penalties and limitations don't apply to windows subsystem for linux. So, if you plan on using windows, at the very least make use of windows subsystem for linux.

## Setup

We provide a mostly automated way of setting up the development environment for talawa api using git, docker and visual studio code as shown in the following video:

1. Click on the image to play the video
2. The video is partially incorrect. Clone from this repo instead
- https://github.com/PalisadoesFoundation/talawa-api

[![Talawa API Environment Setup - Development](https://img.youtube.com/vi/jz7koJIXqtk/0.jpg)](https://www.youtube.com/watch?v=jz7koJIXqtk)

It is very important that you go through [this](https://code.visualstudio.com/docs/devcontainers/containers) official documentation for working with devcontainers in visual studio code.

# Local production environment setup

Developers working on client applications making use of talawa api can set up and run a production build of talawa api on their systems locally.

## Prerequisites

You must have basic competence and experience in the following technologies to be able to set up and run the production build of talawa api locally on your system:

1. Git
2. Docker
3. Docker compose

## Setup

We provide a mostly automated way of running the production build of talawa api locally on your system using git, docker and docker compose as shown in the following video:

1. Click on the image to play the video
2. The video is partially incorrect. Clone from this repo instead
- https://github.com/PalisadoesFoundation/talawa-api

[![Talawa API Environment Setup - Production](https://img.youtube.com/vi/10Zi2srGPHM/0.jpg)](https://www.youtube.com/watch?v=10Zi2srGPHM)
1. Online at https://docs-api.talawa.io/docs/installation
1. In the local repository at [INSTALLATION.md](docs/docs/docs/getting-started/installation.md) which is the source file for the web page.
25 changes: 25 additions & 0 deletions docs/docs/auto-docs/createServer/functions/createServer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[Admin Docs](/)

***

# Function: createServer()

> **createServer**(`options`?): `Promise`\<`FastifyInstance`\<`Server`, `IncomingMessage`, `ServerResponse`, `TypeBoxTypeProvider`\>\>
Defined in: [src/createServer.ts:29](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/createServer.ts#L29)

This function is used to set up the fastify server.

## Parameters

### options?

#### envConfig

`Partial`\<\{ `API_ADMINISTRATOR_USER_EMAIL_ADDRESS`: `string`; `API_ADMINISTRATOR_USER_NAME`: `string`; `API_ADMINISTRATOR_USER_PASSWORD`: `string`; `API_BASE_URL`: `string`; `API_COMMUNITY_FACEBOOK_URL`: `string`; `API_COMMUNITY_GITHUB_URL`: `string`; `API_COMMUNITY_INACTIVITY_TIMEOUT_DURATION`: `number`; `API_COMMUNITY_INSTAGRAM_URL`: `string`; `API_COMMUNITY_LINKEDIN_URL`: `string`; `API_COMMUNITY_NAME`: `string`; `API_COMMUNITY_REDDIT_URL`: `string`; `API_COMMUNITY_SLACK_URL`: `string`; `API_COMMUNITY_WEBSITE_URL`: `string`; `API_COMMUNITY_X_URL`: `string`; `API_COMMUNITY_YOUTUBE_URL`: `string`; `API_HOST`: `string`; `API_IS_APPLY_DRIZZLE_MIGRATIONS`: `boolean`; `API_IS_GRAPHIQL`: `boolean`; `API_IS_PINO_PRETTY`: `boolean`; `API_JWT_EXPIRES_IN`: `number`; `API_JWT_SECRET`: `string`; `API_LOG_LEVEL`: `"debug"` \| `"error"` \| `"fatal"` \| `"info"` \| `"trace"` \| `"warn"`; `API_MINIO_ACCESS_KEY`: `string`; `API_MINIO_END_POINT`: `string`; `API_MINIO_PORT`: `number`; `API_MINIO_SECRET_KEY`: `string`; `API_MINIO_USE_SSL`: `boolean`; `API_PORT`: `number`; `API_POSTGRES_DATABASE`: `string`; `API_POSTGRES_HOST`: `string`; `API_POSTGRES_PASSWORD`: `string`; `API_POSTGRES_PORT`: `number`; `API_POSTGRES_SSL_MODE`: `boolean` \| `"allow"` \| `"prefer"` \| `"require"` \| `"verify-full"`; `API_POSTGRES_USER`: `string`; \}\>

Optional custom configuration environment variables that would merge or override the default configuration environment variables used by talawa api.

## Returns

`Promise`\<`FastifyInstance`\<`Server`, `IncomingMessage`, `ServerResponse`, `TypeBoxTypeProvider`\>\>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: advertisementAttachmentMimeTypeEnum

> `const` **advertisementAttachmentMimeTypeEnum**: `ZodEnum`\<\[`"image/avif"`, `"image/jpeg"`, `"image/png"`, `"image/webp"`, `"video/mp4"`, `"video/webm"`\]\>
Defined in: [src/drizzle/enums/advertisementAttachmentMimeType.ts:8](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/advertisementAttachmentMimeType.ts#L8)

Possible variants of the type of an attachement of an advertisement.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: advertisementTypeEnum

> `const` **advertisementTypeEnum**: `ZodEnum`\<\[`"banner"`, `"menu"`, `"pop_up"`\]\>
Defined in: [src/drizzle/enums/advertisementType.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/advertisementType.ts#L6)

Possible variants of the type of an advertisement.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: agendaItemTypeEnum

> `const` **agendaItemTypeEnum**: `ZodEnum`\<\[`"general"`, `"note"`, `"scripture"`, `"song"`\]\>
Defined in: [src/drizzle/enums/agendaItemType.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/agendaItemType.ts#L6)

Possible variants of the type of an agenda item.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: chatMembershipRoleEnum

> `const` **chatMembershipRoleEnum**: `ZodEnum`\<\[`"administrator"`, `"regular"`\]\>
Defined in: [src/drizzle/enums/chatMembershipRole.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/chatMembershipRole.ts#L6)

Possible variants of the role assigned to a user within a chat.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: commentVoteTypeEnum

> `const` **commentVoteTypeEnum**: `ZodEnum`\<\[`"down_vote"`, `"up_vote"`\]\>
Defined in: [src/drizzle/enums/commentVoteType.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/commentVoteType.ts#L6)

Possible variants of the type of of a vote on a comment.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: eventAttachmentMimeTypeEnum

> `const` **eventAttachmentMimeTypeEnum**: `ZodEnum`\<\[`"image/avif"`, `"image/jpeg"`, `"image/png"`, `"image/webp"`, `"video/mp4"`, `"video/webm"`\]\>
Defined in: [src/drizzle/enums/eventAttachmentMimeType.ts:8](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/eventAttachmentMimeType.ts#L8)

Possible variants of the type of an attachement of an event.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: familyMembershipRoleEnum

> `const` **familyMembershipRoleEnum**: `ZodEnum`\<\[`"adult"`, `"child"`, `"head_of_household"`, `"spouse"`\]\>
Defined in: [src/drizzle/enums/familyMembershipRole.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/familyMembershipRole.ts#L6)

Possible variants of the role of a user in a family(if applicable).
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: imageMimeTypeEnum

> `const` **imageMimeTypeEnum**: `ZodEnum`\<\[`"image/avif"`, `"image/jpeg"`, `"image/png"`, `"image/webp"`\]\>
Defined in: [src/drizzle/enums/imageMimeType.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/imageMimeType.ts#L6)

Possible variants of the type of an image.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: iso3166Alpha2CountryCodeEnum

> `const` **iso3166Alpha2CountryCodeEnum**: `ZodEnum`\<\[`"ad"`, `"ae"`, `"af"`, `"ag"`, `"ai"`, `"al"`, `"am"`, `"ao"`, `"aq"`, `"ar"`, `"as"`, `"at"`, `"au"`, `"aw"`, `"ax"`, `"az"`, `"ba"`, `"bb"`, `"bd"`, `"be"`, `"bf"`, `"bg"`, `"bh"`, `"bi"`, `"bj"`, `"bl"`, `"bm"`, `"bn"`, `"bo"`\]\>
Defined in: [src/drizzle/enums/iso3166Alpha2CountryCode.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/iso3166Alpha2CountryCode.ts#L6)

Possible variants of the two-letter country code defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special areas of geographical interest. More information at this link: [https://en.wikipedia.org/wiki/List\_of\_ISO\_3166\_country\_codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes).
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: iso4217CurrencyCodeEnum

> `const` **iso4217CurrencyCodeEnum**: `ZodEnum`\<\[`"AED"`, `"AFN"`, `"ALL"`, `"AMD"`, `"ANG"`, `"AOA"`, `"ARS"`, `"AUD"`, `"AWG"`, `"AZN"`, `"BAM"`, `"BBD"`, `"BDT"`, `"BGN"`, `"BHD"`, `"BIF"`, `"BMD"`, `"BND"`, `"BOB"`, `"BOV"`, `"BRL"`, `"BSD"`, `"BTN"`, `"BWP"`, `"BYN"`\]\>
Defined in: [src/drizzle/enums/iso4217CurrencyCode.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/iso4217CurrencyCode.ts#L6)

Possible variants of the currency code defined in ISO 4217 standard published by the International Organization for Standardization (ISO) which defines alpha codes and numeric codes for the representation of currencies and provides information about the relationships between individual currencies and their minor units. More information at this link: [https://en.wikipedia.org/wiki/ISO\_4217#Active\_codes\_(list\_one)](https://en.wikipedia.org/wiki/ISO_4217#Active_codes_(list_one)).
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: iso639Set1LanguageCodeEnum

> `const` **iso639Set1LanguageCodeEnum**: `ZodEnum`\<\[`"aa"`, `"ab"`, `"ae"`, `"af"`, `"ak"`, `"am"`, `"an"`, `"ar"`, `"as"`, `"av"`, `"ay"`, `"az"`, `"ba"`, `"be"`, `"bg"`, `"bi"`, `"bm"`, `"bn"`, `"bo"`, `"br"`, `"bs"`, `"ca"`, `"ce"`, `"ch"`, `"co"`, `"cr"`, `"cs"`, `"cu"`, `"cv"`\]\>
Defined in: [src/drizzle/enums/iso639Set1LanguageCode.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/iso639Set1LanguageCode.ts#L6)

Possible variants of the two-letter language code defined in ISO 639-1, part of the ISO 639 standard published by the International Organization for Standardization (ISO), to represent natural languages. More information at this link: [https://en.wikipedia.org/wiki/List\_of\_ISO\_639\_language\_codes](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: organizationMembershipRoleEnum

> `const` **organizationMembershipRoleEnum**: `ZodEnum`\<\[`"administrator"`, `"regular"`\]\>
Defined in: [src/drizzle/enums/organizationMembershipRole.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/organizationMembershipRole.ts#L6)

Possible variants of the role assigned to a user within an organization.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: postAttachmentMimeTypeEnum

> `const` **postAttachmentMimeTypeEnum**: `ZodEnum`\<\[`"image/avif"`, `"image/jpeg"`, `"image/png"`, `"image/webp"`, `"video/mp4"`, `"video/webm"`\]\>
Defined in: [src/drizzle/enums/postAttachmentMimeType.ts:8](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/postAttachmentMimeType.ts#L8)

Possible variants of the type of an attachement of a post.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: postVoteTypeEnum

> `const` **postVoteTypeEnum**: `ZodEnum`\<\[`"down_vote"`, `"up_vote"`\]\>
Defined in: [src/drizzle/enums/postVoteType.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/postVoteType.ts#L6)

Possible variants of the type of a vote on a post.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: userEducationGradeEnum

> `const` **userEducationGradeEnum**: `ZodEnum`\<\[`"grade_1"`, `"grade_2"`, `"grade_3"`, `"grade_4"`, `"grade_5"`, `"grade_6"`, `"grade_7"`, `"grade_8"`, `"grade_9"`, `"grade_10"`, `"grade_11"`, `"grade_12"`, `"graduate"`, `"kg"`, `"no_grade"`, `"pre_kg"`\]\>
Defined in: [src/drizzle/enums/userEducationGrade.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/userEducationGrade.ts#L6)

Possible variants of the education grade(if applicable) of a user.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: userEmploymentStatusEnum

> `const` **userEmploymentStatusEnum**: `ZodEnum`\<\[`"full_time"`, `"part_time"`, `"unemployed"`\]\>
Defined in: [src/drizzle/enums/userEmploymentStatus.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/userEmploymentStatus.ts#L6)

Possible variants of the employment status(if applicable) of a user.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Admin Docs](/)

***

# Variable: userMaritalStatusEnum

> `const` **userMaritalStatusEnum**: `ZodEnum`\<\[`"divorced"`, `"engaged"`, `"married"`, `"seperated"`, `"single"`, `"widowed"`\]\>
Defined in: [src/drizzle/enums/userMaritalStatus.ts:6](https://github.com/PalisadoesFoundation/talawa-api/blob/c34688c69eb12a5eb721ebc8a0cd60b53e5fbf81/src/drizzle/enums/userMaritalStatus.ts#L6)

Possible variants of the martial status(if applicable) of a user.
Loading

0 comments on commit 836c461

Please sign in to comment.