{"id":19847126,"url":"https://github.com/fusedvr/chainauth-server","last_synced_at":"2026-06-08T01:02:09.416Z","repository":{"id":159093793,"uuid":"628140111","full_name":"FusedVR/chainauth-server","owner":"FusedVR","description":"The backend server for Chain Auth","archived":false,"fork":false,"pushed_at":"2023-04-15T03:47:05.000Z","size":203,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T22:55:44.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FusedVR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-15T03:00:21.000Z","updated_at":"2023-04-30T06:04:32.000Z","dependencies_parsed_at":"2023-05-10T15:00:55.463Z","dependency_job_id":null,"html_url":"https://github.com/FusedVR/chainauth-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FusedVR/chainauth-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusedVR%2Fchainauth-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusedVR%2Fchainauth-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusedVR%2Fchainauth-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusedVR%2Fchainauth-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FusedVR","download_url":"https://codeload.github.com/FusedVR/chainauth-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FusedVR%2Fchainauth-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34043822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T13:13:28.226Z","updated_at":"2026-06-08T01:02:09.393Z","avatar_url":"https://github.com/FusedVR.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FusedVR ChainAuth APIs\n\nThis project is the open source backend that powers the FusedVR ChainAuth APIs, which provides a simplified solution to Game Developers for one of the many difficulties when developing a Web 3 standalone game : **authenticating a player's non-custodial wallet to prove ownership of the tokens, NFTs, or other digital assets a player owns**\n\nThe code base is written in Typescript / NodeJS with an Express server that powers the authentication and app management APIs that are exposed at [https://crypto.fusedvr.com](https://crypto.fusedvr.com).\n\n## Requirements\n\n- npm\n- nodejs\n\n## Directory Overview\n\n```\n  ├── src                   # typescript source code\n  │   ├── controller\n  │   ├── routes\n  │   ├── utilities\n  │   ├── server.js\n  ├── .github\\workflows     # github workflows\n  │   ├── build.yml\n  │   ├── tests.yml\n  ├── tests                 # test cases for the project\n  ├── ├── ControllerTests \n  ├── ├── RoutesTests\n  ├── ├── TestResources\n  ├── ├── UtilitiesTests\n  ├── moralis-cloud-function # functions to be deployed to moralis parse server\n  ├── package.json           \n  ├── package-lock.json \n  ├── Dockerfile     \n  └── .gitignore\n  └── .env.template\n```\n\nAll the core typescript code is located in the src folder is broken into :\n- Controller : for all core logic is responsible for power the APIs\n- Routes : using Express, APIs are opened and documented in these files\n- Utilities : utility functions that support the routes and controller\n- server.js : main entry point for the backend server\n\n## Installation\n\nAll commands to build and run the backend are located in the **package.json** file. Install all the dependencies with **npm install**\n\nTo build the project, run **npm run prod:build**. This will create the Javascript build in the app folder of the project. \n\nOnce the project has been built, create a **env** folder in the newly created **app** folder. Copy the **.env.template** into the env folder. Rename the copy to **.env.dev** or **.env.prod**, depending on the production or development settings you would like to use. \n\nThe environment file should contain information about a Moralis server, a Postmark API for sending e-mails, and random values for secret keys. If you are using Github actions, these values should be included in your Github Secrets. \n\nOnce the environment file is setup, you can run the included Unit Tests with **npm run tests**\n\nTo run in development mode with a dev env file, you may use **npm run dev:start** or **npm run dev:build:start** to run the API server.\nTo run in production mode with a prod env file, you may use **npm run prod:start** or **npm run prod:build:start** to run the API server.\n\nOnce the backend is up, you can start calling the APIs. If you would like to connect this to a front end, please refer to the chainauth-console : [https://github.com/FusedVR/chainauth-console](https://github.com/FusedVR/chainauth-console). \n\n## Environment variables\n\nThe following is the template that is used to set the environment variables. \n\n```\nMORALIS_APP_ID = YOUR KEY HERE\nMORALIS_URL = YOUR URL HERE\nMORALIS_MASTER_KEY = YOUR KEY HERE\n\nPORT = 3000\nHOST = http://localhost\n\nEMAIL_SENDER = noreply@fusedvr.com\nPOSTMARK_API_KEY = KEY HERE\n\nJWT_MAIN_SECRET_KEY = RANDOM KEY HERE\nJWT_EXPIRATION = TIME IN SECONDS HERE\n\nJWT_EMAIL_SECRET_KEY = RANDOM KEY HERE\nJWT_EMAIL_EXPIRATION = TIME IN SECONDS HERE\n\nJWT_APP_SECRET_KEY = RANDOM KEY HERE\n```\n\nThe first section contains variables for your Moralis server. You will need to setup a Moralis server, which can be self hosted following [their documentation](https://v1docs.moralis.io/moralis-dapp/getting-started/self-hosting-moralis-server)\n\nThe second section contains variables for which PORT and Domain is the node js server hosted on. \n\nThe third section contains variables for using Postmark to send emails for the magic link and authentication\n\nThe following sections are variables for Keys you would like to set up for making sure data you pass with the server using JWT is secured. \n\n## Github Actions CI/CD\n \nThe CI/CD pipelin will run tests and build the docker image, which can be deployed to Google Cloud. This requires a GCloud Service Key, which is created in an IAM like so [https://cloud.google.com/iam/docs/creating-managing-service-account-keys](https://cloud.google.com/iam/docs/creating-managing-service-account-keys)\n\nThe Key needs to be base64 encoded, which can be done with the following command:\n\n`cat \u003cjson private key file\u003e | base64 -w 0`\n\nFor the environment to be setup from the CI/CD you must add Github Secrets such as PROD_ENV_FILE which contain the JSON values for the environment variable. \n\nOnce the Docker image has been built and pushed to Google Cloud. It will be stored in the Docker Registry. It is then recommended to deploy that container in a serverless environment like Google Cloud Run. \n\n## Moralis Jobs \u0026 Syncs (optional)\n\nIn order to run automated tasks for updating the database, we have a few set jobs that are setup with Moralis\n\n- Moralis Syncs enables us to listen for events from Cask to which we can update our database and application plans\n- Clean up automation is setup as a job in order to ensure the database does not have lingering codes\n\nIn order to push these tasks to Moralis automation, we need to use the [Moralis CLI](https://v1docs.moralis.io/moralis-dapp/cloud-code/cloud-functions#ide-setup). This document then illustrates what needs to happen in order to push code to our specific application. Eventually pushing the code should be integrated with our CI / CD.\n\nHowever, there will always be a manual step in production to setup the Syncs to the specific smart contract and set the schedule for when Jobs run. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusedvr%2Fchainauth-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffusedvr%2Fchainauth-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusedvr%2Fchainauth-server/lists"}