Files
calendar/packages/platform/examples/base
0072aba55d refactor: v2 event-types (#15457)
* refactor: UserAvatarGroupWithOrg.tsx remove unecessary profile prop

* chore: define event-type types in platform/types

* feat: event-type transformes in lib and re-exported through platform-libraries

* chore: define user types in platform/types

* chore: add users endpoint to platform-constants

* refactor: app-store use narrowed down booker event type

* chore: version old event-types module

* fix: old event-types e2e test

* fix: libraries add missing export

* fix: reset libraries version to 0

* feat: new event-types module and users endpoints

* feat: make booker atom work with v2 event-types

* updating event type

* refactor: remove guard for get event-types

* refactor: move private hook to public

* Revert "refactor: remove guard for get event-types"

This reverts commit d41204069f1d5bb1305b388ce53399f9175f4249.

* Revert "refactor: move private hook to public"

This reverts commit 09322e8fba102e57104959f79ed6bfa9a677dc9d.

* refactor: get by username and slug in /event-types

* remove console log

* feat: locations handle displayEventPublicly

* test e2e event-types

* revert: user output from types

* refactor: event-types hooks have private and public folders

* refactor: require event-type.slug in input

* refactor: demand that all labels of booking fields are unique

* refactor: remove unused import

* refactor: only have email and name by default in booker

* refactor: add booking field slug

* fix: display event-type location publicly / hide it in booker

* fix: display event-type location publicly / hide it in booker

* fix: packages/lib tests

* fix: typescript in e2e test

* fix: dynamic event types input

* refactor: use IsIn instead of IsEnum

* refactor: simplify getEventTypes

* fix: use ApiAuthGuard instead of AccessTokenGuard

* chore: export more stuff from libraries

* refactor: SchedulingTypeEnum and Type

---------

Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
2024-06-21 10:49:12 +00:00
..
2024-06-21 10:49:12 +00:00

Atoms examples

Example apps using atoms - customizable UI components to integrate scheduling into your product.

Running examples apps locally

  1. Cal's backend is required to run example apps, so clone https://github.com/calcom/cal.com and follow setup instructions in the readme. Importantly, you need to have Google credentials setup by following this section in the docs.

  2. Open "apps/api/v2/.env" and copy environment variables below, and then copy NEXTAUTH_SECRET from the root ".env" of repository cloned in step 1.

NODE_ENV="development"
API_PORT=5555
DATABASE_READ_URL="postgresql://postgres:@localhost:5450/calendso"
DATABASE_WRITE_URL="postgresql://postgres:@localhost:5450/calendso"
API_URL="http://localhost"
NEXTAUTH_SECRET="copy from .env of root of repository cloned in step 1"
DATABASE_URL="postgresql://postgres:@localhost:5450/calendso"
JWT_SECRET="asjdijI1JIO12I3O89198jojioSAJDU"
REDIS_URL="redis://localhost:6379"
  1. Start "apps/api/v2" api using yarn dev.
  2. Start "packages/platform/atoms" atoms package with yarn dev.
  3. Start "apps/web" cal web app using yarn dx.
  4. Open your browser at "http://localhost:3000/" and login with admin username admin@example.com and password ADMINadmin2022!.
  5. In the web app navigate to http://localhost:3000/settings/organizations/new and create a sample organization. When asked for phone verification code enter 111111.
  6. In the web app navigate to http://localhost:3000/settings/organizations/platform/oauth-clients and create a new oAuth client - give all permissions and set redirect uri to http://localhost:4321 which points to example app.
  7. Setup environment for the example app you want to run:
    1. First, copy ".env.example" into ".env".
    2. Open ".env" file and paste client id from step 8 in NEXT_PUBLIC_X_CAL_ID and client secret in X_CAL_SECRET_KEY. If in step 2 you used the same environment variables, then NEXT_PUBLIC_CALCOM_API_URL can stay as is. Otherwise adjust the port to point to the same API_PORT as you used in step 2.
  8. Navigate to example app and setup database by running rm -f prisma/dev.db && yarn prisma db push.
  9. Start the example app by running yarn dev and go to http://localhost:4321.
  10. In the Google Cloud Console "API & Services" "Credentials" https://console.cloud.google.com/apis/credentials open web project setup in step 1 and add http://localhost:5555/v2/gcal/oauth/save to the authorized redirect URIs.
Screenshot 2024-03-21 at 09 42 36