Skip to content

Commit

Permalink
feat: ✨ codefair v1 (#30)
Browse files Browse the repository at this point in the history
* wip: 🚧 auth

* wip: 🚧 auth

* wip: 🚧 implementing authentication

* wip 🚧 sending user to client

* 🐛 fix: update probot to esm (#11)

* 🐛 fix: update env var name

* 🐛 fix: update folder name

* 🐛 fix: update probot to esm

* ✨ feat: add basic license get page

---------

Co-authored-by: Dorian Portillo <wheresdorian@gmail.com>

* refactor: ♻️ update pnpm-lock file

* wip: 🚧 ensure validated session returns user/session

* refactor: ♻️ update pnpm lock file

* fix: 🐛 mongodb adapter returns user

* ✨ feat: add license ui (#12)

* 🐛 fix: update env var name

* 🐛 fix: update folder name

* 🐛 fix: update probot to esm

* ✨ feat: add basic license get page

* 🚧 wip: add base ui

* ✨ feat: add license ui

---------

Co-authored-by: Dorian Portillo <wheresdorian@gmail.com>

* feat: ✨ profile page + fix on existing user sessions

* 🚧 fix: auth (#13)

* 🚧 wip: protected page

* 🚧 fix: auth

* ✨ feat: add base pages and auth (#14)

* 🚧 wip: add mongoose

* fix: 🐛 mongoose adapter/callback

* refactor: ♻️ use mongoose on client end

* chore: 🔨 remove unused code

* 🚧 wip: test permissions

* 🚧 wip: test permissions

* 🚧 wip: test permissions

* 🚧 wip: test permissions

* 🚧 wip: test permissions

* ✨ feat: add error sections

* 🧑‍💻 chore: remove console.logs

---------

Co-authored-by: slugb0t <wheresdorian@gmail.com>

* ✨ feat: update layout

* 🚨 chore: fix the linters

* ✨ feat: add an error component

* 🐛 fix: use built in error component instead

* 🐛 fix: editor list styling

* 🐛 fix: add explanation text

* 🐛 fix: route to home on login

* ✨ feat: add support for license creation

* 🚨 fix: linter fixes

* 🔨 chore: update ping

* feat: ✨ issue redesign (#16) (#15)

* dev: 👷 yml file for creating probot app

* wip: 🚧 dashboard issue

* dev: 👷 nodemon for probot

* refactor: ♻️ provide context for renderissue fn + nodemon file watch

* wip: 🚧 provide localhost list depending on production

* feat: ✨ provide link to PR for dashboard

* feat: ✨ update dashboard on push

* wip: 🚧 abstracting code

* wip: 🚧 abstract functions of probot

* feat: ✨ dashboard workflow for LICENSE

* wip: 🚧 clean license UI

* feat: ✨ help text for license UI

* feat: ✨ renderer file has documentation + db update

* feat: ✨ documentation for tools

* feat: ✨ documentation for probot event listeners

* refactor: ♻️ file name instead of just name on UI/add license page

* wip: 🚧 styling for license UI

Co-authored-by: Dorian Portillo <wheresdorian@gmail.com>

* refactor: ♻️ update middleware

* 🚚 wip: test path

* 🚚 wip: test path

* 🚚 wip: test path

* 🚚 wip: test path

* 🚚 wip: test path

* 🚚 wip: test path

* 🚚 wip: test path

* refactor: ♻️ downgrade probot

* refactor: ♻️ update api imports

* refactor: ♻️ explicitly call github app credentials

* dev: 📝 update gitignore

* feat: ✨ run probot programatically

* feat: ✨ run probot v12 on a server

* feat: ✨ metadata UI + probot workflow (#23)

* chore: 🔨 remove unnecessary files

* ✨ feat: add preliminary support for codeMetadata ui (#19)

* 🛂 fix: update auth roles

* 🚧 wip: codemetada schema

* 🚧 wip: codemetada schema

* 🚧 wip: add base form

* 🚧 wip: add cards to sub forms

* 🚧 wip: basic form

* 🚧 wip: on authors

* 🚚 wip: add authors

* 🚧 wip: add contributors

* 🚧 wip: add contributors

* ✨ feat: add support for codeMetadata ui

* feat: ✨ probot server + metadata workflow  (#18)

* dev: 📝 add scripts for dev running probot

* dev: 📝 update pnpm-lock file

* feat: ✨ store owner and new time fields for License collection

* feat: ✨ update dev script to use nodemon

* wip: 🚧 repo metadata update

* fix: 🐛 push and create pr for license request

* bug: :fix: pass repo object to render issues

* fix: 🐛 es6 import for humanparser

* wip: 🚧 creating repo metadata db entry

* feat: ✨ function documentation

* feat: ✨ update repo name if it changes

* fix: 🐛 pass correct parameters for data fetch

* fix: 🐛 extra field needed for authors metadata

* feat: ✨ update db if repo name changes

* feat: ✨ update on codemeta template function

* fix: 🐛 parameters for file checking

* docs: 📝 documentation on license functions

* strictly pass repo name rather than entire object

* chore: 🔨 updates

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>

* 🐛 fix: draft saves

* 🐛 fix: draft saves

* refactor: ♻️ prettier refactoring

* refactor: ♻️ use correct path for codemeta link in issue dashboard

* fix: 🐛 use correct value for author names

* feat: ✨ contributors added to metadata object

* refactor: ♻️ update gather authors fn for contributors

* chore: 🔨 todo notes

* refactor: ♻️ empty contributors + provide correct issue tracker link + update gather authors fn

* fix: 🐛 installation collection fix

* chore: 🔨 updates and comments

* refactor: ♻️ revert gather authors fn

* fix: 🐛 save value for select pickers with one selection

* fix: 🐛 store form in metadata value

* fix: 🐛 show value if one avail on initial load (select picker)

* fix: 🐛 probot's codemeta values modified to suit UI

* fix: 🐛 correct value name for author/contrib roles

* refactor: ♻️ change timestamps to unixmilliseconds

* ✨ feat: add support for saving codemetadata in repository (#20)

* fix: 🐛 use correct comparison with reponame on db

* refactor: ♻️ use unix millisecond in metadata

* refactor: ♻️ verify repo name abstracted and patched

* fix: 🐛 correct value for operating sys, runtime plat for code metadta

* fix: 🐛 proper badge color for codemetada found

* feat: ✨ improved layout on metadata UI

* ✨ feat: add dashboards (#22)

* ✨ feat: add repo dashboard page

* ✨ feat: add github acount dashboard

* style: 🎨 UI design for code metadata page

* refactor: ♻️ shorten help text on issue dashboard for license

* refactor: ♻️ update help text on license UI

* feat: ✨ UI help text added for codemetata

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>

* refactor: ♻️ remove validate button from codemeta section

* Staging (#24)

* test

* changes

* remove new lines in private key

* push

* push

* pls

---------

Co-authored-by: slugb0t <wheresdorian@gmail.com>

* 👷 ci: use node 20 in nixpacks

* fix: 🐛 replace nanoid

* fix: 🐛 remove port

* refactor: ♻️ determine master branch within context

* ✨ feat: add support for login redirects

* refactor: ♻️ Bot feedback (#25)

* fix: 🐛 update title for dashboard issue

* refactor: ♻️ update no license template

* refactor: ♻️ update success license text

* refactor: ♻️ update no metadata found template

* feat: ✨ Display link to repo on license editor

* 🐛 fix: update ui and fix access token (#26)

* 🐛 fix: update ui and fix access token

* 🐛 fix: add read env for port

* 🐛 fix: remove duplicate decleration

* refactor: ♻️ update on badge buttons

* refactor: ♻️ add url to codemeta section

* refactor: ♻️ About section updated

* refactor: ♻️ strictly open links in new tab

* refactor: ♻️ remove redirect

* feat: ✨ analytics collection for db

* refactor: ♻️ save license content + id upon push to repo

* feat: ✨ save license content and id upon push to repo

* style: 🎨 rounded and shadow to dashboard cards

* refactor: ♻️ update on the github dashboard

* fix: 🐛 grammar fix on title dashboard

* refactor: ♻️ update to the code meta ui

* refactor: ♻️ hide editorial section of codemeta:

* refactor: ♻️ update on license UI

* refactor: ♻️ updates

* refactor: ♻️ timestamps formatted to human readable format

* 👷 ci: add support for webhook based deployments (#27)

* 💚 ci: add pnpm to the ci env

* 💚 ci: remove unused item

* ✨ feat: add beta tag to dashboard

* ✨ feat: add a contact form

* feat: ✨ Dashboard UI Changes + License and Codemeta.json extraction (#28)

* feat: ✨ collapsible cards integrated for repo dashboard

* refactor: ♻️ remove pre data and final touches for repo dashboard

* style: 🎨 theme for project + help text for metadata subsection

* style: 🎨 collapsiblecard changes

* 📌 update pnpm lock file

* fix: 🐛 input correct name in codemeta.json file

* wip: 🚧 import codemeta.json file if exists in repo

* fix: 🐛 correct values for codemeta.json extraction

* wip: 🚧 grab license content from existing license

* style: 🎨 update dropdown icons for large layout form

* refactor: ♻️ adjustments for extracting codemeta.json info

* refactor: ♻️ changes applied to codemeta.json extraction

* refactor: ♻️ authors/contributors extraction changes

* fix: 🐛 contributor extraction workflow updated

* feat: ✨ detect and extract codemeta.json from repo

* fix: 🐛 correct key values for contrib + authors

* refactor: ♻️ update for licenseId regex

* fix: 🐛 changes to author + contrib extraction

* fix: 🐛 contributors/authors fix

* refactor: ♻️ file cleanup

* feat: ✨ extra codemeta.json upon detection

* dev: 👷 update pnpm-lock file

* feat: ✨ remove repo from installation collection upon uninstallation

* feat: ✨ event listener for alternate method of uninstallation

* fix: 🐛 metadata import with empty values

* fix: 🐛 buffer license content with base64

* feat: ✨ help links added to metadata and license page

* feat: ✨ coming soon zenodo card

* refactor: ♻️ subheader for zenodo card

* 💄 style: update ui

* feat: ✨ theme change + general UI updates (#29)

* wip: 🚧 background change

* refactor: ♻️ update bg

* refactor: ♻️ improvements on svg background blur

* feat: ✨ healthcheck added to bot

* refactor: ♻️ update healthcheck endpoint

* feat: ✨ nixpacks config file

* refactor: ♻️ move toml file

* refactor: ♻️ add packagemananger in package.json

* refactor: ♻️ move toml

* refactor: ♻️ testing dockerfile update

* refactor: ♻️ update toml

* 👷 ci: disable secondary deployment

* refactor: ♻️ specify node version in package.json

* refactor: ♻️ delte files

* 👷 ci: disable secondary deployment

* refactor: ♻️ hide bg image until finalized

* refactor: ♻️ node version

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>
  • Loading branch information
slugb0t and megasanjay authored Jul 11, 2024
1 parent 1e0e827 commit 9262c64
Show file tree
Hide file tree
Showing 82 changed files with 22,020 additions and 8,458 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {

endOfLine: "off",

"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-console": "warn",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",

"sort-keys-custom-order/object-keys": [
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to staging environment

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Install dependencies
run: pnpm install --frozen-lockfile

# - name: Run script
# env:
# COOLIFY_API_TOKEN: ${{ secrets.COOLIFY_API_TOKEN }}
# BOT_DEPLOY_HOOK: ${{ secrets.PRODUCTION_BOT_DEPLOY_HOOK }}
# UI_DEPLOY_HOOK: ${{ secrets.PRODUCTION_UI_DEPLOY_HOOK }}
# run: pnpm scripts:deploy
33 changes: 33 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to staging environment

on:
push:
branches:
- staging
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Install dependencies
run: pnpm install --frozen-lockfile

# - name: Run script
# env:
# COOLIFY_API_TOKEN: ${{ secrets.COOLIFY_API_TOKEN }}
# BOT_DEPLOY_HOOK: ${{ secrets.STAGING_BOT_DEPLOY_HOOK }}
# UI_DEPLOY_HOOK: ${{ secrets.STAGING_UI_DEPLOY_HOOK }}
# run: pnpm scripts:deploy
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ bot/node_modules
public/assets/css/styles.css
.DS_Store
nuxt-app/.nuxt/
.vercel
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"files.associations": {
"*.css": "tailwindcss"
},
"css.validate": false,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"vue.codeActions.enabled": false,
"editor.hover.enabled": true
}
2 changes: 1 addition & 1 deletion bot/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The ID of your GitHub App
APP_ID=
GITHUB_APP_ID=
WEBHOOK_SECRET=development
PRIVATE_KEY=

Expand Down
26 changes: 22 additions & 4 deletions bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# Start from a slim Node.js base image
FROM node:20-slim

# Set the working directory inside the container
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci --production
RUN npm cache clean --force

# Install pnpm globally
RUN npm install -g pnpm

# Copy package.json and pnpm-lock.yaml (or pnpmfile.js if using custom pnpm configuration)
COPY package.json pnpm-lock.yaml* ./

# Install dependencies with pnpm
RUN pnpm install --production

# Clean up pnpm store to reduce image size
RUN pnpm store prune --production

# Set environment variable for Node.js environment
ENV NODE_ENV="production"

# Copy the entire project files into the working directory
COPY . .
CMD [ "npm", "start" ]

# Specify the command to run your application
CMD [ "pnpm", "start" ]
17 changes: 17 additions & 0 deletions bot/api/github/webhooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { createNodeMiddleware, createProbot } = require("probot");

const app = require("../../index.js");

const probot = createProbot({
overrides: {
appId: process.env.APP_ID,
privateKey: process.env.PRIVATE_KEY,
secret: process.env.WEBHOOK_SECRET,
},
});

export default createNodeMiddleware(app, {
probot,
webhooksPath: "/api/github/webhooks",
});
9 changes: 0 additions & 9 deletions bot/api/github/webhooks/index.js

This file was deleted.

12 changes: 6 additions & 6 deletions bot/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ default_events:
# - deployment_status
# - fork
# - gollum
# - issue_comment
- issue_comment
- issues
# - label
# - milestone
Expand All @@ -35,11 +35,11 @@ default_events:
# - project_card
# - project_column
# - public
# - pull_request
# - pull_request_review
# - pull_request_review_comment
# - push
# - release
- pull_request
- pull_request_review
- pull_request_review_comment
- push
- release
# - repository
# - repository_import
# - status
Expand Down
Loading

0 comments on commit 9262c64

Please sign in to comment.