Giter Site home page Giter Site logo

a0m0rajab / opengraph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-sauced/opengraph

0.0 0.0 0.0 2.86 MB

OpenGraph dot Open Sauced is a general purpose social card generator

Home Page: https://opengraph.opensauced.pizza

License: MIT License

JavaScript 12.20% TypeScript 86.88% Dockerfile 0.92%

opengraph's Introduction


Open Sauced

๐Ÿ• Open Sauced OpenGraph Generator ๐Ÿ•

The path to your next Open Source contribution

Powered by Digital Ocean

Code Size Commits Issues Releases Discord Twitter

๐Ÿš€ Live release environments

Production (main)

Beta (beta)

๐Ÿ“– Prerequisites

In order to run the project we need the following software binaries installed on our development machines:

  • node>=18.15.0
  • npm>=9.6.3
  • docker>=20.10.23

๐Ÿ–ฅ๏ธ Local development

To install the application:

npm ci

To start a local copy of the app on port 3001:

npm run start:dev

Local dev scripts

There are a few scripts that can be used to generate and test the social cards locally without having to deploy to the CDN. This is the way to go when developing & testing the interface for the social cards.

Generating user profile cards

npm run test:local:user

Generates user cards for all users in the test array inside test/local-dev/UserCards.ts and outputs them in dist/local-dev/ for testing.

The same goes for the other card types:

  • npm run test:local:insight is for generating insight cards.
  • npm run test:local:highlight is for generating highlight cards.

The output of these scripts can be found in the dist/local-dev/ folder as well.

๐Ÿ“ Environment variables

Some environment variables are required to run the application. You can find them in the .env.example file. While most of them are optional, some are required to run the application.

One can reverse engineer the named configs but some need a little explanation.

Boilerplate, changed mostly locally:

# GitHub private access tokens
GITHUB_PAT_USER=ghp_************************************

# DigitalOcean Spaces through aws-sdk configuration
DO_SPACES_ACCESS_KEY_ID=********************
DO_SPACES_SECRET_ACCESS_KEY=*******************************************

Ping @open-sauced/maintainers to get the dev CDN keys for the DO_SPACES_* variables.

Other Digital Ocean S3 variables are sensibly set to default for local development, here are the defauls:

DO_SPACES_ENDPOINT=digitaloceanspaces.com
DO_SPACES_REGION=sfo3
DO_SPACES_BUCKET_NAME=opengraph-dev

It is also advised to set the following variables to true to avoid using the cached CDN during development:

DO_SPACES_CDN_DISABLED=true

If using a custom domain, you can set the following variable to the domain name:

DO_SPACES_SUBDOMAIN=beta.opengraph-cdn.opensauced.pizza

Other API defaults you can change are not required in local development, but can sometimes appear configured differently for production:

API_HOST=0.0.0.0
API_PORT=3005
API_DOMAIN=opengraph.opensauced.pizza
MEMORY_HEAP=200
MEMORY_RSS=3000
DISK_PERCENTAGE=0.7
DISK_SIZE=100

๐ŸŽจ Code linting

To check the code and styles quality, use the following command:

npm run lint

This will also display during development, but not break on errors.

To fix the linting errors, use the following command:

npm run format

It is advised to run this command before committing or opening a pull request.

๐Ÿ“• Types

We have a couple of scripts to check and adjust missing types.

In order to dry run what types would be added to package.json:

npm run types:auto-check

In order to add any missing types to package.json:

npm run types:auto-add

๐Ÿš€ Production deployment

A production deployment is a complete build of the project, including the build of the static assets.

npm run build

๐Ÿค Contributing

We encourage you to contribute to Open Sauced! Please check out the Contributing guide for guidelines about how to proceed.

๐Ÿ• Community

Got Questions? Join the conversation in our Discord.
Find Open Sauced videos and release overviews on our YouTube Channel.

๐ŸŽฆ Repository Visualization

Below is visual representation of our code repository. It is generated by Octo Repo Visualizer.

This visualization is being updated on release to our default branch by our release workflow.

Visualization of this repository

โš–๏ธ LICENSE

MIT ยฉ Open Sauced

opengraph's People

Contributors

0-vortex avatar nightknighto avatar brandonroberts avatar ogdev-01 avatar bdougie avatar takanome-dev avatar

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.