{"id":15999790,"url":"https://github.com/jaredwray/contrib","last_synced_at":"2025-04-22T01:31:21.260Z","repository":{"id":66053768,"uuid":"309706622","full_name":"jaredwray/contrib","owner":"jaredwray","description":"Contrib is a site that enabled auctions for memorabilia.","archived":false,"fork":false,"pushed_at":"2023-02-20T17:17:41.000Z","size":23259,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T20:57:28.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredwray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-03T14:11:17.000Z","updated_at":"2023-05-03T09:14:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba1027f7-e252-43aa-8019-393dc392abf5","html_url":"https://github.com/jaredwray/contrib","commit_stats":{"total_commits":1323,"total_committers":16,"mean_commits":82.6875,"dds":0.5714285714285714,"last_synced_commit":"ede2a34d18dbb88b60b41c01cd870745eff0df05"},"previous_names":[],"tags_count":135,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredwray%2Fcontrib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredwray%2Fcontrib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredwray%2Fcontrib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredwray%2Fcontrib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredwray","download_url":"https://codeload.github.com/jaredwray/contrib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250162001,"owners_count":21385023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-10-08T09:01:05.479Z","updated_at":"2025-04-22T01:31:21.248Z","avatar_url":"https://github.com/jaredwray.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contrib\n\nContrib is a site that enabled auctions for memorabilia. In 2023 the team decided to shut the service down and open source the code. \n\n*This code is provided as is and is not supported by the team*\n\nIf you would like to contribute to the project please read the [Contributing](CONTRIBUTING.md) document. Contrib was built with the following features:\n\n* Can easily scale to 1000s of auctions, customers, and influencers\n* Non-profits have the ability to setup their own account and transaction fees are donated to the non-profit via stripe\n* Influencers have their own profile and can upload and manage their auctions\n* Influencers can post via the social networks with a short code url provided by contrib\n* Auctions can be uploaded by the admin, or by the influencers\n* Easy logon for all mobile users as the base profile is bound to the mobile number\n* Because of the above, the user can easily change their profile picture and name\n* Support for social logons via `passport.js` for twitter, facebook, and google\n* Cloud Native by default using cloud services such as mongo atlas, stripe, sendgrid, and firebase, cloudflare (streaming), google cloud storage.\n\n![tests](https://github.com/jaredwray/contrib/workflows/tests/badge.svg)\n[![codecov](https://codecov.io/gh/jaredwray/contrib/branch/main/graph/badge.svg?token=2LIYGRVN4F)](https://codecov.io/gh/jaredwray/contrib)\n\n* [Getting Started](#getting-started)\n* [How to Deploy the App](#deploying-the-api)\n* [How to Deploy the API](#deploying-the-api)\n* [How to Set Up Cloud Services](#setting-up-cloud-services)\n* [How to Contribute](CONTRIBUTING.md)\n* [Code of Conduct](CODE_OF_CONDUCT.md)\n* [License](LICENSE.md)\n\n## Getting Started\n\nWhen using a mono repo you will want to install the dependencies for the entire repo. To do this you will want to run the following command: `yarn` This will install all dependencies for the entire repo. This will also install the dependencies for the `app` and `api` as well.\n\nOnce you have installed the dependencies you can run the following commands: `yarn start` This will start the `app` on port 3000 and `api` on 3001 in development mode. You can also run the following commands: `yarn start:app` This will start the `app` on port 3000 in development mode. `yarn start:api` This will start the `api` on port 3001 in development mode.\n\n### Building Contrib\n\nTo build contrib for production you will want to run the following commands:\n\nInstall all dependencies: `yarn`\n\nBuild the app and api: `yarn build`\n\nThis will build the `app` and place the static files in the `packages/app/dist` directory. It will also build the `api` and place it in the `packages/api/dist` directory.\n\nBuild the Docker Container for API: `yarn docker:build`\n\nAt this point you can deploy the `app` to any static cloud host and then deploy the `api` to any cloud host that supports docker.\n\n### Development in the Mono Repo\n\nThe mono repo is built using `yarn` and there are easy scripts in the base `package.json` to help with development and build.\n\n* `yarn test` - this will test the `app` and `api`\n* `yarn build` - this will build the `app` and `api`\n* `yarn docker:build` - this will build the `api` in a docker container\n* `yarn docker:run` - this will run the `api` in a docker container\n* `yarn start` - this will start the `app` on port 3000 and `api` on 3001 in development mode\n* `yarn start:app` - this will start the `app` on port 3000 in development mode\n* `yarn start:api` - this will start the `api` on port 3001 in development mode\n\n## Deploying the API\n\nThe API is the brains in this system and all major business logic is handled here. The API is a standard nodejs application and can be built and served with the following ENV variables:\n```\n\n```\n\n- Build: `docker build --rm --pull -f \"./Dockerfile\" -t \"contrib:latest\" \"./\"`\n- Run: `docker run --rm -d -p 3000:3000/tcp contrib:latest`\n\n## Deploying the App\n\nThe app is a standard react application and can be built and served statically with only one `ENV` variable provided which is `REACT_APP_API_URL={YOUR_API_URL}`.\n\nCommands to build:\n`yarn \u0026\u0026 yarn build`\n\nThis will build the `app` and place the static files in the `packages/app/dist` directory. It will also build the `api` and place it in the `packages/api/dist` directory.\n\nYou can do this on any static hosting service such as `Netlify`, `Vercel`, `AWS S3`, `Firebase`, `Cloudflare`, etc.\n\n## Setting Up Cloud Services\n\n### UPS delivery:\n\nTo deliver auction winnings, we use UPS service.\n\nYou can find all the necessary information about UPS for development here: `https://www.ups.com/upsdeveloperkit?loc=en_US`.\n\n### Authentication logic:\n\nTo authenticate users, we use the PassportJs library. We use 3 authentication strategies: Google, Facebook, Twitter.\n\nTo configure each of them to work correctly, you need to take the following steps:\n\n#### Auth with Google by passport.js:\n\n1. Log in to the Google Cloud Platform.\n2. Select the your project.\n3. Add the following links to the Authorized JavaScript origins field: `https://{YOUR_APP_URL}`, \n4. Add the following links to the Authorized Redirect URIs field: `https://{YOUR_APP_URL}/api/v1/auth/google/callback`.\n5. Get Client ID and Client secret for GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET envs.\n6. Register Google Strategy as indicated on this page: `http://www.passportjs.org/packages/passport-google-oauth20/`\n\n#### Auth with Facebook by passport.js:\n\n1. Log in to the Facebook Developers.\n2. Go to Facebook Login =\u003e Setting\n3. Add the following links to the Valid OAuth Redirect URI: `https://{YOUR_APP_URL}/api/v1/auth/facebook/callback`.\n4. Get App ID and App Secret for FACEBOOK_APP_ID and FACEBOOK_APP_ID envs on the Settings =\u003e Basic.\n5. Register Facebook Strategy as indicated on this page: `http://www.passportjs.org/packages/passport-facebook/`\n\n#### Auth with Twitter by passport.js: \n\n1. Log in to the Twittet Application Management.\n2. Go to the Setting tab.\n3. Add the following links to the Callback URL: `https://{YOUR_APP_URL}/api/v1/auth/twitter/callback`.\n4. Go to the API Keys tab, there you will find your Consumer key and Consumer secret keys for TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET envs.\n5. Register Twitter Strategy as indicated on this page: `http://www.passportjs.org/packages/passport-twitter/`\n\n\n#### Setup webhook to notify application when an event happens in an account\n\n1. Sign in to Stripe `https://stripe.com/`\n2. Go to `Developers/Webhooks` section\n3. If needs to receive events from customer's accounts connected to the Contrib's account - press `Add endpoint` in `Endpoints receiving events from Connect applications` section\n4. If needs to receive event from personal account - press `Add endpoint` in `Endpoints receiving events from your account`\n5. In the appeared window enter the URL which will receive Stripe events on the server\n6. Enter description\n7. Select several events in `Events to send` section or press button `receive all events`\n8. Press `Add endpoint`\n9. Check the secret key in `Sign in secret` section\n\nNow webhook added and registered on Stripe side. On server side add new evn var with value from `Sign in secret` section.\nThis value will be used to check webhook signature when event will be received.\n\nEvery webhook will have personal sign in secret, so for every new webhook will require personal env var with defined secret value\n\n#### Configuring scheduled jobs for the auctions:\n\nGo to Google Cloud Scheduler: https://console.cloud.google.com/cloudscheduler and create follow jobs:\n\n|Name|Description|Frequency|Timezone|Target type|URL|HTTP method|HTTP headers|Body|\n|---|---|---|---|---|---|---|---|---|\n| contrib-auction-settle     | end auctions (change status to SETTLED)  | * * * * * | America/Los_Angeles | HTTP        | https://`{YOUR_API_URL}`/api/v1/auctions-settle      | POST        | Content-Type: application/json | { \"key\": \"OUR_SECRET_KEY\" } |\n| contrib-notify-auction-end | send notifications                       | * * * * * | America/Los_Angeles | HTTP        | https://`{YOUR_API_URL}`/api/v1/auctions-ends-notify | POST        | Content-Type: application/json | { \"key\": \"OUR_SECRET_KEY\" } |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredwray%2Fcontrib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredwray%2Fcontrib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredwray%2Fcontrib/lists"}