Here are the ways to get involved with this project:
Before submitting your issue, make sure it has not been mentioned earlier. You can search through the existing issues or active discussions.
Please review the Reddit API Documentation and Rules before submitting a patch. Also, this project is not affiliated with Reddit in any way.
Found a bug you can fix? Fantastic! Pull requests are always welcome. Please follow the steps below to get started.
Use npx
and create-next-app
to install the project locally:
npx create-next-app --example https://github.com/gregrickaby/viewer-for-reddit viewer-for-reddit
- Fork the repo and create a
feature/
orhotfix/
branch offmain
- Work locally adhering to coding standards
- Run
npm run lint
- Make sure the app builds locally with
npm run build && npm run start
- Push your code to Github and open your PR (note: Your PR will be deployed to Vercel for QA after approval)
- Fill out the PR template and request a peer review
- After peer review, the PR will be merged back into
main
- Repeat ♻️
Your PR must pass automated assertions, deploy to Vercel successfully, and pass a peer review before it can be merged.
In order to authenticate with the Reddit API, you'll need to create a Reddit app:
- Visit https://www.reddit.com/prefs/apps
- Name:
My App
- Type
script
- Description:
My App Description
- About URL:
https://example.com
- Redirect URI:
https://my-app.vercel.app
- Name:
Take note of the client id
and secret
values. You will need these in a moment.
- Create an
.env
file in the root of the project:
cp .env.example .env.local
- Add your token to the
.env.local
file:
# Your Reddit Client ID
# Get one here: https://www.reddit.com/prefs/apps
REDDIT_CLIENT_ID="YOUR-TOKEN-HERE"
# Search Secret
NEXT_PUBLIC_SEARCH_SECRET="ANY-RANDOM-STRING-HERE"
# Used on production to verify the site with Google Webmaster Tools.
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION="YOUR-TOKEN-HERE"
The
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION
is only needed on Production. You can leave it as-is for local development.
There are a few NPM scripts available:
npm run dev
- Starts the development servernpm run lint
- Runs ESLint and Prettiernpm run build && npm start
- Builds the app for production and starts the server. This is great for catching bugs locally prior to a deployment.
I've found that running vercel
locally is a great way to verify Edge Functions and Middleware are working as expected.
To install the Vercel CLI, run:
npm i -g vercel
Then, pull down the ENV variables from Vercel:
vercel env pull
Finally, start a Vercel development server locally:
vercel dev
This repo is maintained by Greg Rickaby. By contributing code you grant its use under the MIT.