Local Development
A guide on how to run Unsend’s codebase locally
Introduction
Unsend’s codebase is fully open-source on github
Here is the codebase structure
The apps
directory contains the code for:
-
web
: Code for our dashboard and email infra -
marketing
: The code for the landing page of Unsend -
docs
: The documentation that you are currently reading.
The packages
directory contains the code for:
-
eslint-config
package contains shared ESLint configuration settings -
sdk
package contains typescript sdk for unsend rest api -
tailwind-config
This package contains a shared Tailwind CSS configuration. -
typescript-config
This package contains a shared typescript configuration -
ui
This package is a collection of reusable UI components like buttons, badges, etc
Running Unsend locally
To run Unsend, locally you will need to setup the following:
-
AWS Free tier account will work.
-
Cloudflare Free tier account will work.
-
Docker Recommended but not mandatory
Fork and Clone the repo
Fork the repo
Click on the fork button on Github to fork the repo
Clone the repo
Once the repo is forked you can clone it on your local machine using:
Install Dependencies
Setup environment variables:
Copy the env.example file into .env
Nextauth secret
Use the following command to generate a key and add it under NEXTAUTH_SECRET
Setup Github Oauth
Next, create a new GitHub App. This will allow you to sign in to Unsend with your GitHub account.4
Add the homepage as:
and callback URL as:
Once the app is added you can add the Client ID under GITHUB_ID
and CLIENT SECRET under GITHUB_SECRET
Setup AWS credentials
Next, we need to add in the AWS credentials. Follow the detailed guide to get the AWS credentials with accurate permissions and add them in:
Once the app is added you can add the Client ID under GITHUB_ID
and CLIENT SECRET under GITHUB_SECRET
Optional: Enable prisma optimize
To enable Prisma Optimize and get insights on queires you can add this in you .env
Running Unsend locally
We are using a local Postgresql server and a local Redis server. But if you don’t have docker you can also manually set these up.
Option 1: Using Docker Recommended
Start the dashboard
Dashboard and Landing page will start running
Dashboard will be started on
Landing page will be started on
Once you login with Github you will be prompted with SES settings. You will need to run cloudflare tunnel to add the callback URL
Run the following command to get the URL. Here is the more detailed guide by cloudflare
You can paste the URL provided by cloudflare in the Callback URL section
Option 2: Using your own database or hosted database
Set up your PostgreSQL and Redis database in Environment Variables
Migrate the database
Start the development server
Once you login with Github you will be prompted with SES settings. You will need to run cloudflare tunnel to add the callback URL
Run the following command to get the URL. Here is the more detailed guide by cloudflare
You can paste the URL provided by cloudflare in the Callback URL section
Run documentation
To run the documentation run the following command: