Skip to content

theabbie/mailblog

Repository files navigation

MailBlog - Inbox powered blog

mailblog

MailBlog is a blog that is managed via your Email Inbox and allows you to create and manage your own blog posts by sending an email.

Email Configuration

For GMail, Allow Less Secure Apps, If 2FA is turned on, use App password

Follow Similar steps for other E-Mail Providers.

Environment Variables

put these values in .env.local file (in root directory of project) or set these values for the hosting provider,

EMAIL=<EMAIL USED FOR BLOG>
PASSWORD=<EMAIL PASSWORD>
DB=postgres://username:password@HOSTNAME/DB_NAME
IMAP_HOST=imap.gmail.com
IMAP_PORT=993

Blog Metadata

update components/config.js file to set metadata for your blog

Installation

You can host this blog either as a static website, or a dynamic one, but first, initialize the database,

Use Commands from DB.sql to create a Database for your blog.

Static Hosting

npm run dev

now go to localhost:3000/api/refresh to fetch emails and update your database, Now you can build,

npm run build
npm run export

Now deploy the out directory to your hosting provider.

The disadvantage is that it only updates blogs while building, thus, you need to repeat this process everytime you want to refresh.

Dynamic hosting

You can host it as a dynamic website, for example, on Vercel, to do so, simply run,

vercel --prod

Or if you want to host it on a VPS,

npm run build
npm run start

revalidate is set to 30 minutes (1800 seconds), you can change that in components/config.js, it's the duration after which list updates.

You can also trigger fetching emails by visiting localhost:3000/api/refresh, which will populate the database with new unread emails.

Contributing

Thank you for your interest in contributing, If you feel like there's something missing or any new feature can be added, just create a PR and I will see the rest.

Help

You can contact me on social media, Everything about me can be found here

Credits

Contact

Contact me anywhere, just visit my portfolio

License

This project is licensed under MIT License, See LICENSE for more information