Skip to content

Latest commit

 

History

History
141 lines (96 loc) · 3.84 KB

CONTRIBUTING.md

File metadata and controls

141 lines (96 loc) · 3.84 KB

Contributing Guideline

Please open an issue to discuss the contribution you wish to make before submitting any changes.

This way we can guide you through the process and give feedback.

🏁 Quick Start

You will need Node.js >=20.11.1, pnpm >=9.12.0 and Docker >= 20.10 installed on your machine.

Optionally, you can use Docker Slim to reduce the container image size.

Up and Running

  1. Install the required toolchain & SDK: Node.js, pnpm, and Docker.
  2. Create .env file or copy from .env.example, then configure required variables.
  3. Generate application secret key: pnpm generate:key
  4. Install required project dependencies: pnpm install
  5. Start the database server and local SMTP server: pnpm pre-dev
  6. Run project in development mode: pnpm dev

If you don't have OpenSSL installed, an alternative option for generating a secret key is to use 1password to create a random secret.

Application will run at http://localhost:3000

For detailed explanation on how things work, check out Remix documentation.

OAuth Configuration

Callback: http://localhost:3000/auth/<PROVIDER>/callback

Webhooks

In order to receive webhooks (i.e. notifications, payment integrations, etc), you will need to expose the local port to the internet. To expose a local port to the internet, you can use service like Tailscale Funnel, Expose by Beyond Code, or ngrok.

In this case we will use Tailscale Funnel. By default, no alias for tailscale is set up. If you plan on frequently accessing the Tailscale CLI, you can add an alias to your .bashrc or .zshrc to make it easier.

alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
tailscale funnel --bg=false http://localhost:3000
tailscale funnel status

Reference: https://www.twilio.com/blog/expose-localhost-to-internet-with-tunnel

🔰 Database Migration

TODO: add more information here

Testing

Unit Testing

pnpm test            # Run unit tests
pnpm test:coverage   # Run unit tests and generate coverage report
pnpm test:report     # View the unit test report
pnpm test:ui         # Launch the unit test runner UI

E2E Testing

pnpm e2e-test:install   # Install dependencies for E2E testing
pnpm e2e-test:ui        # Launch the E2E test runner UI

pnpm e2e-test:chrome    # Run end-to-end tests in Chrome browser
pnpm e2e-test:firefox   # Run end-to-end tests in Firefox browser
pnpm e2e-test:safari    # Run end-to-end tests in Safari browser
pnpm e2e-test:mobile    # Run end-to-end tests for mobile devices

pnpm e2e-test:report    # Generate and view the E2E test report

🐳 Docker Container

Development Server

# Start development server
docker-compose up -d

# Stop development server
docker-compose down --remove-orphans --volumes

Build Container

pnpm docker:build

List Docker Images

pnpm docker:images

Testing Container

# Run API Docker container in foreground
docker run --rm -it -p 3000:3000 --name remix-start --env-file .env remix-start

Push Images

Sign in to container registry:

echo $REGISTRY_TOKEN | docker login ghcr.io --username YOUR_USERNAME --password-stdin

Push docker image:

docker push ghcr.io/riipandi/remix-start:latest

🚀 Deployment

Read Deployment Guide for detailed documentation.