First of all, thanks for your interest in contributing to Plotwist! Here is a guide to help you contribute with this project. You can reach us on Discord. We can help you with the problems and you talk directly to the others developers and contributors.
It is important to mention that if you want to contribute you will need the Supabase keys, which are only available to members of the discord community that are part of the @Developers role (You'll need to ask to be a part of @Developers role for our moderators).
Summary:
- Getting Started
- Code Structure
- How to run the project locally
- Setting up environment variables
- How to start a development server
- Commit Convention
- Requesting and Reporting
This repository is a monorepo
. Which means that the source-code is stored on a single versioned repository.
- We use pnpm and workspaces for development.
- We use Turborepo as our build system. It is a modern tool for managing
monorepos
, focused on optimizing the development and build processes of projects in monorepos. Read the documentation here: Turborepo Documentation
apps
└── web
├── public
├── dictionaries
├── de-DE.json
├── en-US.json
├── es-ES.json
├── fr-FR.json
├── it-IT.json
├── ja-JP.json
├── pt-BR.json
├── src
├── components
├── app
├── [lang]
packages
└── emails [...]
└── tmdb
└── supabase [...]
└── typescript-config
git clone https://github.com/plotwist-app/plotwist.git
pnpm install
To run the project locally, you'll need to configure several environment variables. Here are the variables you need to set up:
NEXT_PUBLIC_TMDB_API_KEY=
(Obligatory)NEXT_PUBLIC_SUPABASE_URL=
(Obligatory)NEXT_PUBLIC_SUPABASE_ANON_KEY=
(Obligatory)NEXT_PUBLIC_MEASUREMENT_ID=
(Optional)RESEND_KEY=
(Optional)NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
(Optional)STRIPE_SECRET_KEY=
(Optional)STRIPE_WEBHOOK_SECRET=
(Optional)
⚠️ This is a obligatory environment variable you need to provide on your own.
Purpose: This key is used to access the TMDB (The Movie Database) API.
Instructions:
- Visit TMDB API and sign up for an account if you don't have one.
- Once logged in, navigate to your account settings and select "API" to create a new API key.
- Copy the generated API key and set it in your
.env
file:NEXT_PUBLIC_TMDB_API_KEY=your_tmdb_api_key
⚠️ This is a obligatory variable you need to provide on your own.
⚠️ While we are working on improving the contribution process, check our Discord group and ask to be a contributor, then use our development environment in Supabase provided by the developers in the group.
Purpose: These keys are used to connect to your Supabase project.
Instructions:
- Sign up for an account at Supabase if you don't have one.
- Create a new project and navigate to the project settings.
- Under the "API" section, you will find your
URL
andAnon Key
.NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
Purpose: This key is used for Google Analytics to track and analyze traffic.
Instructions:
- Go to Google Analytics and sign up for an account if needed.
- Create a new property and follow the setup instructions to get your Measurement ID.
- Copy the Measurement ID and set it in your
.env
file:NEXT_PUBLIC_MEASUREMENT_ID=your_measurement_id
Purpose: This key is used for sending emails through a service like Resend.
Instructions:
- Sign up for an account at Resend or any similar email sending service.
- Generate an API key from the dashboard.
- Copy the API key and set it in your
.env
file:RESEND_KEY=your_resend_key
Purpose: These keys are used to integrate Stripe for payment processing.
Instructions:
- Sign up for an account at Stripe
- Navigate to the Developers section and obtain your
Publishable Key
andSecret Key
. - To get the
Webhook Secret
, you need to set up a webhook endpoint:- In the Stripe dashboard, go to "Developers" -> "Webhooks" and create a new webhook.
- Set the webhook URL to your application's endpoint and select the events you want to listen to.
- Stripe will provide you with a Webhook Secret after the setup.
- Copy these keys and set them in your
.env
file:
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
- Navigate to the Developers section and obtain your
⚠️ Make sure your tools match those versions exactly if your facing issues running after the .env setup:
- npm: 10.5.2
- node: v20.13.1
- pnpm: 9.1.1
After setting up the environment variables, you can run the project:
pnpm run dev
When the app is running, use the interface to register a new user.
Once registered, you can interact with the authenticated processes within the app.
Here we use a convention to make the commits more productive. Before you create a Pull Request, please check whether your commits comply with the commit conventions used in this repository. Learn more here: https://www.conventionalcommits.org/en/v1.0.0/
When you create a commit we kindly ask you to follow the convention category (scope or module) message in your commit message while using one of the following categories:
-
feat / feature
: all changes that introduce completely new code or new features -
fix
: changes that fix a bug -
refactor
: any code related change that is not a fix nor a feature -
docs
: changing existing or creating new documentation -
build
: all changes regarding the build of the software, changes to dependencies or the addition of new dependencies -
test
: all changes regarding tests (adding new tests or changing existing ones) -
chore
: all changes to the repository that do not fit into any of the above categories
If you have a request for a new feature, please open a discussion on GitHub. We'll be happy to help you out!