Please find more updated documentation and information on the day-to-day work of the Matters Lab development team on Notion.
This repo is the main portal for documentation and discussions on product, development, and community roles. General issues that do not fit in specific repos should also submitted here, for example, new feature proposals that require client and server coupling. You can also join us on community-maintained Discord.
Some useful resources in this repo:
- Introduction to API
- Introduction to all reposories
- Architecture diagram
- Database documentation and relationship diagram
- Code of conduct
- Wiki on collaboration process
Matters uses GraphQL for the API layer. Read the API documentation and test queries and mutations in Apollo playground. A short introduction can be found here.
C4Context
title Matters System Architecture
Container_Ext(cloudflare, "Cloudflare", "CDN + WAF", "Protects and accelerates traffic")
Boundary(feBoundary, "Frontend", "") {
Boundary(mattersWebBoundary, "matters.town", "thematters/matters-web") {
Container(ssrServer, "SSR Server", "Elastic Beanstalk", "Next.js, Apollo Client")
}
}
Boundary(beBoundary, "Backend", "") {
Boundary(mattersServerBoundary, "matters-server", "thematters/matters-server") {
Container(apiServer, "API Server","Elastic Beanstalk", "Handles GraphQL requests and Payment/Oauth callbacks")
ContainerQueue(queues, "Job Queue", "SQS", "")
Container(queuejob, "Job Worker", "Lambda", "Processes jobs from queues")
Container(cronjob, "Cronjob", "Lambda", "Handles cronjob")
}
Boundary(thirdPartiesBoundary, "Third Party Providers", "") {
Container_Ext(stripe, "Stripe", "", "Supports fiat payment")
Container_Ext(likecoin, "Likecoin", "", "Supports likecoin payment")
Container_Ext(sendgrid, "SendGrid", "", "Sends Emails")
Container_Ext(gcp, "GCP", "", "Support translation")
Container_Ext(opensea, "OpenSea", "", "Support NFT queries for users")
Container_Ext(sentry, "Sentry", "", "Monitors logging")
}
}
Boundary(storageBoundary, "Storage", "") {
ContainerDb(databases, "Postgres", "RDS", "Stores application data")
Container(cache, "Cache", "Elasticache", "Improves read performance")
Container(image, "Images Storage", "Cloudflare Images", "Serves images through CDN")
Container(audio, "Audio Storage", "S3 + CloudFront", "Serves Audio files")
Container(search, "Search Server", "EC2, Postgresql", "Fulltext search")
Container_Ext(ipfs, "IPFS/IPNS", "Storacha, Pinata", "Articles IPFS/IPNS storage")
ContainerDb(bigquery, "BigQuery", "BigQuery", "Stores analytics data and audit logs")
}
Rel(cloudflare, ssrServer, "Filtered traffic", "HTTPS")
Rel(ssrServer, apiServer, "GraphQL queries", "HTTPS")
Rel(apiServer, queues, "Events", "")
Rel(queues, queuejob, "Trigger", "")
The following are major repositories used by Matters.Town.
- server: Main repo for Matters server. Written in Typescript, using Apollo Server for GraphQL API.
- contracts: Smart contracts.
- lambda functions: Queue & cron jobs.
- query cache: Cache related GraphQL directives and Apollo Server plugins. Used to control and invalidate the cache in Matters server.
- web: Main repo for Matters web client. Written in Typescript, built with React, Nextjs and Apollo Client.
- editor: Opinionated WYSWYG editor used at Matters.Town, built with Tiptap.
- upload client: File upload for GraphQL. Fork of apollo-upload-client with persistence query support.
- slugify: Good old slugify with CJK charset support.
- docker: Docker images used by Matters Lab.
- slack notification: AWS lambda function for sending notifications to slack for DevOps purpose.
Matters is actively finding better ways to deliver content in p2p protocols. Below are some related clients.
- Hypha publication project: experimental projects for peer 2 peer clients to be
interoperable with Matters sever.
- Hypha Desktop: Desktop client based on Election.js and IPFS. Can be downloaded directly and used as an IPFS browser.
- Hypha extension: Browser extension client based on js-ipfs and orbit-db. Can be used for private P2P messaging etc. Heavily under development.
- Beaker Browser: A stable p2p browser supporting
://dat
protocol. There are some discussions and experiments about adapting Matters to Beaker Browser via unwalled.garden protocol and Hyperdrive.
- MatREQ: Request articles on certain topic.
- matters-muter: Browser extension to mute articles and comments of given users, support shared blacklist. For Chrome and Firefox, open sourced.
- matters2ipfs: convert matters article to ipfs public gateway that can be accessed within GFW, open sourced.
- matters personal website: personal website mirrored from Matters.Town, open sourced.
We would like to thank everyone on the following list for making our products more secure. You can add yourself by making a pull request.
- huli (GitHub, HitCon)
- CORS misconfiguration
- XSS with image src
- open redirect with iframe
- XSS on login redirect
- catding (GitHub, Matters)
- Missing size or domain check during uploading assets to IPFS
- Aidil Arief
- XSS on login redirect
- Unique Kamboj
- Missing SPF records on domain name