Welcome to MailFusion! This repository houses both the frontend and backend components of our application, designed to help you create, manage, and elevate beautiful email templates with ease.
Check out the live version of the app here.
MailFusion is a comprehensive email template generation platform. The backend is built with Flask and handles user authentication, template generation, and data management. The frontend, built with React, provides an intuitive user interface for interacting with the backend services.
app.py
, handling user login, signup, and template management.models.py
with SQLAlchemy.TemplateForm
, TemplateList
).useState
, useEffect
).Clone the repository:
git clone https://github.com/yourusername/MailFusion-Create-Edit-and-Elevate-Email-Templates.git
cd MailFusion-Create-Edit-and-Elevate-Email-Templates/backend
Set up a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
Install dependencies:
pip install -r requirements.txt
Set up environment variables:
Create a .env
file in the root directory with the following variables:
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=your_secret_key
JWT_SECRET_KEY=your_jwt_secret_key
SQLALCHEMY_DATABASE_URI=sqlite:///db.sqlite3 # Or your preferred database
GEMINI_API_KEY=your_gemini_api_key
UNSPLASH_API_KEY=your_unsplash_api_key
Clone the repository:
git clone https://github.com/yourusername/MailFusion-Create-Edit-and-Elevate-Email-Templates.git
cd MailFusion-Create-Edit-and-Elevate-Email-Templates/frontend
Install dependencies:
Make sure you have Node.js installed. Then, run:
npm install
Run the development server:
npm start
This will start the app on http://localhost:3000
.
app.py
: The main application file containing the routes and application setup.src/
: Contains all the React components, pages, and styles.
components/
: Reusable UI components.pages/
: Different pages of the application (e.g., Home, Login, Dashboard).CSS/
: Global styles and theme settings.public/
: Static files like index.html
and images.build/
: The production-ready version of the app.flask run
: Starts the Flask application.npm start
: Starts the React app in development mode.npm run build
: Builds the app for production.npm test
: Runs the test suite./login
: POST - Authenticates a user and returns a JWT token./signup
: POST - Registers a new user./query
: POST - Handles email template generation requests./save-template
: POST - Saves a generated email template./templates
: GET - Retrieves saved templates.Ensure the following environment variables are set:
FLASK_APP
FLASK_ENV
SECRET_KEY
JWT_SECRET_KEY
SQLALCHEMY_DATABASE_URI
GEMINI_API_KEY
UNSPLASH_API_KEY
REACT_APP_BACKEND_URL
: The URL of the backend API.flask run
to start the backend server.npm start
to start the React app.