├── .gitattributes ├── .env.template ├── public └── favicon.ico ├── src ├── res │ ├── imgs │ │ ├── tshirt.jpg │ │ ├── stickers.jpg │ │ ├── flutter-book.jpg │ │ ├── raspberry_pi.jpeg │ │ └── default.svg │ ├── shop.yaml │ ├── yotas.yaml │ └── osscameroon_issues.json ├── helpers │ ├── github.ts │ └── handlebars.ts ├── views │ ├── partials │ │ ├── tabs.hbs │ │ ├── shop.hbs │ │ ├── issues.hbs │ │ ├── contributors.hbs │ │ └── pagination.hbs │ ├── index.hbs │ ├── layouts │ │ └── main.hbs │ └── media │ │ └── oss.svg ├── yotas.ts ├── issues.ts ├── shop.ts └── index.ts ├── .github └── workflows │ ├── update_osscameroon_issues │ ├── get_yotas_issues.sh │ └── get_opened_issues.sh │ ├── notify_on_pull_request_open.yaml │ ├── update_osscameroon_issues.yaml │ └── miniyotas-deploy.yml ├── scripts ├── create_labels │ ├── labels.txt │ └── create_labels.sh └── get_user_contributions.sh ├── Dockerfile ├── Dockerfile.prod ├── LICENSE ├── README.md ├── package.json ├── .gitignore ├── tsconfig.json └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-language=typescript 2 | -------------------------------------------------------------------------------- /.env.template: -------------------------------------------------------------------------------- 1 | SERVICE_ACCOUNT_CONFIG= 2 | GOOGLE_ANALYTICS_ID= -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osscameroon/miniyotas/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/res/imgs/tshirt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osscameroon/miniyotas/HEAD/src/res/imgs/tshirt.jpg -------------------------------------------------------------------------------- /src/res/imgs/stickers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osscameroon/miniyotas/HEAD/src/res/imgs/stickers.jpg -------------------------------------------------------------------------------- /src/res/imgs/flutter-book.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osscameroon/miniyotas/HEAD/src/res/imgs/flutter-book.jpg -------------------------------------------------------------------------------- /src/res/imgs/raspberry_pi.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osscameroon/miniyotas/HEAD/src/res/imgs/raspberry_pi.jpeg -------------------------------------------------------------------------------- /.github/workflows/update_osscameroon_issues/get_yotas_issues.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | ./get_opened_issues.sh > opened_issues.json 6 | cat opened_issues.json | jq -s '. | flatten' 7 | -------------------------------------------------------------------------------- /src/helpers/github.ts: -------------------------------------------------------------------------------- 1 | export const extractHandleFromGitHubUrl = (url: string): string => { 2 | const urlArray: string[] = url?.split("/"); 3 | return urlArray[urlArray.length - 1]; 4 | }; 5 | -------------------------------------------------------------------------------- /.github/workflows/notify_on_pull_request_open.yaml: -------------------------------------------------------------------------------- 1 | name: notify of pull_request creation 2 | on: 3 | pull_request_target: 4 | types: [ opened ] 5 | branches: 6 | - main 7 | 8 | jobs: 9 | notify: 10 | uses: osscameroon/global-github-actions/.github/workflows/notify_on_pull_request_open.yaml@main 11 | secrets: 12 | telegram_channel_id: ${{ secrets.TELEGRAM_OSSCAMEROON_CHANNEL_ID }} 13 | telegram_token: ${{ secrets.TELEGRAM_BOT_TOKEN }} -------------------------------------------------------------------------------- /scripts/create_labels/labels.txt: -------------------------------------------------------------------------------- 1 | {"name":"5 Yotas","color":"1DB4E9", "description": "will provide you 5 yotas"} 2 | {"name":"10 Yotas","color":"019A79", "description": "will provide you 10 yotas"} 3 | {"name":"15 Yotas","color":"A86542", "description": "will provide you 15 yotas"} 4 | {"name":"25 Yotas","color":"F97221", "description": "will provide you 25 yotas"} 5 | {"name":"40 Yotas","color":"6AC41A", "description": "will provide you 40 yotas (Assign this label exceptionnally)"} 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | #pull the image 2 | FROM node:15.12.0-alpine 3 | 4 | # set the working directory in the container 5 | RUN mkdir /app 6 | 7 | #change mode of the container directory 8 | RUN chmod 777 /app 9 | 10 | # set the working directory in the container 11 | WORKDIR /app 12 | 13 | #copy the files to the container directory 14 | COPY package.json /app/package.json 15 | COPY . /app 16 | 17 | # install dependencies 18 | RUN yarn install 19 | 20 | # expose the port 21 | EXPOSE 3000 22 | 23 | # run the container 24 | CMD ["yarn", "dev"] 25 | -------------------------------------------------------------------------------- /src/views/partials/tabs.hbs: -------------------------------------------------------------------------------- 1 |
24 | -------------------------------------------------------------------------------- /scripts/create_labels/create_labels.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #get_org_repos print out organisation list of repositories 4 | #param: organisation name 5 | get_org_repos() { 6 | org=$1 7 | curl -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/$org/repos 2>/dev/null | jq '.[].url' -r 8 | } 9 | 10 | LABELS_PATH=./labels.txt 11 | ORG=osscameroon 12 | REPOSITORIES=$(get_org_repos $ORG) 13 | 14 | #create labels for every repository 15 | for repo in $REPOSITORIES; do 16 | while IFS= read -r line; do 17 | echo "l: $line" 18 | curl -X POST $repo/labels -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" -d ''"$line"'' 19 | #sleep to not break the GitHub api limit 20 | sleep 1 21 | done < $LABELS_PATH 22 | 23 | #sleep to not break the GitHub api limit 24 | sleep 1 25 | done 26 | -------------------------------------------------------------------------------- /Dockerfile.prod: -------------------------------------------------------------------------------- 1 | FROM node:16-buster as builder 2 | 3 | RUN mkdir /app && chmod 777 /app 4 | 5 | WORKDIR /app 6 | 7 | COPY package.json . 8 | 9 | RUN yarn install 10 | 11 | COPY src ./src/ 12 | COPY public ./public/ 13 | COPY src tsconfig.json ./ 14 | 15 | RUN yarn build 16 | 17 | FROM node:16-alpine as dependencies 18 | WORKDIR /app 19 | COPY --from=builder /app/package.json /app/yarn.lock ./ 20 | RUN yarn install --production 21 | 22 | FROM node:16-alpine AS production 23 | ENV NODE_ENV=production 24 | WORKDIR /app 25 | COPY --chown=node:node --from=dependencies /app/package.json /app/yarn.lock ./ 26 | COPY --chown=node:node --from=dependencies /app/node_modules ./node_modules 27 | RUN mkdir public src && chown node:node -R public 28 | COPY --chown=node:node --from=builder /app/dist ./src 29 | COPY --chown=node:node --from=builder /app/public ./public 30 | 31 | EXPOSE 3000 32 | 33 | CMD ["node", "src/index.js"] -------------------------------------------------------------------------------- /src/yotas.ts: -------------------------------------------------------------------------------- 1 | import YAML from "yaml"; 2 | import {extractHandleFromGitHubUrl} from "./helpers/github"; 3 | 4 | import * as fs from "fs"; 5 | 6 | const yotasFilePath = __dirname + "/res/yotas.yaml"; 7 | 8 | export type Record = { 9 | github_account: string; 10 | github_handle: string; 11 | yotas: number; 12 | grade: string; 13 | }; 14 | 15 | export const getYotas = async (): Promise
8 | {{else}}
9 | {{this.description}}
14 |
13 |
14 | Make a contribution to any of OSS Cameroon GitHub project and earn some Yotas.
18 |© {{currentYear}} OSS Cameroon, All rights reserved.
37 |18 | {{#each this.labels}} 19 | {{this}} 20 | {{/each}} 21 |
22 |23 | By {{this.author}} 25 |
26 |
25 |
26 |