Contributing Guide for sreetamdas.com
Thanks so much for contributing to my website, here's my favourite photo of dogs as a thank you!
This guide is also useful if you want to fork and use this project as a starting point for your own project.
If you're unsure about where you can start contributing, check out the issues page for open issues. Issues are (usually) labelled and you can start with the good first issue
label.
If you spot any typos, feel free to send a pull request! 🙂
Please mention that you're working on an issue so that you can be assigned to it.
This project utilizes a bunch of APIs for all kinds of different things: Buttondown.email API for my newsletter statistics, Supabase for page view counts, etc.
In order to provide a more seamless experience, I've set up Mock Service Worker which allows us to intercept and mock such requests at the network level. Pretty neat stuff!
By default, mocking is enabled via the NEXT_PUBLIC_API_MOCKING_ENABLED
environment variable set to true
in .env.example
. What this means is that you should be able to clone the repo, run npm i
, and start working without any additional setup! Make sure you rename .env.example
to .env
.
Please check out the specific version of Node.js specified in .nvmrc
(16.5.0
as of 7th October, 2021). You can use a node version manager like nvm or my personal choice n (In my experience, n
was much faster than nvm
).
Once you have the specified version of Node.js installed, make sure you've setup pnpm
and then you can run the following to get up and running.
pnpm i
pnpm dev
If you'd like to use your own API keys, open up .env.example
and replace the ${VARIABLE_NAME}
with your corresponding details. And when you're ready, disable mock service worker by removing the NEXT_PUBLIC_API_MOCKING_ENABLED
environment variable or setting it to false
.
I'm using the Notion API to fetch data for my Keebs page. Since this is a one off use case, You probably don't need to use this token. If you do, check out the docs!
I use Buttondown.email for my newsletter, and it supports queries for a bunch of things with its API — you can retrieve your API key from your dashboard.
You get an incredibly robust, flexible and intuitive solution for a Postgres database, authentication, storage and much more with Supabase — but personally I was most interested in working with a relational database.
Create a Supabase account, and create a new project. Create a (strong) database password and save it in a password manager (like 1password! or somewhere you won't forget.
Then, in your .env
file, set the NEXT_PUBLIC_SUPABASE_URL
and NEXT_PUBLIC_SUPABASE_ANON_KEY
variables to the URL and password you just created.