GithubHelp home page GithubHelp logo

keil0 / easy-email Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m-ryan/easy-email

0.0 0.0 0.0 13.42 MB

Easy email is developed based on the MJML and has very good compatibility. At the same time, it can generate code through drag-and-drop editing.

License: MIT License

JavaScript 1.24% TypeScript 85.33% CSS 1.90% HTML 8.72% SCSS 2.38% Dockerfile 0.13% Edge 0.29%

easy-email's Introduction

Innocean - Postcard

Stack

Requirements

Setup local dev environment

  1. Clone the repository
  2. Copy the .env.example file to .env
  3. Copy the backend/.env.example file to backend/.env and update the values
  4. Install all dependencies
cd <project_root>
npm run install-all
cd backend
npm i
  1. Start the development server
cd <project_root>
cd docker
docker compose -f docker-compose.localhost.yml up
  1. Create the database by running the following command
cd <project_root>
cd backend
node ace migration:run
  1. Add one user into the database by running the following command
docker exec -it easy_email_mysql mysql -u easy_email -peasy_email easy_email_users
INSERT INTO users (email, full_name) VALUES ('[email protected]', 'John Doe');
  1. Copy the default images to the public folder
cd <project_root>
cp -r backend/uploads backend/public

Run the project locally (frontend and backend)

  1. Start frontend & backend in two terminals
# In first terminal
cd <project_root>
npm run dev
# In second terminal
cd <project_root>
cd backend
npm run dev
  1. Go to http://localhost:3333
  2. Put the email you added in the database
  3. Go to your email and click on the magic link (if you are using mailtrap, you can see the email in the mailtrap.io inbox)
  4. You can now go to http://localhost:3000 and see the postcard app

Install prod environment

Prerequisites

  • VPS server
  • Domain linked to it
  • Docker
  • Docker Compose
  • Github CLI
  • A database server (MySQL, Postgres, etc.) with a database created and user with access to it

Create environment

  1. Create a folder for the project "postcard"
  2. Copy content of docker-compose.prd.yml into docker-compose.yml
  3. Create .env file base from .env.example
  4. Generate a Personal Access Token (PAT) from Github
  5. Login to Github packages
    echo "[PAT_TOKEN_HERE]" | docker login ghcr.io -u USERNAME --password-stdin
  6. Create uploads folder to store images mkdir uploads
  7. Run the docker-compose
    docker-compose up -d
  8. Run migration
    docker exec -it postcard-auth node ace migration:run

Database manual operations

Connect to the database

docker run --rm -it mysql bash
mysql -h 51.159.113.67 --port 10792 -p -u innocean postcard

List all users

SELECT * FROM users;

Insert a new user

INSERT INTO users (full_name, email, created_at) VALUES ('John', '[email protected]', NOW());

Delete a user

DELETE FROM users WHERE email = '[email protected]';

Configure CI/CD & deploy automation

Define the following secrets in the repository settings:

  • GHCR_TOKEN: Github Personal Access Token to access Github packages And the following environment variables for staging / production in the repository settings:
  • VITE_API_BASE_URL: Backend base URL (e.g. https://postcard.innocean.app/auth)

Setup autopull

  1. SSH into the VPS
  2. Create folder to store the config
mkdir -p ~/watchtower
cd ~/watchtower
  1. Create a .env file with the following content
REPO_USER=INNOCEAN-FRANCE
REPO_PASS=[PAT_TOKEN_HERE]
WATCHTOWER_INCLUDE_RESTARTING=true
  1. Run this following command
docker run -d --name watchtower-registr --env-file ~/watchtower/.env -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --interval 30 --cleanup

Now each time a new image is available, watchtower will pull it and restart the containers

easy-email's People

Contributors

m-ryan avatar keil0 avatar wilau2 avatar sambegin avatar renyuanz avatar realmail-editor avatar fabien-roy avatar mikicho avatar dominastorm avatar alexandrdobrovolskiy avatar alexbevilacqua avatar browniefed avatar vskoryk avatar willopez avatar caffeei avatar carlescamig avatar danielyeh-meepshop avatar sarathjasrin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.