The MCCS Alpha API is a prototype API that exposes all of the functionality described in the MCCS overview of functionality.
By providing an API, developers who want to create their own front-end user interface for MCCS will have significant flexibility to implement it in whatever way they choose. This means developers can present MCCS in any language, setup their own signup flow, optimize it for whatever devices their users prefer, develop a mobile app, integrate other services such as chat, etc.
Importantly, an API enables developers to integrate MCCS functionality directly into their own apps (e.g., import transfer data into an accounting application, instruct mutual credit transfers from an e-wallet application, etc.).
We are making this code public to show our commitment to free and open source software, and to signal our intention to develop mutual credit software that will be freely available to anyone who wishes to implement a mutual credit transfer system.
There are four main functions that the MCCS API provides to its users:
- Manage accounts - create and modify user accounts and their related entity details
- Find entities - search for and view entities based on what they sell and need
- Transfer mutual credits - create and complete/cancel mutual credit (MC) transfers between entities
- Review transfer activity - view pending and completed MC transfers
See the detailed description of these main functions in the MCCS overview of functionality.
Basic requirements: Go version 1.13+, Docker and Docker Compose (see all requirements)
- Change the name of the
development-example.yaml
file toconfigs/development.yaml
- Generate JSON Web Token public and private keys
- Generate private key
openssl genrsa -out private.pem 2048
- Extract public key from it
openssl rsa -in private.pem -pubout > public.pem
- Copy/paste the private and public keys into
configs/development.yaml
- Generate private key
- Run the app
make run
- Seed the DB with some test data
make seed
- Make API calls
Software
The MCCS web app is written in Go, and it uses Docker Compose to orchestrate itself and its dependencies as Docker containers.
App Dependencies
- MongoDB - the database used to store user and entity directory data
- PostgreSQL - the database used to store mutual credit transfer data
- Elasticsearch - the search engine for searching user/entity data
- Redis - in-memory cache used for rate limiting API requests
These dependencies are installed automatically by Docker Compose.
External Dependencies
- Sendgrid - email delivery provider for sending emails generated by MCCS (e.g., welcome and password reset emails)
Sendgrid does not need to be setup to run the app in development mode.