Skip to content

Latest commit

 

History

History
101 lines (62 loc) · 3.73 KB

CONTRIBUTING.md

File metadata and controls

101 lines (62 loc) · 3.73 KB

How to Contribute

Myntenance is a welcoming project and we're really happy to build it together. All kind of contributions are welcome: suggestions and bug reports are as valuable as code contributions!

You can find in this document the steps to run the project locally and get ready to contribute.

Something is wrong or missing? Feel free to open an issue or a pull request.

Run the project locally

Install the dependencies with pnpm:

pnpm install

Duplicate the file .env.example and rename it to .env.local to set up the environment variables.

Start the development server:

pnpm run dev

That's it! You can now access the project at http://localhost:3000.

Setup the local environment (Optional)

For changes not affecting the database schema there's nothing to setup, you can connect to the production Supabase instance with the provided anon key in the .env.example file.

However, you must follow the steps below if you need to make changes to the database schema or if you want to run e2e tests.

We will enable login through GitHub OAuth App and setup a local supabase instance.

Setup GitHub App (Authentication)

In order to enable login through GitHub you need to create a GitHub App. You can get from there the two keys needed to enable the authentication.

You can learn more on the official GitHub documentation or follow the steps below:

  1. On GitHub go to Settings -> Developer Settings -> GitHub Apps and click the New GitHub App button.

  2. Fill in the values as shown in the image below.

    • Make sure http://localhost:54321/auth/v1/callback is set as the Callback URL as this will be your local supabase URL.
    • You can also disable Expire user authorization tokens for development purposes.

    GitHub App settings

  3. Disable Webhook (make sure Active is unchecked)

  4. Setup Repository permissions (scroll down in the same page)

    • Set Read-only for: Actions, Contents, Metadata, Pull requests
    • Set Read & Write for: Issues
  5. Setup User permissions (scroll down in the same page)

    • Set Read-only for: Email addresses
  6. Optional: You can keep Where can this GitHub App be installed? as Only on this account for development purposes.

  7. Click on Create GitHub App button.

  8. Click on Generate a new client secret.

  9. Copy the Client ID and Client Secret and paste them in the .env.local file, respectively into the REACT_APP_GITHUB_CLIENT_ID and REACT_APP_GITHUB_CLIENT_SECRET variables.

    GitHub App keys

Setup Supabase (Database)

During development you will use a local Supabase instance. Make sure to have Docker installed on your machine and running.

  1. Run pnpm run supabase:start to start the database container (the first time it will take a while to download the image).
  2. Copy the following values into your .env.local file:
    • NEXT_PUBLIC_SUPABASE_URL -> From API URL (default: http://localhost:54321)
    • NEXT_PUBLIC_SUPABASE_ANON_KEY -> From anon key
    • SUPABASE_SERVICE_KEY -> From service key Supabase keys

Git Workflow

  1. Fork the repository
  2. Clone the repository to your local machine
  3. Create a new branch
 git checkout -b <branch-name>
  1. Make your changes
  2. Commit and push your changes
 git add .
 git commit -m "commit message"
 git push origin <branch-name>
  1. Create a pull request
  2. Wait for the pull request to be reviewed and merged