Skip to content

Commit 43686e4

Browse files
authored
Merge branch 'main' into main
2 parents 6524105 + df9b826 commit 43686e4

File tree

14 files changed

+154
-70
lines changed

14 files changed

+154
-70
lines changed

.all-contributorsrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,16 @@
463463
"code",
464464
"ideas"
465465
]
466+
},
467+
{
468+
"login": "SharizHussain",
469+
"name": "SharizHussain",
470+
"avatar_url": "https://avatars.githubusercontent.com/u/155846046?v=4",
471+
"profile": "https://github.com/SharizHussain",
472+
"contributions": [
473+
"bug",
474+
"code"
475+
]
466476
}
467477
],
468478
"contributorsPerLine": 7,

.env.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
AUTH_SECRET="" # A random string
2+
AUTH_URL="" # Should be http://localhost:3000 for local development
3+
AUTH_GITHUB_ID=""
4+
AUTH_GITHUB_SECRET=""
5+
XATA_API_KEY=""
6+
XATA_BRANCH="" # Default should be "main"
7+
8+
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="" # Optional
9+
NEXT_PUBLIC_ANALYTICS_WEBSITE_ID="" # Optional

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/node_modules
55
/.pnp
66
.pnp.js
7+
package-lock.json
78

89
# testing
910
/coverage

.xata/version/compatibility.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"@xata.io/cli":{"latest":"0.16.11","compatibility":[{"range":">=0.0.0"}]},"@xata.io/client":{"latest":"0.30.1","compatibility":[{"range":">=0.0.0"}]}}

CONTRIBUTING.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Contributing to Hacktoberfest Projects Finder
2+
3+
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.
4+
5+
## Setting Up the Project
6+
7+
1. Fork the repository on GitHub.
8+
2. Clone your forked repository:
9+
```sh
10+
git clone https://github.com/your-username/hacktoberfest-projects.git
11+
```
12+
3. Navigate to the project directory:
13+
```sh
14+
cd hacktoberfest-projects
15+
```
16+
4. Install dependencies (we recommend using `pnpm`):
17+
```sh
18+
pnpm install
19+
```
20+
5. Copy the `.env.example` file to `.env.local` and fill in the required environment variables.
21+
22+
## Creating a GitHub OAuth Application
23+
24+
To use GitHub authentication in the project, you need to create a GitHub OAuth application. Follow these steps:
25+
26+
1. Go to your GitHub account settings.
27+
2. Navigate to "Developer settings" > "OAuth Apps".
28+
3. Click on "New OAuth App".
29+
4. Fill in the application details:
30+
- Application name: "Hacktoberfest Projects Finder" (or your preferred name)
31+
- Homepage URL: `http://localhost:3000` (for local development)
32+
- Authorization callback URL: `http://localhost:3000/api/auth/callback/github`
33+
5. Click "Register application".
34+
6. On the next page, you'll see your Client ID. Click "Generate a new client secret" to create your Client Secret.
35+
7. Copy the Client ID and Client Secret to your `.env.local` file.
36+
37+
## Setting Up Xata
38+
39+
Xata is used as the database for this project. Follow these steps to set it up:
40+
41+
1. Sign up for a Xata account at https://xata.io/
42+
2. Install the Xata CLI globally:
43+
```sh
44+
npm install -g "@xata.io/cli@latest"
45+
```
46+
3. Authenticate with Xata:
47+
```sh
48+
xata auth login
49+
```
50+
4. Run the migration:
51+
```sh
52+
xata push main
53+
```
54+
55+
## Environment Variables
56+
57+
Create a `.env.local` file in the root of the project and add the following variables:
58+
```sh
59+
AUTH_SECRET="" # A random string
60+
AUTH_URL="" # Should be http://localhost:3000 for local development
61+
AUTH_GITHUB_ID=""
62+
AUTH_GITHUB_SECRET=""
63+
XATA_API_KEY=""
64+
XATA_BRANCH="" # Default should be "main"
65+
66+
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="" # Optional
67+
NEXT_PUBLIC_ANALYTICS_WEBSITE_ID="" # Optional
68+
```
69+
70+
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 that the `NEXT_PUBLIC_` variables are optional.
71+
72+
## Running the Project
73+
74+
After setting up the environment variables, you can start the development server:
75+
```sh
76+
pnpm dev
77+
```
78+
79+
The application should now be running at `http://localhost:3000`.
80+
81+
## Making Contributions
82+
83+
1. Create a new branch for your feature or bug fix:
84+
```sh
85+
git checkout -b feature/your-feature-name
86+
```
87+
2. Make your changes and commit them with a descriptive commit message.
88+
3. Push your changes to your fork:
89+
```sh
90+
git push origin feature/your-feature-name
91+
```
92+
4. Create a pull request from your fork to the main repository.
93+
94+
Please ensure your code follows the project's coding standards and includes appropriate tests if applicable.
95+
96+
## Questions or Issues
97+
98+
If you have any questions or run into issues, please open an issue in the GitHub repository. We're here to help!
99+
100+
Thank you for contributing to the Hacktoberfest Projects Finder!

