CoinXcel is a Spring Boot-based cryptocurrency trading platform with a MySQL backend. It provides a secure API for cryptocurrency data management and user authentication.
- User authentication with JWT token
- Two-factor authentication support
- RESTful API for crypto data management
- Docker containerization for easy deployment
- CI/CD pipeline using Jenkins
- Java 17
- Spring Boot 3.4.0
- Spring Security
- Spring Data JPA
- MySQL 8.0
- Docker & Docker Compose
- Jenkins
- Ansible
The project follows standard Spring Boot application structure:
Model: Entity classes for database mappingRepository: Data access layerService: Business logicController: REST endpointsConfig: Application configuration including security
- Java 17
- Maven
- Docker and Docker Compose
- MySQL 8.0 (or use the provided Docker container)
-
Clone the repository:
git clone https://github.com/munsif-dev/CoinXcel.git cd CoinXcel -
Build the application:
./mvnw clean package
-
Run with Docker Compose:
docker-compose up -d
-
Access the application at http://localhost:8080
The application uses the following environment variables:
SPRING_DATASOURCE_URL: JDBC URL for MySQL connectionSPRING_DATASOURCE_USERNAME: MySQL usernameSPRING_DATASOURCE_PASSWORD: MySQL password
GET /: Home pagePOST /auth/login: User loginPOST /auth/register: User registration
GET /api: Secure API endpoint (requires authentication)
The project uses Jenkins for continuous integration and deployment:
- Checkout: Retrieves the source code from the repository
- Build: Compiles and packages the application with Maven
- Set Up MySQL: Starts a MySQL container for testing
- Build and Push Docker Image: Creates and pushes the Docker image to Docker Hub
- Deploy to EC2: Deploys the application to an EC2 instance using Ansible
- Tear Down MySQL: Removes the MySQL container used for testing
The deployment to EC2 uses Ansible to:
- Install Docker and Docker Compose on the EC2 instance
- Set up the application directory
- Copy necessary configuration files
- Pull the latest Docker images
- Start the application using Docker Compose
- JWT-based authentication
- Password security with encryption
- CORS configuration for API access
- Two-factor authentication support
- Run
./mvnw spring-boot:runfor local development without Docker - Access H2 console at
/h2-consolefor development database inspection (when using H2) - Use
docker-compose -f docker-compose.yml -f docker-compose.dev.yml upfor development-specific settings
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a pull request
This project is licensed under the MIT License.