Skip to content

Commit

Permalink
Updated talawa admin docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gautam-divyanshu committed Nov 24, 2024
1 parent 4db74ed commit 8729674
Show file tree
Hide file tree
Showing 378 changed files with 645 additions and 600 deletions.
89 changes: 67 additions & 22 deletions docs/talawa-admin-docs/_media/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,9 @@ This document provides instructions on how to set up and start a running instanc
- [Install node.js](#install-nodejs)
- [Install TypeScript](#install-typescript)
- [Install Required Packages](#install-required-packages)
- [Configuration](#configuration)
- [Creating .env file](#creating-env-file)
- [Setting up PORT in .env file](#setting-up-port-in-env-file)
- [Setting up REACT_APP_TALAWA_URL in .env file](#setting-up-react_app_talawa_url-in-env-file)
- [Setting up REACT_APP_BACKEND_WEBSOCKET_URL in .env file](#setting-up-react_app_backend_websocket_url-in-env-file)
- [Setting up REACT_APP_RECAPTCHA_SITE_KEY in .env file](#setting-up-react_app_recaptcha_site_key-in-env-file)
- [Setting up Compiletime and Runtime logs](#setting-up-compiletime-and-runtime-logs)
- [Post Configuration Steps](#post-configuration-steps)
- [Running Talawa-Admin](#running-talawa-admin)
- [Accessing Talawa-Admin](#accessing-talawa-admin)
- [Talawa-Admin Registration](#talawa-admin-registration)
- [Talawa-Admin Login](#talawa-admin-login)
- [Testing](#testing)
- [Running tests](#running-tests)
- [Debugging tests](#debugging-tests)
- [Linting code files](#linting-code-files)
- [Husky for Git Hooks](#husky-for-git-hooks)
- [pre-commit hook](#pre-commit-hook)
- [post-merge hook](#post-merge-hook)
- [Installation using Docker](#installation-using-docker)
- [Prerequisites](#prerequisites-1)
- [Development Setup](#development-setup)

\<!-- tocstop --\>

Expand Down Expand Up @@ -145,24 +129,58 @@ npm install
The prerequisites are now installed. The next step will be to get the app up and running.
# Installation using Docker
## Prerequisites
1. Install Docker on your system:
- [Docker Desktop for Windows/Mac](https://www.docker.com/products/docker-desktop)
- [Docker Engine for Linux](https://docs.docker.com/engine/install/)
### Development Setup
If you prefer to use Docker, you can install the app using the following command:
1. Create a `.env` file as described in the Configuration section
2. Build the Docker Image:
Run the following command to build the Docker image:
````bash
docker build -t talawa-admin .
```bash
3. Run the Docker container:
After the build is complete, run the Docker container using this command:
```bash
docker run -p 4321:4321 talawa-admin
```bash
The application will be accessible at `http://localhost:4321`
# Configuration
It's important to configure Talawa-Admin. Here's how to do it.
You can use our interactive setup script for the configuration. Use the following command for the same.
```
```bash
npm run setup
```
```bash
All the options in "setup" can be done manually as well and here's how to do it. - [Creating .env file](#creating-env-file)

## Creating .env file

A file named .env is required in the root directory of talawa-admin for storing environment variables used at runtime. It is not a part of the repo and you will have to create it. For a sample of `.env` file there is a file named `.env.example` in the root directory. Create a new `.env` file by copying the contents of the `.env.example` into `.env` file. Use this command:

```
````

cp .env.example .env

```
This `.env` file must be populated with the following environment variables for `talawa-admin` to work:
Expand All @@ -186,39 +204,51 @@ Add a custom port number for Talawa-Admin development purposes to the variable n
Add the endpoint for accessing talawa-api graphql service to the variable named `REACT_APP_TALAWA_URL` in the `.env` file.
```
REACT_APP_TALAWA_URL="http://API-IP-ADRESS:4000/graphql/"
```
If you are a software developer working on your local system, then the URL would be:
```
REACT_APP_TALAWA_URL="http://localhost:4000/graphql/"
```
If you are trying to access Talawa Admin from a remote host with the API URL containing "localhost", You will have to change the API URL to
```
REACT_APP_TALAWA_URL="http://YOUR-REMOTE-ADDRESS:4000/graphql/"
```
## Setting up REACT_APP_BACKEND_WEBSOCKET_URL in .env file
The endpoint for accessing talawa-api WebSocket graphql service for handling subscriptions is automatically added to the variable named `REACT_APP_BACKEND_WEBSOCKET_URL` in the `.env` file.
```
REACT_APP_BACKEND_WEBSOCKET_URL="ws://API-IP-ADRESS:4000/graphql/"
```
If you are a software developer working on your local system, then the URL would be:
```
REACT_APP_BACKEND_WEBSOCKET_URL="ws://localhost:4000/graphql/"
```
If you are trying to access Talawa Admin from a remote host with the API URL containing "localhost", You will have to change the API URL to
```
REACT_APP_BACKEND_WEBSOCKET_URL="ws://YOUR-REMOTE-ADDRESS:4000/graphql/"
```
For additional details, please refer the `How to Access the Talawa-API URL` section in the INSTALLATION.md file found in the [Talawa-API repo](https://github.com/PalisadoesFoundation/talawa-api).
Expand All @@ -238,7 +268,9 @@ If you want to setup Google reCAPTCHA now, you may refer to the `RECAPTCHA` sect
Copy/paste this `reCAPTCHA site key` to the variable named `REACT_APP_RECAPTCHA_SITE_KEY` in `.env` file.
```
REACT_APP_RECAPTCHA_SITE_KEY="this_is_the_recaptcha_key"
```
## Setting up Compiletime and Runtime logs
Expand All @@ -254,21 +286,27 @@ It's now time to start Talawa-Admin and get it running
Run the following command to start `talawa-admin` development server:
```
npm run serve
```
## Accessing Talawa-Admin
By default `talawa-admin` runs on port `4321` on your system's localhost. It is available on the following endpoint:
```
http://localhost:4321/
```
If you have specified a custom port number in your `.env` file, Talawa-Admin will run on the following endpoint:
```
http://localhost:$\{\{customPort\}\}/
```
Replace `$\{\{customPort\}\}` with the actual custom port number you have configured in your `.env` file.
Expand All @@ -290,16 +328,20 @@ It is important to test our code. If you are a contributor, please follow these
You can run the tests for `talawa-admin` using this command:
```
npm run test
```
## Debugging tests
You can see the output of failing tests in broswer by running `jest-preview` package before running your tests
```
npm run jest-preview
npm run test
```
You don't need to re-run the `npm run jest-preview` command each time, simply run the `npm run test` command if the Jest Preview server is already running in the background, it'll automatically detect any failing tests and show the preview at `http://localhost:3336` as shown in this screenshot -
Expand All @@ -311,7 +353,9 @@ You don't need to re-run the `npm run jest-preview` command each time, simply ru
You can lint your code files using this command:
```
npm run lint:fix
```
## Husky for Git Hooks
Expand All @@ -335,3 +379,4 @@ If you don't want this hook to run, you can manually opt out of this using the `
git pull --no-verify
\<br/\>
```
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ The JSX element representing the AddOn component.

## Defined in

[src/components/AddOn/AddOn.tsx:22](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/AddOn.tsx#L22)
[src/components/AddOn/AddOn.tsx:22](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/AddOn.tsx#L22)
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ A JSX element containing the add-on entry.

## Defined in

[src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx:46](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx#L46)
[src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx:46](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/core/AddOnEntry/AddOnEntry.tsx#L46)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Defined in

[src/components/AddOn/core/AddOnEntry/AddOnEntryMocks.ts:13](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/core/AddOnEntry/AddOnEntryMocks.ts#L13)
[src/components/AddOn/core/AddOnEntry/AddOnEntryMocks.ts:13](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/core/AddOnEntry/AddOnEntryMocks.ts#L13)
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ A JSX element containing the button and modal for plugin registration.

## Defined in

[src/components/AddOn/core/AddOnRegister/AddOnRegister.tsx:38](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/core/AddOnRegister/AddOnRegister.tsx#L38)
[src/components/AddOn/core/AddOnRegister/AddOnRegister.tsx:38](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/core/AddOnRegister/AddOnRegister.tsx#L38)
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ A JSX element containing the UI for the add-on store.

## Defined in

[src/components/AddOn/core/AddOnStore/AddOnStore.tsx:26](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/core/AddOnStore/AddOnStore.tsx#L26)
[src/components/AddOn/core/AddOnStore/AddOnStore.tsx:26](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/core/AddOnStore/AddOnStore.tsx#L26)
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ A JSX element containing the label and child elements.

## Defined in

[src/components/AddOn/support/components/Action/Action.tsx:29](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/support/components/Action/Action.tsx#L29)
[src/components/AddOn/support/components/Action/Action.tsx:29](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/support/components/Action/Action.tsx#L29)
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ A JSX element containing the main content container with the provided child elem

## Defined in

[src/components/AddOn/support/components/MainContent/MainContent.tsx:25](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/support/components/MainContent/MainContent.tsx#L25)
[src/components/AddOn/support/components/MainContent/MainContent.tsx:25](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/support/components/MainContent/MainContent.tsx#L25)
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ A JSX element containing the side panel with the provided child elements.

## Defined in

[src/components/AddOn/support/components/SidePanel/SidePanel.tsx:30](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/support/components/SidePanel/SidePanel.tsx#L30)
[src/components/AddOn/support/components/SidePanel/SidePanel.tsx:30](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/support/components/SidePanel/SidePanel.tsx#L30)
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ A promise that resolves to the installed plugins data in JSON format.

#### Defined in

[src/components/AddOn/support/services/Plugin.helper.ts:21](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/support/services/Plugin.helper.ts#L21)
[src/components/AddOn/support/services/Plugin.helper.ts:21](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/support/services/Plugin.helper.ts#L21)

***

Expand All @@ -52,7 +52,7 @@ A promise that resolves to the store data in JSON format.

#### Defined in

[src/components/AddOn/support/services/Plugin.helper.ts:11](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/support/services/Plugin.helper.ts#L11)
[src/components/AddOn/support/services/Plugin.helper.ts:11](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/support/services/Plugin.helper.ts#L11)

***

Expand All @@ -76,4 +76,4 @@ An array of objects containing the name and URL of each enabled plugin.

#### Defined in

[src/components/AddOn/support/services/Plugin.helper.ts:32](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddOn/support/services/Plugin.helper.ts#L32)
[src/components/AddOn/support/services/Plugin.helper.ts:32](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddOn/support/services/Plugin.helper.ts#L32)
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@

## Defined in

[src/components/AddPeopleToTag/AddPeopleToTag.tsx:42](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L42)
[src/components/AddPeopleToTag/AddPeopleToTag.tsx:42](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L42)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Props for the `AddPeopleToTag` component.

#### Defined in

[src/components/AddPeopleToTag/AddPeopleToTag.tsx:29](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L29)
[src/components/AddPeopleToTag/AddPeopleToTag.tsx:29](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L29)

***

Expand All @@ -30,7 +30,7 @@ Props for the `AddPeopleToTag` component.

#### Defined in

[src/components/AddPeopleToTag/AddPeopleToTag.tsx:30](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L30)
[src/components/AddPeopleToTag/AddPeopleToTag.tsx:30](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L30)

***

Expand All @@ -44,7 +44,7 @@ Props for the `AddPeopleToTag` component.

#### Defined in

[src/components/AddPeopleToTag/AddPeopleToTag.tsx:31](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L31)
[src/components/AddPeopleToTag/AddPeopleToTag.tsx:31](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L31)

***

Expand All @@ -54,7 +54,7 @@ Props for the `AddPeopleToTag` component.

#### Defined in

[src/components/AddPeopleToTag/AddPeopleToTag.tsx:32](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L32)
[src/components/AddPeopleToTag/AddPeopleToTag.tsx:32](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L32)

***

Expand All @@ -64,4 +64,4 @@ Props for the `AddPeopleToTag` component.

#### Defined in

[src/components/AddPeopleToTag/AddPeopleToTag.tsx:33](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L33)
[src/components/AddPeopleToTag/AddPeopleToTag.tsx:33](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTag.tsx#L33)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Defined in

[src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts:5](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts#L5)
[src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts:5](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts#L5)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Defined in

[src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts:277](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts#L277)
[src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts:277](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AddPeopleToTag/AddPeopleToTagsMocks.ts#L277)
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ return (

## Defined in

[src/components/Advertisements/Advertisements.tsx:27](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/Advertisements/Advertisements.tsx#L27)
[src/components/Advertisements/Advertisements.tsx:27](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/Advertisements/Advertisements.tsx#L27)
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ The rendered component

## Defined in

[src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.tsx:31](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.tsx#L31)
[src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.tsx:31](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.tsx#L31)
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ A JSX element that renders a form inside a modal for creating or editing an adve

## Defined in

[src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.tsx:60](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.tsx#L60)
[src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.tsx:60](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.tsx#L60)
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ A JSX element that renders agenda item categories with options to preview, edit,

## Defined in

[src/components/AgendaCategory/AgendaCategoryContainer.tsx:34](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AgendaCategory/AgendaCategoryContainer.tsx#L34)
[src/components/AgendaCategory/AgendaCategoryContainer.tsx:34](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AgendaCategory/AgendaCategoryContainer.tsx#L34)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Defined in

[src/components/AgendaCategory/AgendaCategoryContainerMocks.ts:6](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AgendaCategory/AgendaCategoryContainerMocks.ts#L6)
[src/components/AgendaCategory/AgendaCategoryContainerMocks.ts:6](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AgendaCategory/AgendaCategoryContainerMocks.ts#L6)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Defined in

[src/components/AgendaCategory/AgendaCategoryContainerMocks.ts:81](https://github.com/PalisadoesFoundation/talawa-admin/blob/d16b95ee179900e8e32a2296f14e948e6caea05b/src/components/AgendaCategory/AgendaCategoryContainerMocks.ts#L81)
[src/components/AgendaCategory/AgendaCategoryContainerMocks.ts:81](https://github.com/PalisadoesFoundation/talawa-admin/blob/084ac7e92dede9766b77e75cf296f40165965140/src/components/AgendaCategory/AgendaCategoryContainerMocks.ts#L81)
Loading

0 comments on commit 8729674

Please sign in to comment.