Installation
Installation is not difficult, but there are many steps. This is a brief explanation of what needs to be done:
- Install
git
- Download the code from GitHub using
git
- Install
node.js
(Node), the runtime environment the application will need to work. - Configure the Node Package Manager (
npm
) to automatically use the correct version of Node for our application. - Use
npm
to install TypeScript, the language the application is written in. - Install other supporting software such as the database.
- Configure the application
- Start the application
These steps are explained in more detail in the sections that follow.
Prerequisites
In this section we'll explain how to set up all the prerequisite software packages to get you up and running.
Install git
The easiest way to get the latest copies of our code is to install the git
package on your computer.
Follow the setup guide for git
on official git docs. Basic git
knowledge is required for open source contribution so make sure you're comfortable with it. Here's a good tutorial to get started with git
and github
.
Setting up this repository
First you need a local copy of talawa-admin
. Run the following command in the directory of choice on your local system.
-
On your computer, navigate to the folder where you want to setup the repository.
-
Open a
cmd
(Windows) orterminal
(Linux or MacOS) session in this folder.- An easy way to do this is to right-click and choose appropriate option based on your OS.
-
For Our Open Source Contributor Software Developers:
-
Next, we'll fork and clone the
talawa-admin
repository. -
In your web browser, navigate to https://github.com/PalisadoesFoundation/talawa-admin/ and click on the
fork
button. It is placed on the right corner opposite the repository namePalisadoesFoundation/talawa-admin
. -
You should now see
talawa-admin
under your repositories. It will be marked as forked fromPalisadoesFoundation/talawa-admin
-
Clone the repository to your local computer (replacing the values in
{{}}
):$ git clone https://github.com/{{YOUR GITHUB USERNAME}}/talawa-admin.git
cd talawa-admin
git checkout develop- Note: Make sure to check out the
develop
branch
- Note: Make sure to check out the
-
You now have a local copy of the code files.
-
For more detailed instructions on contributing code, please review the following documents in the root directory of the code:
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- CODE_STYLE.md
- DOCUMENTATION.md
- INSTALLATION.md
- ISSUE_GUIDELINES.md
- PR_GUIDELINES.md
-
-
Talawa Administrators:
-
Clone the repository to your local computer using this command:
$ git clone https://github.com/PalisadoesFoundation/talawa-admin.git
-
Install node.js
Best way to install and manage node.js
is making use of node version managers. We recommend using fnm
, which will be described in more detail later.
Follow these steps to install the node.js
packages in Windows, Linux and MacOS.
- For Windows:
- first install
node.js
from their website at https://nodejs.org- When installing, don't click the option to install the
necessary tools
. These are not needed in our case.
- When installing, don't click the option to install the
- then install fnm. Please read all the steps in this section first.
- All the commands listed on this page will need to be run in a Windows terminal session in the
talawa-admin
directory. - Install
fnm
using thewinget
option listed on the page. - Setup
fnm
to automatically set the version ofnode.js
to the version required for the repository using these steps:- First, refer to the
fnm
web page's section onShell Setup
recommendations. - Open a
Windows PowerShell
terminal window - Run the recommended
Windows PowerShell
command to opennotepad
. - Paste the recommended string into
notepad
- Save the document.
- Exit
notepad
- Exit PowerShell
- This will ensure that you are always using the correct version of
node.js
- First, refer to the
- All the commands listed on this page will need to be run in a Windows terminal session in the
- first install
- For Linux and MacOS, use the terminal window.
- install
node.js
- then install
fnm
- Refer to the installation page's section on the
Shell Setup
recommendations. - Run the respective recommended commands to setup your node environment
- This will ensure that you are always using the correct version of
node.js
- Refer to the installation page's section on the
- install
Install TypeScript
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional types, classes, and modules to JavaScript, and supports tools for large-scale JavaScript applications.
To install TypeScript, you can use the npm
command which comes with node.js
:
npm install -g typescript
This command installs TypeScript globally on your system so that it can be accessed from any project.
Install Required Packages
Run the following command to install the packages and dependencies required by the app:
npm install
The prerequisites are now installed. The next step will be to get the app up and running.
Installation using Docker
Docker is used to build, deploy, and manage applications within isolated, lightweight containers, effectively packaging an application with all its dependencies so it can run consistently across different environments, allowing for faster development, testing, and deployment of software.
We use it to simplify installation
Prerequisites
Follow these steps to install Docker on your system
You now need to setup the environment. This follows next.
Development Setup
If you prefer to use Docker, you can install the app using the following command:
-
Create a
.env
file as described in the Configuration section -
Build and Run the Docker Image:
Run the following command to run the Docker image:
docker-compose -f docker/docker-compose.dev.yaml --env-file .env up
-
To stop the container run the following command:
docker-compose -f docker/docker-compose.dev.yaml down
The application will be accessible at http://localhost:4321
Production Setup
If you prefer to use Docker, you can install the app using the following command:
-
Create a
.env
file as described in the Configuration section -
Configure
nginx.conf
file located atconfig/docker/setup
. Modify it to fit your preferences before running the application. -
Build and Run the Docker Image:
Run the following command to run the Docker image:
docker-compose -f docker/docker-compose.prod.yaml --env-file .env up
-
To stop the container run the following command:
docker-compose -f docker/docker-compose.prod.yaml down
The application will be accessible at http://localhost:4321