MissionalDigerati / joshua_project_api

An API for connecting to the Joshua Project data.
GNU General Public License v3.0
6 stars 2 forks source link

Joshua Project API

An API for connecting to the Joshua Project data. It uses the PHP Slim Framework.

Development

This repository is following the branching technique described in this blog post, and the semantic version set out on the Semantic Versioning Website.

This tool uses Composer to install the project specific libraries. We also use Swagger annotations for generating the front facing API documentation.

Questions or problems? Please post them on the issue tracker. You can contribute changes by forking the project and submitting a pull request.

Local Set Up

If you would like to set up this code locally, you will need to follow these steps:

Deployment

To deploy this code, simply follow these steps:

  1. Clone the code to your server.
  2. Copy the file .env.example to .env.
  3. Open the file, and set the appropriate settings.
  4. Install Composer on your server.
  5. Install all the required librarues with composer install.

PHP Settings

In your php.ini file you will need to set the following values equal to or greater than the value provided:

  1. max_execution_time = 90

Sample Code

Sample code for PHP, Ruby, Javascript and Python can be found in the following Github Repo.

Update on JP Server

To update the submodule, use the following command: git submodule update --recursive --remote.

Google Analytics 4

To set up the Google Analytics, you need to do the following in Google Analytics:

  1. Add a data stream: Admin > Data Streams > Add a Stream
  2. Get the Measurement ID
  3. To get the secret: Admin > Data Streams > Click the appropriate stream
    • Click Measurement Protocol API Secrets
    • Create
    • Copy the key
  4. Add the event: Admin > Events > Create Event api_requests
  5. Add custom definitions:
    • Admin > Custom Definitions
    • Create 3 Custom Dimensions: endpoint, format, version

Add your settings to the .env file, and in 24 hours you should start receiving data.

License

This script is created by Missional Digerati and is under the GNU General Public License v3.