Skip to content

Commit 7bf4095

Browse files
authored
Merge pull request #46 from arnabnandy7/feature/persistSavedSearches
fix: improve saved search reliability and documentation
2 parents f8569f3 + 81378b6 commit 7bf4095

6 files changed

Lines changed: 242 additions & 145 deletions

File tree

‎AGENTS.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<!-- BEGIN:nextjs-agent-rules -->
2+
23
# This is NOT the Next.js you know
34

4-
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
5+
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
6+
7+
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
8+
59
<!-- END:nextjs-agent-rules -->

‎README.md‎

Lines changed: 43 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,62 @@
11
# OpenIssue.dev
22

3-
> Discover open-source contribution opportunities by technology, not by endless searching.
3+
[OpenIssue.dev](https://openissue-dev.vercel.app/) helps developers find active, contributor-friendly GitHub issues by technology.
44

5-
OpenIssue.dev helps developers find active GitHub issues that are actually looking for contributors. Search by technology stack, filter contributor-friendly labels, and quickly identify issues that match your skills.
5+
## What it does
66

7-
Whether you're making your first open-source contribution or looking for a new project to contribute to, OpenIssue.dev makes issue discovery simple and efficient.
7+
- Searches live GitHub issues by language or ecosystem topic
8+
- Filters by contributor-friendly label, linked pull requests, and Hacktoberfest readiness
9+
- Sorts and ranks results using activity, repository, assignment, and discussion signals
10+
- Supports reusable saved searches without requiring an account
11+
- Adds GitHub sign-in for cloud-backed saved searches that survive cleared browser storage
12+
- Provides light, dark, and system themes with a responsive interface
813

9-
---
14+
## Quick start
1015

11-
## ✨ Features
16+
Requirements: Node.js 22+, npm, a GitHub token, and a Turso database.
1217

13-
### 🔍 Search by Technology
18+
```bash
19+
npm install
20+
cp .env.example .env.local
21+
npm run dev
22+
```
1423

15-
Find issues related to:
24+
Open [http://localhost:3000](http://localhost:3000). GitHub OAuth and database persistence require the additional configuration described in [Setup and deployment](doc/setup.md).
1625

17-
* Java
18-
* Spring Boot
19-
* React
20-
* Angular
21-
* Vue
22-
* Python
23-
* Django
24-
* FastAPI
25-
* Go
26-
* Rust
27-
* Kubernetes
28-
* Docker
29-
* Terraform
30-
* AWS
31-
* Azure
32-
* GCP
33-
* And many more...
26+
## Low-level design
3427

35-
### 🏷️ Contributor-Friendly Labels
28+
```mermaid
29+
flowchart LR
30+
UI[Issue Finder UI] --> SearchRoute["GET /api/search"]
31+
SearchRoute --> SearchService[Search and ranking]
32+
SearchService <--> GitHubAPI[GitHub APIs]
33+
SearchService --> UI
3634
37-
Discover issues tagged with:
35+
UI <--> Local[(Local storage)]
36+
UI --> AuthRoute["/api/auth/*"]
37+
AuthRoute --> BetterAuth[Better Auth]
38+
BetterAuth <--> GitHubOAuth[GitHub OAuth]
3839
39-
* `help wanted`
40-
* `good first issue`
41-
* `up-for-grabs`
42-
* `first-timers-only`
43-
* `documentation`
44-
* `bug`
45-
* `enhancement`
40+
Local --> SyncClient[Saved-search sync]
41+
SyncClient --> SavedRoute["/api/saved-searches"]
42+
SavedRoute --> BetterAuth
43+
SavedRoute --> Drizzle[Drizzle ORM]
44+
BetterAuth --> Drizzle
45+
Drizzle <--> Turso[(Turso / libSQL)]
46+
```
4647

47-
### 📊 Smart Filtering
48+
See [Architecture and data flow](doc/architecture.md) for the expanded request flows, persistence model, and component relationships.
4849

49-
Filter results by:
50+
## Documentation
5051

51-
* Technology
52-
* Labels
53-
* Repository popularity
54-
* Last updated date
55-
* Number of comments
56-
* Issue activity
52+
- [Setup and deployment](doc/setup.md)
53+
- [Architecture and data flow](doc/architecture.md)
54+
- [Development and contributing](doc/contributing.md)
5755

58-
### ⚡ Fast & Lightweight
56+
## Tech stack
5957

60-
* Serverless architecture
61-
* Powered by GitHub APIs
62-
* No installation required
63-
* Optimized for Vercel deployment
58+
Next.js 16, React 19, TypeScript, Tailwind CSS, Better Auth, Drizzle ORM, Turso/libSQL, GitHub APIs, Vitest, Vercel, and SonarQube Cloud.
6459

65-
---
60+
## License
6661

67-
## 🎯 Why OpenIssue.dev?
68-
69-
Finding a suitable open-source issue can be frustrating:
70-
71-
* Thousands of repositories
72-
* Inconsistent labels
73-
* Outdated issue lists
74-
* Endless GitHub searches
75-
76-
OpenIssue.dev brings contributor-friendly issues into one place and helps developers focus on contributing instead of searching.
77-
78-
---
79-
80-
## 🚀 Use Cases
81-
82-
### First-Time Contributors
83-
84-
Find beginner-friendly issues and start contributing to open source with confidence.
85-
86-
### Experienced Developers
87-
88-
Discover challenging issues in technologies already used professionally.
89-
90-
### Students
91-
92-
Build real-world experience by contributing to active projects.
93-
94-
### Open Source Enthusiasts
95-
96-
Explore projects across multiple ecosystems and communities.
97-
98-
---
99-
100-
## 🏗️ How It Works
101-
102-
1. Select a technology stack.
103-
2. Choose one or more contribution labels.
104-
3. Browse active GitHub issues.
105-
4. Open the issue directly on GitHub.
106-
5. Start contributing.
107-
108-
---
109-
110-
## 📈 Roadmap
111-
112-
### MVP
113-
114-
* [x] Technology-based issue discovery
115-
* [x] Help Wanted filtering
116-
* [x] Good First Issue filtering
117-
* [x] GitHub issue links
118-
* [x] Repository metadata
119-
120-
### Future Enhancements
121-
122-
* [ ] GitHub authentication
123-
* [ ] Personalized recommendations
124-
* [ ] Saved searches
125-
* [ ] Email alerts
126-
* [ ] Trending opportunities
127-
* [ ] Repository health scoring
128-
* [ ] Contribution history tracking
129-
* [ ] Weekly digest
130-
131-
---
132-
133-
## 🛠️ Tech Stack
134-
135-
* Next.js
136-
* React
137-
* TypeScript
138-
* Tailwind CSS
139-
* GitHub Search API
140-
* Vercel
141-
142-
---
143-
144-
## 🤝 Contributing
145-
146-
Contributions, feature requests, and bug reports are welcome.
147-
148-
If you have ideas to make open-source discovery easier, feel free to open an issue or submit a pull request.
149-
150-
---
151-
152-
## 🌟 Mission
153-
154-
OpenIssue.dev exists to reduce the gap between developers who want to contribute and open-source projects that need help.
155-
156-
**Less searching. More contributing.** 🚀
157-
158-
---
159-
160-
## 📄 License
161-
162-
Apache 2.0 License.
62+
Licensed under the [Apache License 2.0](LICENSE).

‎doc/architecture.md‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Architecture and data flow
2+
3+
## Application overview
4+
5+
OpenIssue.dev uses the Next.js App Router. The main interface is a client component backed by route handlers for GitHub search, authentication, and saved-search persistence.
6+
7+
```mermaid
8+
flowchart LR
9+
subgraph Client[Browser]
10+
UI[Issue Finder UI]
11+
Local[(Local storage)]
12+
UI <--> Local
13+
end
14+
15+
subgraph App[Next.js application]
16+
SearchAPI["GET /api/search"]
17+
SearchService[Search and ranking]
18+
AuthAPI["/api/auth/*"]
19+
BetterAuth[Better Auth]
20+
SavedAPI["/api/saved-searches"]
21+
Drizzle[Drizzle ORM]
22+
end
23+
24+
subgraph External[External services]
25+
GitHubAPI[GitHub Search and REST APIs]
26+
GitHubOAuth[GitHub OAuth]
27+
Turso[(Turso / libSQL)]
28+
end
29+
30+
UI -->|Search filters| SearchAPI
31+
SearchAPI --> SearchService
32+
SearchService -->|Issues and repository metadata| GitHubAPI
33+
SearchService -->|Ranked results| UI
34+
35+
UI -->|Sign in or sign out| AuthAPI
36+
AuthAPI --> BetterAuth
37+
BetterAuth <--> GitHubOAuth
38+
BetterAuth --> Drizzle
39+
40+
Local -->|Signed-in synchronization| SavedAPI
41+
SavedAPI -->|Validate session| BetterAuth
42+
SavedAPI --> Drizzle
43+
Drizzle <--> Turso
44+
```
45+
46+
## Issue discovery
47+
48+
`GET /api/search` validates and rate-limits requests before querying GitHub. Languages use GitHub language qualifiers; framework and ecosystem terms such as React, Next.js, Spring Boot, and Kubernetes use repository topics.
49+
50+
Candidate issues are enriched where possible with repository metadata, recent discussion, assignment state, linked pull requests, and Hacktoberfest signals. The application ranks them for contributor relevance and returns paginated results to the browser.
51+
52+
Search filters currently include:
53+
54+
- Technology or ecosystem
55+
- Contributor-friendly label
56+
- Recently updated, most commented, or newest sorting
57+
- Any, present, or absent linked pull request
58+
- All issues or Hacktoberfest-ready issues
59+
60+
## Authentication
61+
62+
Better Auth handles GitHub OAuth and stores users, provider accounts, and sessions in Turso through Drizzle. Authentication is optional for discovery and local saved searches.
63+
64+
Production uses `https://openissue-dev.vercel.app` as the OAuth proxy target. Allowed hosts include localhost, the production domain, and Vercel preview subdomains.
65+
66+
## Saved searches
67+
68+
Saved searches use a hybrid persistence model:
69+
70+
- Guests read and write browser `localStorage`.
71+
- Signed-in users retain the same local behavior and synchronize with Turso.
72+
- Existing local searches migrate after sign-in in batches of at most 100.
73+
- Server records restore the local cache after browser data is cleared.
74+
- Deletion is performed in Turso before the local record is removed.
75+
- API queries and deletes are scoped to the authenticated user ID.
76+
- Local data remains usable if cloud synchronization is temporarily unavailable.
77+
78+
## Data model
79+
80+
The database contains Better Auth's `user`, `session`, `account`, and `verification` tables plus `saved_search`. Saved searches reference `user.id` with cascading deletion and store the selected filter values and creation timestamp.
81+
82+
Schema definitions live in `src/lib/auth-schema.ts`; executable SQL is versioned under `db/migrations/`.

‎doc/contributing.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Development and contributing
2+
3+
## Workflow
4+
5+
Create a focused branch from the latest default branch and keep unrelated changes out of the pull request. The repository commonly uses names such as:
6+
7+
```text
8+
feature/descriptiveFeatureName
9+
bugfix/descriptiveBugName
10+
fix/descriptiveFixName
11+
```
12+
13+
Before submitting a change, run:
14+
15+
```bash
16+
npm run lint
17+
npm test
18+
npm run test:coverage
19+
npm run build
20+
```
21+
22+
The test suite uses Vitest. Coverage thresholds are configured in `vitest.config.ts`, and SonarQube Cloud consumes `coverage/lcov.info`.
23+
24+
## Project structure
25+
26+
| Path | Responsibility |
27+
| --- | --- |
28+
| `src/app/` | App Router pages, metadata, and API routes |
29+
| `src/components/` | Shared application and UI components |
30+
| `src/features/issues/` | Issue-search UI, ranking, persistence, types, and GitHub integration |
31+
| `src/lib/` | Authentication, database client, and database schema |
32+
| `db/migrations/` | Ordered Turso SQL migrations |
33+
| `tests/` | Unit, component, and route-handler tests |
34+
35+
## Database changes
36+
37+
Database changes must update both the Drizzle schema and a new ordered SQL migration. Migrations may be public because they describe structure, not credentials. Never include tokens, secrets, or production records in them.
38+
39+
## Testing guidance
40+
41+
Test meaningful behavior: validation, authorization, data transformation, error handling, and user actions. Exclude only declarative framework wiring or generated code that contains no application decisions. Keep Vitest and Sonar coverage exclusions aligned.
42+
43+
## Pull requests
44+
45+
Use a concise summary, list behavior and database changes, include verification results, and link the relevant issue with `Closes #<number>` when appropriate. Signed and SSH/GPG-verified commits can be created with:
46+
47+
```bash
48+
git commit -s -S -m "type: concise description"
49+
```

0 commit comments

Comments
 (0)