README.md

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Web app that lets you find eligible repositories for Hacktoberfest!
66
Use it here - https://finder.usmans.me
77

88
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9-
[![All Contributors](https://img.shields.io/badge/all_contributors-47-orange.svg?style=flat-square)](#contributors-)
9+
[![All Contributors](https://img.shields.io/badge/all_contributors-48-orange.svg?style=flat-square)](#contributors-)
1010
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1111
<a href="https://gitmoji.dev">
1212
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square" alt="Gitmoji">
@@ -15,57 +15,13 @@ Use it here - https://finder.usmans.me
1515

1616
## Contributing
1717

18-
Contributions are always welcome!
18+
We welcome contributions from everyone! If you're interested in helping improve the Hacktoberfest Projects Finder, please take a look at our [CONTRIBUTING.md](CONTRIBUTING.md) file. It contains detailed information on how to set up the project locally, create a GitHub OAuth application, set up the Xata database, and submit your contributions.
1919

2020
> Pull Requests about adding languages will not be merged, if you want to suggest adding a new language, please [create an issue](https://github.com/max-programming/hacktoberfest-projects/issues/new) for that 🙂
2121
2222
### Run Locally
2323

24-
Clone the project
25-
26-
```bash
27-
git clone https://github.com/max-programming/hacktoberfest-projects.git
28-
```
29-
30-
Go to the project directory
31-
32-
```bash
33-
cd hacktoberfest-projects
34-
```
35-
36-
Install dependencies (if you want to use `npm` you can use but its recommended to use `pnpm`)
37-
38-
```bash
39-
pnpm i
40-
```
41-
42-
Start the server
43-
44-
```bash
45-
pnpm dev
46-
```
47-
48-
### Setup Xata
49-
50-
You will need to sign up with Xata and set up a database for the build. After registering for an account, please proceed with the following steps.
51-
52-
#### Installation
53-
54-
```
55-
npm install -g "@xata.io/cli@latest"
56-
```
57-
#### Authentication
58-
```
59-
xata auth login
60-
```
61-
62-
#### Migration
63-
64-
Change DB settings in xata.ts and .xatarc (do not commit this) and run migration
65-
66-
```
67-
xata push main
68-
```
24+
Follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) file to set up the project locally.
6925

7026
## Tech Stack
7127

@@ -157,6 +113,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
157113
<td align="center" valign="top" width="14.28%"><a href="http://jamesshopland.com"><img src="https://avatars.githubusercontent.com/u/5064896?v=4?s=100" width="100px;" alt="James Shopland"/><br /><sub><b>James Shopland</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=jolbol1" title="Code">💻</a> <a href="https://github.com/max-programming/hacktoberfest-projects/issues?q=author%3Ajolbol1" title="Bug reports">🐛</a></td>
158114
<td align="center" valign="top" width="14.28%"><a href="https://alone-y154.github.io/Portfolio-Website/"><img src="https://avatars.githubusercontent.com/u/72192888?v=4?s=100" width="100px;" alt="Yashwanth Krishna"/><br /><sub><b>Yashwanth Krishna</b></sub></a><br /><a href="#design-Alone-Y154" title="Design">🎨</a> <a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=Alone-Y154" title="Code">💻</a></td>
159115
<td align="center" valign="top" width="14.28%"><a href="https://github.com/massdx"><img src="https://avatars.githubusercontent.com/u/63166764?v=4?s=100" width="100px;" alt="Massahoud"/><br /><sub><b>Massahoud</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=massdx" title="Code">💻</a> <a href="#ideas-massdx" title="Ideas, Planning, & Feedback">🤔</a></td>
116+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/SharizHussain"><img src="https://avatars.githubusercontent.com/u/155846046?v=4?s=100" width="100px;" alt="SharizHussain"/><br /><sub><b>SharizHussain</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/issues?q=author%3ASharizHussain" title="Bug reports">🐛</a> <a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=SharizHussain" title="Code">💻</a></td>
160117
</tr>
161118
</tbody>
162119
</table>

src/app/(public)/_components/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function Button({
1111
...props
1212
}: PropsWithChildren<ButtonProps>) {
1313
return (
14-
<div className="relative inline-block m-3 group w-fit">
14+
<div className="relative inline-block group w-fit">
1515
<button
1616
className={cn(
1717
'bg-hacktoberfest-black hover:bg-hacktoberfest-dark-green btn btn-lg text-hacktoberfest-light rounded-2xl leading-none border-none h-auto p-2',

src/app/(public)/_components/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function Header() {
2626

2727
<div className="flex gap-2 lg:ml-40">
2828
<form action={session ? signOutAction : signInAction}>
29-
<button className="text-white border-white btn btn-ghost border-1 text-nowrap">
29+
<button className="text-white border-white btn btn-ghost border-1 text-nowrap ms-4">
3030
{session && session.user ? 'Sign Out' : 'Sign In'}
3131
</button>
3232
</form>

src/app/(public)/repos/[language]/_components/repo-card.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { RepoItem } from '@/types';
22
import { emojify } from '@twuni/emojify';
33
import { GoIssueOpened, GoRepoForked, GoStar } from 'react-icons/go';
44
import { ReportButton } from './report-button';
5+
import { cn } from '@/lib/utils';
56

67
const MAX_DESCRIPTION_LENGTH = 100;
78
const MAX_TOPICS_DISPLAY = 3;
@@ -16,7 +17,7 @@ interface RepoCardProps {
1617

1718
export function RepoCard({ repo }: RepoCardProps) {
1819
const truncatedDescription =
19-
repo.description.length > MAX_DESCRIPTION_LENGTH
20+
repo.description?.length > MAX_DESCRIPTION_LENGTH
2021
? repo.description.substring(0, MAX_DESCRIPTION_LENGTH) + '...'
2122
: repo.description;
2223

@@ -28,7 +29,7 @@ export function RepoCard({ repo }: RepoCardProps) {
2829
});
2930

3031
const displayedTopics = sortedTopics.slice(0, MAX_TOPICS_DISPLAY);
31-
const hasMoreTopics = sortedTopics.length > MAX_TOPICS_DISPLAY;
32+
const hasMoreTopics = sortedTopics?.length > MAX_TOPICS_DISPLAY;
3233

3334
return (
3435
<section className="transition duration-300 shadow-sm card bg-hacktoberfest-black ring-1 ring-hacktoberfest-light-pink hover:scale-105 hover:shadow-2xl hover:shadow-hacktoberfest-deep-pink">
@@ -63,7 +64,7 @@ export function RepoCard({ repo }: RepoCardProps) {
6364

6465
<h6 className="my-5 text-lg text-hacktoberfest-beige">
6566
{emojify(truncatedDescription)}
66-
{repo.description.length > MAX_DESCRIPTION_LENGTH && (
67+
{repo.description?.length > MAX_DESCRIPTION_LENGTH && (
6768
<a
6869
href={repo.html_url + '?ref=finder.usmans.me'}
6970
target="_blank"
@@ -82,11 +83,12 @@ export function RepoCard({ repo }: RepoCardProps) {
8283
href={`https://github.com/topics/${topic}`}
8384
target="_blank"
8485
rel="noreferrer"
85-
className={`badge inline px-3 py-0.5 h-auto ${
86+
className={cn(
87+
'badge inline px-3 py-0.5 h-auto',
8688
topic === 'hacktoberfest'
8789
? 'bg-hacktoberfest-light-green text-hacktoberfest-dark-green'
8890
: 'bg-hacktoberfest-deep-pink text-hacktoberfest-light-pink'
89-
}`}
91+
)}
9092
>
9193
{topic}
9294
</a>
@@ -98,7 +100,7 @@ export function RepoCard({ repo }: RepoCardProps) {
98100
</div>
99101

100102
{/* stars and forks cards */}
101-
<div className="flex flex-wrap justify-between gap-4 mt-8 cursor-pointer container-query text-neutral-100">
103+
<div className="flex flex-wrap justify-between mt-8 gap-4 cursor-pointer container-query text-neutral-100">
102104
<a
103105
href={`${repo.html_url}/stargazers?ref=finder.usmans.me`}
104106
target="_blank"

src/app/(public)/repos/[language]/_components/sorter.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ export function Sorter() {
117117

118118
return (
119119
<div className="flex items-center justify-center gap-2 mb-8">
120-
<div className="dropdown dropdown-hover">
120+
<div className="dropdown group dropdown-hover">
121121
<Button
122122
tabIndex={0}
123123
className="hover:bg-hacktoberfest-green hover:text-hacktoberfest-dark-green"
124124
>
125125
<Code className="w-6 h-6 mr-2" />
126126
Language
127127
</Button>
128-
<div className="z-50 h-64 p-2 overflow-y-scroll shadow dropdown-content bg-base-100 rounded-box w-60">
128+
<div className="z-50 h-64 p-2 overflow-y-scroll shadow dropdown-content hidden group-hover:block bg-base-100 rounded-box w-60">
129129
<ul tabIndex={0} className="menu menu-vertical">
130130
{mainLanguages.sort(sortByName).map(language => (
131131
<li key={language} onClick={handleClick}>
@@ -137,15 +137,15 @@ export function Sorter() {
137137
</ul>
138138
</div>
139139
</div>
140-
<div className="dropdown dropdown-hover">
140+
<div className="dropdown dropdown-hover group">
141141
<Button
142142
tabIndex={0}
143143
className="hover:bg-hacktoberfest-green hover:text-hacktoberfest-dark-green"
144144
>
145145
<ArrowUpAZ className="w-6 h-6 mr-2" />
146146
{selectedSort()}
147147
</Button>
148-
<div className="z-50 h-64 p-2 overflow-y-scroll shadow dropdown-content bg-base-100 rounded-box w-60">
148+
<div className="z-50 h-64 p-2 overflow-y-scroll shadow dropdown-content hidden group-hover:block -ml-16 bg-base-100 rounded-box w-60">
149149
<ul tabIndex={0} className="menu menu-vertical">
150150
{navigationItems.map((item, index) => {
151151
const sp = item.onSelect(new URLSearchParams(searchParams));

0 commit comments

Comments
 (0)