https://github.com/mohamedmetwalli5/email-service
đź“§ Seamail: is a secure, user-friendly email service providing seamless management with features like email prioritization and filtering tools.
https://github.com/mohamedmetwalli5/email-service
mysql reactjs spring-boot spring-security
Last synced: 14 days ago
JSON representation
đź“§ Seamail: is a secure, user-friendly email service providing seamless management with features like email prioritization and filtering tools.
- Host: GitHub
- URL: https://github.com/mohamedmetwalli5/email-service
- Owner: MohamedMetwalli5
- License: gpl-3.0
- Created: 2020-12-28T01:43:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-06T17:09:31.000Z (10 months ago)
- Last Synced: 2025-02-06T17:28:09.313Z (10 months ago)
- Topics: mysql, reactjs, spring-boot, spring-security
- Language: Java
- Homepage:
- Size: 1.05 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README




# Seamail: An Email Service
Seamail is an email service designed to enhance user interactions with their email system. It provides secure, efficient, and user-friendly functionalities for managing emails through an intuitive interface.
# Features
- **User Registration & Sign-in:** Secure registration and login process for users.
- **OAuth2 Authentication:** Allow users to optionally sign in effortlessly with their Discord account.
- **JWT Authentication:** Ensures secure access to the platform with token-based authentication.
- **Multi-language Support:** Enhances accessibility by offering the platform in multiple languages.
- **Email Management:** View and manage inbox, outbox, and trashbox for efficient email organization.
- **Email Actions:** Send, move to trash, and delete emails with ease.
- **Email Sorting & Filtering:** Sort emails by priority or date, and filter them by subject or sender.
- **Account Management:** Allows users to permanently delete their accounts if desired and change their default profile picture.
- **Password Management:** Option to securely change user passwords to maintain account security.
# Setup Instructions
If you want to replicate the project on your local environment, follow these steps:
## Database Setup
Run the `Tables.sql` script in the "SQL Scripts" folder to set up your database tables.
## Backend Setup
1. Navigate to the Backend Directory
```cd backendemailservice```
2. Navigate to `src\main`, create a `resources` folder, and create and configure the `application.properties` file inside it. Fill the file with the following properties that suit your setup:
Note: Some values can be obtained from the Discord Developer Portal based on your application’s configuration and API keys.
```
# Database Configuration
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=your_database_URL (e.g. jdbc:mysql://localhost:3306/seamail?sessionVariables=sql_mode='NO_ENGINE_SUBSTITUTION'&jdbcCompliantTruncation=false)
spring.datasource.username=your_database_username (e.g. root)
spring.datasource.password=your_database_password (e.g. 1234)
# CORS Configuration
cors.allowed.origin=your_frontend_url (e.g. http://localhost:8080)
server.port=your_backend_port_number (e.g. 8081)
# JPA Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
# spring.jpa.properties.hibernate.formate_sql=true
# Security Configuration
jwt.secret=your_jwt_secret_key (e.g. TheSecretKeyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)
# Discord OAuth2 Configuration
discord.client.id=your_discord_client_id
discord.client.secret=your_discord_client_secret
discord.token.url=https://discord.com/api/oauth2/token
discord.api.url=https://discord.com/api
# Other Application Configurations
# Add other specific configurations here as necessary
```
3. Navigate to `src\test`, create a `resources` folder, and create and configure the `application-test.properties` file inside it. Fill the file with the following properties that suit your setup:
```
# Connecting to H2 Database
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username=sa
spring.datasource.password=
# CORS Configuration
cors.allowed.origin=your_frontend_url (e.g. http://localhost:8080)
server.port=your_backend_port_number (e.g. 8081)
# Configuring JPA for H2
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
# Security Values
jwt.secret=your_jwt_secret_key (e.g. TheSecretKeyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)
```
4. Clean and Install dependencies
```mvn clean install```
5. Navigate to the `target` folder using ```cd target```
6. Run the JAR file ```java -jar backendemailservice-0.0.1-SNAPSHOT.jar```
7. The backend will start on http://localhost:8081
## Frontend Setup
1. Navigate to the Frontend Directory
``` cd frontend-email-service ```
2. Install Dependencies
``` npm install ```
3. Configure Environment Variables,
Create a ```.env``` file in the frontend directory with the following content:
Note: Some values can be obtained from the Discord Developer Portal based on your application’s configuration and API keys.
```
VITE_BACKEND_API_URL=your_frontend_url (e.g. http://localhost:8081)
VITE_CLIENT_ID=your_discord_client_id
```
4. Start the Frontend
``` npm run dev ```
5. The frontend will start on http://localhost:8080
# Testing
Seamail includes comprehensive unit tests to ensure reliability and functionality. These tests are built using JUnit and Mockito.
## Test Structure
- **Service Tests**: Tests for the business logic in the service layer.
- `UserServiceTest`: Validates user creation, finding users, and checking non-existent users.
- `EmailServiceTest`: Verifies email creation, loading inbox/outbox/trashbox, filtering, sorting, and moving emails to trash.
- **Controller Tests**: Tests for the API layers.
- `AccessControllerTest`: Tests for user authentication endpoints like sign-in and sign-up.
- `EmailsControllerTest`: Tests for email endpoints like sending, deleting, and moving emails to trash.
# Screenshot

# Logo Idea
The Seamail logo combines an envelope with dynamic wave patterns, symbolizing seamless communication. It reflects the efficient, modern, and user-friendly email service.
