Skip to content

luciengeorge/localista

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

982 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Localista

About Remix

📖 See the Remix docs and the Remix Vite docs for details on supported features.

Development

Clone the repository

gh repo clone localista/localista

Create a .env file

touch .env

To add the necessary environment variables, ask a team member to add you to the infisical project.

Create a .npmrc file

Ask a team member for the contents of the .npmrc file.

Install dependencies

npm install

Install Email Engine

Download Email Engine by following this link Once installed, you can run the following command to start the Email Engine server:

npm run emailengine # or emailengine --dbs.redis="redis://127.0.0.1:6379/0" --api.port=3001

If you are prompted to enter a username and a password, you should be able to login with the following credentials:

username: admin
password: password

Otherwise you can follow the instructions on this link to set up the credentials

Email Engine offers a 14 day free trial. If your trial expires in development just flush your redis database to reset the trial.

redis-cli flushall

To receive webhooks from Email Engine, in the left navigation bar, click on Webhook Routing > Create new:

  • Give any name to the webhook
  • You can leave the description blank
  • the target URL should be http://localhost:3001/webhooks/email
  • Check the box Enable this Webhook Routing
  • In the filter function, copy/paste the following
/*
// The following example passes webhooks for new emails that appear in the Inbox of the user "testaccount".
// NB! Gmail webhooks are always emitted from the "All Mail" folder, not the Inbox, so we need to check both the path and label values.

const isInbox = payload.path === 'INBOX' || payload.data?.labels?.includes('\\Inbox');
if (payload.event === 'messageNew' && payload.account === 'testaccount' && isInbox) {
    return true;
}
*/

const isInbox =
  payload.path === 'INBOX' || payload.data?.labels?.includes('\\Inbox')
if (
  (payload.event === 'messageNew' && isInbox) ||
  payload.event === 'messageUpdated' ||
  payload.event === 'trackOpen' ||
  payload.event === 'trackClick'
) {
  return true
}
  • in the map function copy/paste the following
// By default the output payload is returned unmodified.

return payload

Under Configuration > Webhooks make sure the following checkboxes are checked:

webhook config

Under Configuration > OAuth2, click on Create new > Gmail: Fill out the form as you please and then ask a team mate for the configuration file for the OAuth2 credentials

Start the server

npm run dev

Explore the database

You can either use prisma studio for a better UX/UI

npx prisma studio

Or you can run this command in the terminal

npm run c

Get latest code from main

To get the latest code, ideally you would rebase your branch from main instead of merging main into your branch. This will keep your branch history clean and easy to understand.

git status # clean status
git checkout main
git pull origin main
git checkout <your-branch>
git rebase main <your-branch>

In case of conflicts, you will need to resolve them manually. Once resolved, you can continue the rebase process.

# resolve conflicts
git add .
git commit --no-edit
git rebase --continue

Loging in

The seed file creates one client and one user. Look at the seed file to find the credentials. Otherwise make sure to sign up and confirm your email. You will receive the content of the confirmation email (along with the verification code) in the server logs.

Background jobs

Background jobs are run on trigger.dev. Ask a team member to give you access to the trigger workspace

Deployment

The app is automatically deployed when a branch is merged to main. Make sure to create a pull request and don't merge directly to main ⚠️

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages