Pollu is an open-source straw poll platform built with privacy in mind! 🚀
It doesn't store your voters personal data, does its best to prevent duplicate and spam votes, and responds as fast as spawning a node js process. A single-language stack makes it easier for JavaScript to contribute. I tried my best to keep the codebase simple and straight forward.
This project uses the following stack:
- NextJS (React SSR + SSG)
- TailwindCSS for quickly iterating designs and new components
- Vercel Serverless Functions (+ 60s Edge Caching)
- ExpressJS
- Mongoose ODM
- Mongo Cloud as data storage
- StorybookJS for component development
-
Install required packages I use Yarn, so the installation command is
yarn
oryarn install
. -
Start developing on the frontend Navigate into the cloned repo directory and start it up.
cd pollu yarn dev
-
Start developing on both (backend and frontend) Navigate into the cloned repo directory and start it up.
cd pollu vercel dev
⚠️ To develop the backend you need a running local mongodb instance.
-
Open the source code and start editing!
Pollu is now running at
http://localhost:3000
and the API is running onhttp://localhost:3000/api/v1
!
A quick look at the top-level files and directories you'll see in this project.
.
├── .next
├── .storybook
├── .vercel
├── api
├── models
├── node_modules
├── pages
├── public
├── src
-
/.next
: This directory is produced by Nextjs for development purposes. -
/.storybook
: This directory includes configuration files for Storybook. -
/.vercel
: This directory (produced after you init your project with the vercel CLI) is used to store important information related to the deployed site. If you're contributing to the main website atpollu.vercel.app
then you won't need this folder. -
/api
: This directory contains all API serverless functions. -
/models
: This directory contains all Mongoose models. -
/node_modules
: This directory contains all installed packages. -
/pages
: This directory contains all frontend pages, SSG'ed and SSR'ed. -
/public
: This directory contains all files you wish to turn up in the production website output. -
/src
: This directory will contain all of the code related to what you will see on the front-end (what you see in the browser) such as React components, Storybook stories, and styling.src
is a convention for “source code”. -
/utils
: A few abstractions used across both frontend and backend.
You should also have a .env
at the root project directory that has two keys: [DB_PATH
, DB_NAME
] for the DB connection to be established correctly. This file must not be pushed to version control.
⚠️ I use prettier and eslint to manage style in this repo. Make sure you install them accordingly to save development time and make sure your contributions are compatible.
⚠️ I use the Angular commit message format so make sure you follow that when contributing.
I'm are open to all kinds of contributions. If you want to:
🤔 Suggest a feature
🐛 Report an issue
📖 Improve documentation
👩💻 Contribute to the code
You are more than welcome. Before contributing, kindly check the guidelines.
Thanks goes to these wonderful people (emoji key):
BamButz 💻 |
Mo Jiwa 💻 |
Saptarsi Saha 💻 |
Karley Petracca 💻 |
Sybil Jas 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!