Migrate docs to mono repo (#1814)
* Initial commit Created from https://vercel.com/new * Update config * Homepage * Self-hosting * Integrations * More docs pages * Developer docs * Update billing.mdx * Update install.mdx * Fix install guide * More fixes * Adding CSS guide * Fix capitalisation on Microsoft page * Added delete account update * Added Zapier integration question * Added GMeet integration part * Added Delete Account to Settings * unnecessary question mark * Added a link to Settings * Added stuff in Billing * Added a link to cal.com/signup * Capitalization * Added language change * Added more stuff in Event Types * Added how to change email * Added FAQ page * Spelling mistake * Added a title to FAQ * Added more stuff to Billing * Availability multi-booking * Deleted from Availability added to FAQ * Added to FAQ * Removed the dot * Added stuff to FAQ * Add license warning to adding CSS page * Update docker.mdx * Add import instructions * removed readme until we have our own * updated favicon, added cal sans * added new cal sans * Create README.md * renamed all github links * renamed more github links * Added team's Event Types * Clarified the Google Meet integration * Spelling error * Added primary calendar tutorial * Removed tutorial * primary calendar selection * Moved to subdirectory * Matching configs * Shares eslint config between web and docs * Removes format-schemas * Updates env file location in turbo * [docs] updates monorepo intructions Co-authored-by: baileypumfleet <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: milospuac <[email protected]> Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
69 files changed
+6986
-90
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import Callout from 'nextra-theme-docs/callout';
|
||||
|
||||
# Adding CSS
|
||||
|
||||
<Callout>
|
||||
Adding or modifying CSS counts as changing the code, so as per [our license](https://github.com/calcom/cal.com/blob/main/LICENSE) you must either open-source your modified version or purchase an enterprise license.
|
||||
</Callout>
|
||||
|
||||
Cal.com uses [TailwindCSS](https://tailwindcss.com) as a replacement for traditional CSS styling within the application, but some people prefer to add CSS styles themselves.
|
||||
|
||||
CSS files should be stored in the `styles` directory within the codebase.
|
||||
|
||||
Within the `styles` directory, you will find two CSS files, `fonts.css` and `global.css`. We suggest not to add to these files, and instead create new CSS files and import them into the application. This helps reduce conflicts when pulling in changes that we've made to either of the existing CSS files.
|
||||
|
||||
## Adding new stylesheets
|
||||
Firstly, create the CSS file inside the `styles` directory.
|
||||
|
||||
Then, open the `pages/_app.tsx` file, and you will see the following two lines:
|
||||
```javascript
|
||||
import "../styles/fonts.css";
|
||||
import "../styles/globals.css";
|
||||
```
|
||||
|
||||
Duplicate one of these import statements and change the path to link to your new CSS stylesheet, like so:
|
||||
```javascript
|
||||
import "../styles/your-new-stylesheet.css";
|
||||
```
|
||||
|
||||
<Callout type="warning" emoji="⚠️">
|
||||
These styles will apply to all pages and components in your application.
|
||||
</Callout>
|
||||
|
||||
Due to the global nature of stylesheets, and to avoid conflicts, you may **only import them inside `pages/_app.tsx`**.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Code Styling
|
||||
Keeping our code styles consistent is key to making the repository easy to read and work with.
|
||||
|
||||
We use a number of style guides written by other amazing companies, simply because they are widely used and because we like working with them.
|
||||
|
||||
We don't expect you to study every single rule of each style guide, but these are great reference points as to how your code should be styled. We may reject a pull request if your code style significantly differs from these style guides however.
|
||||
|
||||
## ESLint & Prettier
|
||||
Calendso uses the ESLint and Prettier formatting tools, and the repository comes with defined rules for each tool. We recommend setting up both tools and using these to help automatically style your code to our guidelines.
|
||||
|
||||
## JavaScript/TypeScript
|
||||
We use the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) for all JavaScript and Typescript code.
|
||||
|
||||
## HTML & CSS
|
||||
We use the [Google HTML/CSS Style Guide](https://google.github.io/styleguide/htmlcssguide.html) for any HTML and CSS markup. However, exceptions to the HTML guide apply where JSX differentiates from standard HTML.
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"migrations": "Migrations",
|
||||
"pre-fill": "Pre-fill fields",
|
||||
"code-styling": "Code styling",
|
||||
"project-structure": "Project structure",
|
||||
"pull-requests": "Pull requests",
|
||||
"adding-css": "Adding CSS"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# Database Migrations
|
||||
As described in the [upgrade guide](https://docs.cal.com/self-hosting/upgrading.md), you should use the `npx prisma migrate dev` or `npx prisma migrate deploy` command to update the database.
|
||||
|
||||
We use database migrations in order to handle changes to the database schema in a more secure and stable way. This is actually very common. The thing is that when just changing the schema in `schema.prisma` without creating migrations, the update to the newer database schema can damage or delete all data in production mode, since the system sometimes doesn't know how to transform the data from A to B. Using migrations, each step is reproducable, transparent and can be undone in a simple way.
|
||||
|
||||
## Creating migrations
|
||||
If you are modifying the codebase and make a change to the `schema.prisma` file, you must create a migration.
|
||||
|
||||
To create a migration for your previously changed `schema.prisma`, simply run the following:
|
||||
```
|
||||
npx prisma migrate dev
|
||||
```
|
||||
|
||||
Now, you must create a short name for your migration to describe what changed (for example, "user_add_email_verified"). Then just add and commit it with the corresponding code that uses your new database schema.
|
||||
|
||||
:::caution
|
||||
|
||||
Always keep an eye on what migrations Prisma is generating. Prisma often happily will drop entire columns of data because it can't figure out what to do.
|
||||
|
||||
:::
|
||||
|
||||
## Error: The database schema is not empty
|
||||
Prisma uses a database called `_prisma_migrations` to keep track of which migrations have been applied and which haven't. If your local migrations database doesn't match up with what's in the actual database, then Prisma will throw the following error:
|
||||
```
|
||||
Error: P3005
|
||||
|
||||
The database schema for `localhost:5432` is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline
|
||||
```
|
||||
|
||||
In order to fix this, we need to tell Prisma which migrations have already been applied.
|
||||
|
||||
This can be done by running the following command, replacing `migration_name` with each migration that you have already applied:
|
||||
```
|
||||
npx prisma migrate resolve --applied migration_name
|
||||
```
|
||||
|
||||
You will need to run the command for each migration that you want to mark as applied.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Pre-fill fields
|
||||
|
||||
You can pre-fill a number of fields on the booking form by using their corresponding URL parameters. This can include the user’s name, email, or guests to be added to the booking.
|
||||
|
||||
Usually when they go to the link, all that is needed will be the time of the booking, and the form will be pre-filled with the information given.
|
||||
|
||||
Pre-filling booking fields can save a lot of time and speed up processes with filling out these forms, and assist with a smooth integration with your existing website or app.
|
||||
|
||||
You can pre-fill a user’s name and email address like so:
|
||||
```text
|
||||
cal.com/rick/quick-chat/[email protected]&name=John
|
||||
```
|
||||
The data is persisted through the 3 booking pages; and is used to prefill the booking form.
|
||||
|
||||
Guests can also be added to the link, there is also no limit to the amount of guests you wish to add.
|
||||
|
||||
These should be added to your link like this:
|
||||
```text
|
||||
[email protected]&[email protected]
|
||||
```
|
||||
@@ -0,0 +1,46 @@
|
||||
# Project Structure
|
||||
|
||||
This page gives an overview of how the codebase is structured so you can easily dive into the Cal.com code.
|
||||
|
||||
Cal.com is written in Next.js, so you will find that we follow Next.js best practices for structure and layouts.
|
||||
|
||||
## Basic folder structure
|
||||
|
||||
The project comprises of the following folder structure:
|
||||
|
||||
```text
|
||||
.github/ - GitHub configuration files
|
||||
ISSUE_TEMPLATE/
|
||||
workflows/
|
||||
.husky/ - Git hooks
|
||||
.vscode/ - VS Code editor configuration
|
||||
components/ - Application components
|
||||
booking/
|
||||
dialog/
|
||||
team/
|
||||
ui/
|
||||
lib/ - Reusable code
|
||||
emails/
|
||||
events/
|
||||
forgot-password/messaging/
|
||||
integrations/CalDav/
|
||||
teams/
|
||||
pages/ - Most of the project lives here
|
||||
[user]/ - Booking pages
|
||||
api/ - The backend API
|
||||
auth/ - Next-Auth.js and other authentication routes
|
||||
availability/
|
||||
bookings/
|
||||
cancel/
|
||||
event-types/
|
||||
integrations/
|
||||
reschedule/
|
||||
settings/
|
||||
team/
|
||||
prisma/ - The database schema and migrations
|
||||
migrations/
|
||||
public/ - Images and static files
|
||||
integrations/
|
||||
styles/
|
||||
test/lib/
|
||||
```
|
||||
@@ -0,0 +1,33 @@
|
||||
# Pull Requests
|
||||
|
||||
## Requirements
|
||||
|
||||
We have a number of requirements for PRs to ensure they are as easy to review as possible and to ensure that they are up to standard with the code.
|
||||
|
||||
### Title & Content
|
||||
|
||||
Start by providing a short and concise title. Don’t put something generic (e.g. bug fixes), and instead mention more specifically what your PR achieves, for instance “Fixes dropdown not expanding on settings page”.
|
||||
|
||||
For the PR description, you should go into much greater detail about what your PR adds or fixes. Firstly, the description should include a link to any relevant issues or discussions surrounding the feature or bug that your PR addresses.
|
||||
|
||||
#### Feature PRs
|
||||
|
||||
Give a functional overview of how your feature works, including how the user can use the feature. Then, share any technical details in an overview of how the PR works (e.g. “Once the user enters their password, the password is hashed using BCrypt and stored in the Users database field”).
|
||||
|
||||
#### Bug Fix PRs
|
||||
|
||||
Give an overview of how your PR fixes the bug both as a high-level overview and a technical explanation of what caused the issue and how your PR resolves this.
|
||||
|
||||
Feel free to add a short video or screenshots of what your PR achieves. Loom is a great way of sharing short videos.
|
||||
|
||||
### Code Quality & Styling
|
||||
|
||||
All submitted code must match our [code styling](/docs/code-styling) standards. We will reject pull requests that differ significantly from our standardised code styles.
|
||||
|
||||
All code is automatically checked by Codacy and our linting process, and will notify you if there are any issues with the code that you submit. We require that code passes these quality checks before merging.
|
||||
|
||||
## PR review process
|
||||
|
||||
At least two members of the Calendso team should review and approve any PR before it is merged.
|
||||
|
||||
Once two members of the team have approved this, someone from the team will merge the PR. If you are part of the Calendso team, you should merge your own PRs once you have received both approvals.
|
||||
Reference in new issue
Block a user