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.
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.
We welcome contributions through pull requests! If you're working on a bug fix, new feature, or improvements, follow these steps:
- Fork the repository.
- Create a new branch with a descriptive name:
- For bug fixes:
fix/issue-number-fix-description
- For features:
feature/description-of-feature
- For bug fixes:
- Make your changes and commit following the Conventional Commits guidelines.
- Push your changes to your forked repository.
- Open a pull request from your branch to the
main
branch of the original repository. - Make sure you run
pnpm check
before submitting your pull request to ensure there are no issues.
To set up the project locally, follow these steps:
-
Fork the repository.
-
Clone the repository:
git clone <your-forked-repo-url>
cd honghong.me
-
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
- Install the dependencies:
pnpm install
- Run PostgreSQL using Docker (or your preferred method):
docker compose up
- Run the database migrations:
pnpm db:migrate
- Run the app in development mode:
pnpm dev
The services will be available at the following URLs:
Service | URL |
---|---|
App | localhost:3000 |
React Email | localhost:3001 |
Docs | localhost:3002 |
ESLint Config Inspector | localhost:7777 |
Database | localhost:8080 |
Redis | localhost:6379 |
Redis serverless | localhost:8079 |
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.
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
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
- Check everything:
pnpm check
Make sure your changes are well-tested and your code follows best practices. Thank you for contributing to honghong.me! 🚀