Skip to content

Latest commit

 

History

History
102 lines (79 loc) · 3.38 KB

CONTRIBUTING.md

File metadata and controls

102 lines (79 loc) · 3.38 KB

Contributing to Hacktoberfest Projects Finder

Thank you for your interest in contributing to the Hacktoberfest Projects Finder! We welcome contributions from everyone. This document will guide you through the process of setting up the project locally and creating a GitHub OAuth application.

Setting Up the Project

  1. Fork the repository on GitHub.
  2. Clone your forked repository:
git clone https://github.com/your-username/hacktoberfest-projects.git
  1. Navigate to the project directory:
cd hacktoberfest-projects
  1. Install dependencies (we recommend using pnpm):
pnpm install
  1. Copy the .env.example file to .env.local and fill in the required environment variables.

Creating a GitHub OAuth Application

To use GitHub authentication in the project, you need to create a GitHub OAuth application. Follow these steps:

  1. Go to your GitHub account settings.
  2. Navigate to "Developer settings" > "OAuth Apps".
  3. Click on "New OAuth App".
  4. Fill in the application details:
  • Application name: "Hacktoberfest Projects Finder" (or your preferred name)
  • Homepage URL: http://localhost:3000 (for local development)
  • Authorization callback URL: http://localhost:3000/api/auth/callback/github
  1. Click "Register application".
  2. On the next page, you'll see your Client ID. Click "Generate a new client secret" to create your Client Secret.
  3. Copy the Client ID and Client Secret to your .env.local file.

Setting Up Xata

Xata is used as the database for this project. Follow these steps to set it up:

  1. Sign up for a Xata account at https://xata.io/
  2. Install the Xata CLI globally:
npm install -g "@xata.io/cli@latest"
  1. Authenticate with Xata:
xata auth login
  1. Run the migration:
xata push main

Environment Variables

Create a .env.local file in the root of the project and add the following variables:

AUTH_SECRET="" # A random string
AUTH_URL="" # Should be http://localhost:3000 for local development
AUTH_GITHUB_ID=""
AUTH_GITHUB_SECRET=""
XATA_API_KEY=""
XATA_BRANCH="" # Default should be "main"

NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="" # Optional
NEXT_PUBLIC_ANALYTICS_WEBSITE_ID="" # Optional

Make sure to fill in the required values for each variable. The AUTH_SECRET should be a random string, and AUTH_URL should be set to http://localhost:3000 for local development. The XATA_BRANCH should typically be set to "main" unless you're using a different branch.

Remember to remove env variables that are optional and you are empty, they will cause validation errors

Running the Project

After setting up the environment variables, you can start the development server:

pnpm dev

The application should now be running at http://localhost:3000.

Making Contributions

  1. Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
  1. Make your changes and commit them with a descriptive commit message.
  2. Push your changes to your fork:
git push origin feature/your-feature-name
  1. Create a pull request from your fork to the main repository.

Please ensure your code follows the project's coding standards and includes appropriate tests if applicable.

Questions or Issues

If you have any questions or run into issues, please open an issue in the GitHub repository. We're here to help!

Thank you for contributing to the Hacktoberfest Projects Finder!