Home

Awesome

  #Tech4Good   #OpenSource   #Solidarity

Social Income Logo

https://user-images.githubusercontent.com/6095849/191377786-10cdb4a1-5b25-4512-ade9-2cc0e153d947.mp4

Social Income is a radically simple solution in the fight against poverty. The global open-source initiative converts donations into an unconditional basic income, which is sent directly to the mobile phones of people living in poverty in the Global South.

SDG Icon SDG 1    SDG Icon SDG 10

OSS Tools by Social Income

Admin ToolWebsiteMobile App
PurposeMake it simple to manage payments, contributors and recipientsRaising donations and inform the publicMake it simple for recipients to manage payments and surveys
InstructionsReadmeReadmeReadme / Contributing
Localhostlocalhost:3000 / 4000localhost:3001
Stagingstaging-admin.socialincome.orgstaging.socialincome.orgTestflight / App Distribution
Productionadmin.socialincome.orgsocialincome.orgiOS / Android
IssuesOpen issuesOpen issuesOpen issues

Code Contributions

Basic Steps to Contribute

  1. Choose an issue and leave a comment that you'd like to work on it (upon we assign it to you) All issues Help wanted Good first issues

  2. Setup the basic development environment Setup

  3. Clone the repo and work on it Developing

  4. Create a PR and wait for it to be reviewed

  5. If approved, the PR will be merged into the main branch, first on the staging and subsequently on production Deployments

Frontend developers: You can also develop UI components with Tailwind CSS and shadcn/ui independent of the website (Readme / Contributing). The components are all collected in our Storybook.

Basic Development Setup

We are mainly leveraging the following tools:

1. Prerequisites

Node.js: brew install node@18 (Homebrew). Make sure you are using Node.js 18. Follow this guide to switch between different versions of Node.js if need be.

java: brew install openjdk (Homebrew). See also troubleshooting below.

<details> <summary>Troubleshooting</summary>

Error Missing Java

➜  socialincome-public git:(main) npm run firebase:serve

> @socialincome/monorepo@1.0.0 firebase:serve
> firebase emulators:start --project social-income-staging --config firebase.json --import ./seed

⚠  emulators: You are not currently authenticated so some features may not work correctly. Please run firebase login to authenticate the CLI.
i  emulators: Shutting down emulators.

Error: Process `java -version` has exited with code 1. Please make sure Java is installed and on your system PATH.
-----Original stdout-----
-----Original stderr-----
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.```

Solution

$ brew install openjdk
$ sudo ln -sfn $HOMEBREW_PREFIX/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
</details>

2. Install the dependencies

npm install

3. Start environment

Initiate development environments for specific tools as needed (see table above).

The package.json file gives you a good overview of the available commands.

<details> <summary>Troubleshooting</summary>

Port taken

Error: Could not start Firestore Emulator, port taken.

Solution (macOS): In most cases it is due to port 8080 or 8085, which can be killed with one command:

kill $(lsof -t -i:8080) $(lsof -t -i:8085)
</details>

Developing

Developer Logins

No production credentials are needed for local development.

<details> <summary>Developer Login for Admin Tool</summary>

Localhost Admin Tool Login (Link)

Choose "Sign in with Google" and select the listed "Admin (admin@socialincome.org)" account.

Staging Admin Tool Login (Link)

Contact the dev team (dev@socialincome.org) which can assign you access rights to login.

Production Admin Tool Login (Link)

Only selected people from the SI team have access.

</details> <details> <summary>Developer Login for Website (Donor Dashboard)</summary>

Localhost Website Login (Link)

  1. Go to the Login page and select
  2. Sign in with username test@test.org and password test@test.org.

Staging Website Login (Link)

To create a donor account in the staging environment, proceed through the donation process. Utilize the Stripe test card (4242 4242 4242 4242) for making a test donation.

Production Website Login (Link)

Only actual donors have accounts and can log in. Consider making a (symbolic) donation to create your own account.

</details>

Data Seed

An initial dataset is imported into the Firebase emulators at startup. You have the flexibility to add, delete, or modify data directly through your Admin Tool or the Firestore Admin Interface locally. After making any changes, you can export the updated data to the seed folder using the command npm run firebase:export.

Format Code

We are using Prettier to format the code: npm run format-code.

Deployments

Staging: PRs merged into main are automatically deployed to staging (Admin Tool / Website) upon core developer approval. Check Github Actions for details. Experienced contributors can deploy directly without approval.

Production: Deployments are made by core developers via GitHub releases.

<details> <summary>Naming Convention</summary>

Use the format "release-YYYY-MM-DD" for naming releases (example: release-2021-02-27). For multiple releases on the same day, append a suffix such as ".2", ".3", and so forth, to distinguish them (example: release-2021-02-27.2).

</details>

Backups

We have a function which triggers hourly backups of our production firestore database. The exports are saved to the social-income-prod bucket with a retention period of 30 days.

<details> <summary>Restore Database</summary>

To restore the database you can import the most recent folder directly from the social-income-prod bucket.

</details>

Bugs & Feature Requests

You can report an issue or request a feature on our issue page. If you want to report a vulnareablity please refer to our security policy.

<details> <summary>Troubleshooting Development</summary>

Problem: Added or amended translations do not appear in the localhost preview.

Solution: Remove the website/.next folder, which is automatically generated, then re-execute npm run website:serve.

</details>

Financial Contributions

Donate 1 Percent of Your Income

Become a contributor of Social Income (tax-deductible in Switzerland).

Sponsor Dev Community

Become a sponsor and help ensure the development of open source software for more equality and less poverty. Donations through the GitHub Sponsor program are used for building a strong developer community.

Social Income (NGO)

Non-Profit Organization

Social Income is a non-profit association (CHE-289.611.695) based in Zurich, Switzerland. Connect with us X, Insta, LinkedIn, Facebook or by email.

Radical Transparency

We believe that transparency builds trust and trust builds solidarity. This is why we disclose our finances to the public.

Open Source Community

Open Source isn’t an exclusive club. It’s made by people just like you. These individuals, amongst many others, have made significant contributions to Social Income's success:

Contributors

Software and IP Contributions

We receive in-kind donations from Google Nonprofit, GitHub, Codemagic, Linktree, Twilio, Algolia, JetBrains, 1Password, Mux, Sentry and Lineto. Our tools also leverage other open-source technologies, including solutions like FireCMS, Storybook and Tailwind CSS.

Licensing Information

This project is licensed under MIT, with the exception of the Unica77 font, which is exclusively licensed to Social Income.