Skip to content

Latest commit

 

History

History
135 lines (90 loc) · 3.74 KB

CONTRIBUTING.md

File metadata and controls

135 lines (90 loc) · 3.74 KB

Contributing to honghong.me

Welcome to the honghong.me repository! We're glad you're interested in contributing to our Next.js blog project. By contributing, you help make our project better and more useful for everyone. Below are some guidelines to get you started.

Table of Contents

Issues

If you encounter any issues, have suggestions, or want to report a bug, feel free to create an issue. When creating an issue, please include a clear and descriptive title, along with relevant details about the problem or suggestion. This will help us understand and address the issue more effectively.

Pull Requests

We welcome contributions through pull requests! If you're working on a bug fix, new feature, or improvements, follow these steps:

  1. Fork the repository.
  2. Create a new branch with a descriptive name:
    • For bug fixes: fix/issue-number-fix-description
    • For features: feature/description-of-feature
  3. Make your changes and commit following the Conventional Commits guidelines.
  4. Push your changes to your forked repository.
  5. Open a pull request from your branch to the main branch of the original repository.
  6. Make sure you run pnpm check before submitting your pull request to ensure there are no issues.

Setup

To set up the project locally, follow these steps:

  1. Fork the repository.

  2. Clone the repository:

git clone <your-forked-repo-url>
cd honghong.me
  1. Copy the .env.example file to .env.local:

    Most features are turned off by default, so you don't need to set up all the environment variables to run the app. However, if you want to use a specific feature, you can set the necessary environment variables in the .env.local file and set the flags to true.

cp .env.example .env.local
  1. Install the dependencies:
pnpm install
  1. Build the necessary packages:
pnpm build:packages
  1. Run PostgreSQL using Docker Compose (or your preferred method):
mkdir -p ./volumes/pg_data
docker compose up
  1. Seed the database:
pnpm db:push
pnpm db:seed
  1. Run the app in development mode:
pnpm dev

The app will be available at localhost:3000.

The react email will be available at localhost:3001.

Flags

The following flags can be set in the .env.local file to enable specific features:

  • NEXT_PUBLIC_FLAG_COMMENT: Comments on blog posts.
  • NEXT_PUBLIC_FLAG_AUTH: Authentication.
  • NEXT_PUBLIC_FLAG_STATS: Dashboard page.
  • NEXT_PUBLIC_FLAG_SPOTIFY: Spotify integration (Now Playing).
  • NEXT_PUBLIC_FLAG_ANALYTICS: Umami analytics.
  • NEXT_PUBLIC_FLAG_GUESTBOOK_NOTIFICATION: Discord notification for guestbook.
  • NEXT_PUBLIC_FLAG_LIKE_BUTTON: Like button for blog posts.

Conventional Commits

We follow the Conventional Commits specification for commit messages. This helps us maintain a clear and organized commit history. Your commit messages should be formatted as follows:

<type>(<scope>): <description>

For example:

  • feat(homepage): add new hero section
  • fix(styles): correct header alignment

Code Formatting

Before submitting a pull request, make sure your code is properly formatted. You can use the following commands to format your code:

  • Run lint fixes:
pnpm lint:fix
  • Format code:
pnpm format
  • Check everything:
pnpm check

Make sure your changes are well-tested and your code follows best practices. Thank you for contributing to honghong.me! 🚀