votey-uppy
votey-uppy copied to clipboard
votey-uppy
Check out the live working version!
Votey-uppy is an app to collect and vote on ideas.
The code is being developed in the open so follow along with the progress here!
Development
- Checkout the repo
-
yarn
to install node dependencies - Start a MongoDB server
- Create your local environment file:
-
cp .env.template .env.local
- Create a GitHub OAuth application
- Homepage URL:
http://localhost:3000/
- Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Homepage URL:
- Fill in your GitHub ID and secret into your local environment file
-
-
yarn dev
to start the Next.js
Make a user an admin
votey-uppy has a very basic role based system. There's only two roles: no role and admin.
To make a user an admin you need to run the following MongoDB queries:
# Connect to voteyUppy database
mongo voteyUppy
# Find the ObjectId of the user
db.users.find({ username: 'USERNAME_HERE' });
# Set the user's role
db.users.updateOne({_id: ObjectId("OBJECT_ID_HERE")}, { $set: { role: 'admin' }})
# (Optional) Remove the user's role
db.users.updateOne({_id: ObjectId("OBJECT_ID_HERE")}, { $unset: { role: '' }})
Roadmap
Milestone 1
- [x] Scaffold Next.js
- [x] Enable TypeScript for Next.js
- [x] Add ESLint
- [x] Add Tailwind
- [x] Add faker.js and fake rendering 10 items
- [x] Support absolute paths
- Enable StrictMode
- [x] Add NextAuth
- [x] Add react-query and first Next.js API endpoint
- [x] Enable StrictMode, create some shared types
- [x] Create shared Layout and Nav
- [x] Add MongoDB and expose via API
- [x] Add Next.js incremental static regeneration
Milestone 2
- [x] Pull username from GitHub when user signs in
- [x] Make all forms of AddItemForm configurable
- title, description, category
- By default status is set to
pending
- [x] Allow admin to view pending ideas
- Create admin flag on User
- Don't show pending in main feed
- [x] Create standalone Item page
- [x] Allow Admins to edit an existing Item
- Able to promote
pending
items toopen
- Able to promote
Milestone 3
- [x] Revise Item design
- [x] Switch to Formik
- [x] Revise Add new Item form
- [x] Revise Edit Item Form
- [x] Revise Profile design
- [x] Revise About design
- [x] Add docs on Add New Item page telling users it's been added to the queue and will be evaluated before being accepted
- [x] Show pending items on user's profile page
Milestone 4
- [x] Let user edit their own Item while it's still 'pending'
- [x] Show the username of who created the Item in the item UI
- [x] Filter items by:
- status
- category
- [x] Make homepage sortable in asc/desc order by:
- Votes
- Created
- [x] Remove Admin page and replace with Pending support for admins on home page
- [x] Make description field take in Markdown and render as markdown
- [x] True mobile support
- [x] Upvoting on individual item page doesn't update count
- [x] Save the date of when an item moves status
- Such that you can see when an item was submitted and when it was completed
- [x] Cleanup user._id and user.id usage
Milestone 5
- [x] Let admins set status when creating a new item
- [x] Let admin delete an item
- [ ] Add pagination to list of Items
- [ ] Support export to json functionality
- [ ] Maybe support priority order of items within a list
- [ ] Let user edit their profile details
- Can change their username
- Make sure their username change reflects in Item
- [ ] Migrate to Typegoose