Coder Social home page Coder Social logo

qqtqq / github-unwrapped-3000 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from remotion-dev/github-unwrapped-2023

1.0 0.0 0.0 231.4 MB

Your coding year in review

Home Page: https://www.githubunwrapped.com

JavaScript 0.07% TypeScript 98.58% CSS 1.34% HTML 0.02%

github-unwrapped-3000's Introduction

readme

Try it out live: GitHubUnwrapped.com

A platform that generates a year-in-review video for each GitHub user. Built with Vite 5, Remotion and AWS Lambda.

Make your own

Want to make your own year-in-review for your users?

  • Developers: Feel free to fork and use this repository as a template! Note the legal disclaimers at the bottom of this README.
  • Non-developers: Write to [email protected] for a free consultation in Fall 2024!

Setup

  1. Run npm i to install dependencies.

  2. Rename .env.example to .env

  3. Set up your AWS account according to the Remotion Lambda - Setup guide. We use multiple accounts for load-balancing:

    • Use AWS_KEY_1 instead of REMOTION_AWS_ACCESS_KEY_ID and AWS_SECRET_1 instead of REMOTION_AWS_SECRET_ACCESS_KEY.
    • You can use AWS_KEY_2 and AWS_SECRET_2 to load-balance between two accounts, or paste the same credentials as before to use the same account.
    • In src/helpers/set-env-for-key.ts, we rotate the environment variables.
  4. Deploy the functions into your AWS account(s):

    npx tsx deploy.ts
    

    Note that some AWS regions are disabled by default. If you get an error, enable them or limit yourself to only default ones.

  5. For caching the videos and GitHub API responses, set up a MongoDB (we use a free MongoDB Atlas Cloud instance) to save the videos. Set the connection string by filling out the values in .env.

  6. For fetching data from GitHub, create a personal access token in your user settings (no need to grant any scopes, the GraphQL API needs to be authenticated to get public information) and set it as GITHUB_TOKEN_1. Adding more tokens GITHUB_TOKEN_2 etc. will rotate the personal access tokens.

  7. Provide DISCORD_CHANNEL and DISCORD_TOKEN values to send monitoring logs to Discord.

  8. Add a SENTRY_DSN environment variable to get error reports.

You now have all environment variables.

Run the web app:

npm run dev

Edit the template in the Remotion Studio:

npm run remotion

To deploy, connect your repository to Render. Don't forget to also set the environment variables there too.

Scaling strategy

To allow thousands of people to render their video at the same time, we applied multiple strategies for scaling:

  • Caching the video whenever possible. Before each render, a MongoDB database lock is created to avoid multiple renders for the same GitHub user to be accidentally created.
  • Renders are distributed across an array of AWS regions and accounts to prevent hitting the concurrency limit.

Credits

We thank GitHub and For One Red for their support in realization and promoting of this project.

Audio copyright disclaimer

The audio was licensed for GitHubUnwrapped.com from SmartSound. If you create a derivative project, you must contact them for licensing.

License

The code in this repository: Licensed under MIT.
The Remotion framework (a dependency of this project): Companies need to obtain a paid license. Read the terms here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.