smartMail is an AI-powered email reply generator that helps users quickly generate replies to their emails using a Spring Boot backend and a React frontend. The backend API utilizes AI models to craft the replies, while the frontend provides a user-friendly interface.
This project consists of two main parts:
- Backend (Spring Boot): The server-side application that handles the API requests for email reply generation.
- Frontend (React): The client-side application that interacts with the user and communicates with the backend API.
Ensure you have the following installed on your machine:
- Java (for Spring Boot backend)
- Node.js and npm (for React frontend)
- Maven (for Spring Boot)
The backend is built using Spring Boot and exposes a REST API that accepts POST requests.
-
URL:
http://localhost:8080/api/email/generate -
Method: POST
-
Request Body:
{ "emailContent": "Hi, would you like ...", "tone": "friendly" (optional) } -
Response:
{ "reply": "Thank you for your email. I will get back to you shortly..." }
-
Navigate to the backend directory:
cd backend -
Build and run the Spring Boot application:
./mvnw spring-boot:run
-
The backend will be running on http://localhost:8080.
The frontend is built using React and runs on the default Vite development server.
-
Navigate to the frontend directory:
cd frontend -
Install the required dependencies:
npm install
-
Start the development server:
npm run dev
-
The frontend will be accessible at http://localhost:5173/.
- The frontend sends a POST request to the backend API with the email content as input.
- The backend processes the input, generates a reply using AI models, and returns the response.
- The frontend displays the generated reply to the user.
- Enter an email content in the frontend interface.
- The frontend sends the input to the backend API.
- The backend returns a generated reply, and the frontend displays it.
- Make sure both the frontend and backend servers are running at the same time for the system to function properly.
- The backend server listens on port
8080and the frontend on port5173(Vite default).
This project is licensed under the MIT License - see the LICENSE file for details.