This is a roadmap voting app built with TypeScript and Next.js that's deployed on Vercel. It uses Upstash for the DB and next-auth for authentication.
Link to project: https://100devs-roadmap.vercel.app/
TypeScript, Next.js, Upstash
The minimalist nature of this roadmap voting app makes it versatile and easily customizable. I took it from a template on Vercel and did some tinkering with it. The template comes with docs, but they're outdated, so I wrote an updated version.
Currently, you're only allowed to vote up. You can't take your vote back or vote down. I'm not sure if people should be able to vote down, but I'll add the voting up ability later.
- Project Set Up
- Environment Variables Configuration
- Database
- User authentication with next-auth
- Running the project
- Admin Permissions
- Deploying to Vercel
Clone this repo or download the zip and drop it on your code editor. On your terminal, run:
npm install
Duplicate the .env.local.example
file and name it .env.local
(which
will be ignored by Git).
Go to the Upstash Console and create a new database.
UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
find the variables in
the database details page in Upstash Console.
IMPORTANT
Make sure you scroll down a bit until you see the REST API
section. Copy those two items, not the endpoint and password.
We will use the next-auth library for authentication. This repo is preconfigured to use GitHub OAuth.
To set up GitHub for authentication:
-
Go to GitHub Developer Settings on GitHub.
-
On the left panel, click OAuth Apps and then click "New GitHub App."
-
Give your app a name.
-
Add your "Homepage URL" (you can use a placeholder of any website).
-
For the "Callback URL" field, put http://localhost:3000.
-
If the active field under "Webhook" is checked, uncheck it. Now, click on " Create Github App."
-
Once your app is created, you should see the following screen. Click on " Generate a new client secret."
-
Copy the client secret you generated and paste it under the
GITHUB_SECRET
value in your .env file -
Copy the Client ID and paste it under the
GITHUB_ID
value in your .env file
In the project folder, run
npm run dev
Only admin users can delete and release content.
NEXT_PUBLIC_ADMIN_EMAILS
: Enter GitHub emails here, separated by commas.
First, create a new Github repository and push your local changes.
Make sure you manually add all Environment Variables in your .env file to Vercel during the import process.