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 (
pnpm) to automatically use the correct version of Node for our application. - Use
pnpmto 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-api. 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.
The next steps will depend on whether you are:
- an end user installing our software (Production Environments) or
- one of our open source contributors (Development Environments).
Please follow them closely.
For Production Environments
Follow the steps in this section if you are using Talawa-API as an end user.
-
Clone the repository to your local computer using this command:
$ git clone https://github.com/PalisadoesFoundation/talawa-api.git- Proceed to the next section.
For Development Environments
If you are one of our open source software developer contributors then
follow these steps carefully in forking and cloning the talawa-api repository.
- Follow the steps in our Git Guide for Developers
- As a developer you will be working with our
developbranch. - You will 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
Proceed to the next section.
Install node.js
The 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 Users
Follow these steps:
- Install
node.jsfrom 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
- 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-apidirectory. - Install
fnmusing thewingetoption listed on the page. - Setup
fnmto automatically set the version ofnode.jsto the version required for the repository using these steps:- Refer to the
Shell Setupsection of thefnmsite's installation page for recommendations. - Open a
Windows PowerShellterminal window - Run the recommended
Windows PowerShellcommand 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
- Refer to the
- All the commands listed on this page will need to be run in a Windows terminal session in the
Proceed to the next section.
For Linux and MacOS Users
Follow these steps:
- Install
node.jsfrom their website at https://nodejs.org - Install fnm.
- Refer to the
Shell Setupsection of thefnmsite's installation page for 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
Proceed to the next section.
Install pnpm
The application uses pnpm to manage the various node.js packages that need to be installed.
- Install
pnpmfrom the pnpm website
Proceed to the next section.
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 pnpm command:
pnpm install -g typescript
This command installs TypeScript globally on your system so that it can be accessed from any project.
Proceed to the next section.
Install The Required Packages
Run the following command to install the packages and dependencies required by the app:
pnpm install
The prerequisites are now installed. The next step will be to get the app up and running.
Install Docker
Follow these steps to install Docker on your system:
-
The steps are different for Windows/Mac versus Linux users:
-
You must ensure that docker is running for the Talawa-API application to work correctly. Follow these steps to verify its operation:
- Open a terminal window.
- Run the following commands to check if the required software is installed:
docker --version
docker-compose --version - Run this command to check whether docker is running:
docker info - Using the Docker documentation, you must ensure that Docker will restart after your next reboot.
Note: Restart the docker if you are getting this error Cannot connect to the Docker daemon
Configuring Talawa API
- Please go to the Configuration Guide to get Talawa-API configured.