cal.pub0.org/packages/app-store-cli
Joe Au-Yeung a9a295dc54
Admin apps UI (#5494)
* Abstract app category navigation

* Send key schema to frontend

Co-authored-by: Omar López <zomars@users.noreply.github.com>

* Render keys for apps on admin

* Add enabled col for apps

* Save app keys to DB

* Add checks for admin role

* Abstract setup components

* Add AdminAppsList to setup wizard

* Migrate to v10 tRPC

* Default hide keys

* Display enabled apps

* Merge branch 'main' into admin-apps-ui

* Toggle calendars

* WIP

* Add params and include AppCategoryNavigation

* Refactor getEnabledApps

* Add warning for disabling apps

* Fallback to cal video when a video app is disabled

* WIP send disabled email

* Send email to all users of  event types with payment app

* Disable Stripe when app is disabled

* Disable apps in event types

* Send email to users on disabled apps

* Send email based on what app was disabled

* WIP type fix

* Disable navigation to apps list if already setup

* UI import fixes

* Waits for session data before redirecting

* Updates admin seeded password

To comply with admin password requirements

* Update yarn.lock

* Flex fixes

* Adds admin middleware

* Clean up

* WIP

* WIP

* NTS

* Add dirName to app metadata

* Upsert app if not in db

* Upsert app if not in db

* Add dirName to app metadata

* Add keys to app packages w/ keys

* Merge with main

* Toggle show keys & on enable

* Fix empty keys

* Fix lark calendar metadata

* Fix some type errors

* Fix Lark metadata & check for category when upserting

* More type fixes

* Fix types & add keys to google cal

* WIP

* WIP

* WIP

* More type fixes

* Fix type errors

* Fix type errors

* More type fixes

* More type fixes

* More type fixes

* Feedback

* Fixes default value

* Feedback

* Migrate credential invalid col default value "false"

* Upsert app on saving keys

* Clean up

* Validate app keys on frontend

* Add nonempty to app keys schemas

* Add web3

* Listlocale filter on categories / category

* Grab app metadata via category or categories

* Show empty screen if no apps are enabled

* Fix type checks

* Fix type checks

* Fix type checks

* Fix type checks

* Fix type checks

* Fix type checks

* Replace .nonempty() w/ .min(1)

* Fix type error

* Address feedback

* Added migration to keep current apps enabled

* Update apps.tsx

* Fix bug

* Add keys schema to Plausible app

* Add appKeysSchema to zod.ts template

* Update AdminAppsList.tsx

Co-authored-by: Omar López <zomars@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
2022-12-07 14:47:02 -07:00
..
src Admin apps UI (#5494) 2022-12-07 14:47:02 -07:00
.gitignore [Feature] App Store CLI - Make it super easy to add an app. (#2917) 2022-06-07 11:43:32 +05:30
package.json Update all Yarn dependencies (2022-08-17) (#3887) 2022-08-29 17:55:27 -06:00
readme.md AppStore CLI: Making video app creation a breeze with major cleanup of locations code throughout (#3825) 2022-08-25 18:48:50 -06:00
tsconfig.json [Feature] App Store CLI - Make it super easy to add an app. (#2917) 2022-06-07 11:43:32 +05:30

readme.md

Steps to create an app

  • Create a folder in packages/app-store/{APP_NAME} = {APP}
  • Fill it with a sample app
    • Modify {APP}/_metadata.ts with the data provided

Approach

  • appType is derived from App Name(a slugify operation that makes a string that can be used as a director name, a variable name for imports and a URL path).
  • appType is then used to create the app directory. It becomes config.type of config.json. config.type is the value used to create an entry in App table and retrieve any apps or credentials. It also becomes App.dirName
  • dirnames that don't start with _ are considered apps in packages/app-store and based on those apps .generated.ts* files are created. This allows pre-cli apps to keep on working.
  • app directory is populated with app-store/_baseApp with newly updated config.json and package.json
  • packages/prisma/seed-app-store.config.json is updated with new app.

NOTE: After app-store-cli is live, Credential.appId and Credential.type would be same for new apps. For old apps they would remain different. Credential.type would be used to identify credentials in integrations call and Credential.appId/App.slug would be used to identify apps. If we rename all existing apps to their slug names, we can remove type and then use just appId to refer to things everywhere. This can be done later on.

TODO

  • Improvements
    • Edit command Improvements
      • Prefill fields in edit command -> It allows only that content to change which user wants to change.
      • Don't override icon.svg
    • Merge app-store:watch and app-store commands; introduce app-store --watch
    • Allow inputs in non interactive way as well - That would allow easily copy pasting commands.
    • An app created through CLI should be able to completely skip API validation for testing purposes. Credentials should be created with no API specified specific to the app. It would allow us to test any app end to end not worrying about the corresponding API endpoint.
    • Require assets path relative to app dir.

Roadmap

  • Avoid delete and edit on apps created outside of cli
  • Someone can add wrong directory name(which doesn't satisfy slug requirements) manually. How to handle it.
  • Allow editing and updating app from the cal app itself - including assets uploading when developing locally.
  • Improvements in shared code across app
    • Use baseApp/api/add.ts for all apps with configuration of credentials creation and redirection URL.
  • Delete creation side effects if App creation fails - Might make debugging difficult
    • This is so that web app doesn't break because of additional app folders or faulty db-seed