An e-commerce backend application using Spring Boot, leveraging AWS S3 for media storage, Giaohangtietkiem for delivery services, and integrating Momo wallet for seamless payment processing.
- Java 17
- Spring Boot 3.1.0
- Spring Security
- Spring JPA
- MongoDB
- OAuth
- Any IDE of your choice
- Docker
- Clone the latest code:
git clone https://github.com/mochacr0/mongodb-shop-backend.git
- Open your preferred IDE and provide your own application.yml file, including application properties, secrets, and API keys:
spring:
data:
mongodb:
uri: <YOUR MONGODB CONNECTION STRING>
auto-index-creation: true
cloud:
aws:
credentials:
access-key: <YOUR AWS ACCESS KEY>
secret-key: <YOUR AWS SECRET KEY>
region:
static: <YOUR PREFERRED DATA STORAGE REGION>
server:
port: 5000
servlet:
encoding:
charset: UTF-8
force: true
jwt:
settings:
accessTokenExpiryTimeSeconds: 1800
refreshTokenExpiryTimeSeconds: 2592000
tokenSigningKeyString: <YOUR 256-BIT JWT TOKEN SIGNING KEY>
tokenIssuer: localhost #Token issuer
logging:
level:
org:
springframework:
security: TRACE
data:
mongodb:
core:
MongoTemplate: DEBUG
security:
oauth2:
googleClientId: <YOUR GOOGLE CLIENT ID>
googleClientSecret: <YOUR GOOGLE CLIENT SECRET>
passwordPolicy:
isWhitespacesAllowed: false
repeatedPasswordAllowed: false
minimumLength: 6
minimumLowerCharacters: 0
minimumUpperCharacters: 1
minimumSpecialCharacters: 0
passwordReuseFrequencyDays: 0
maxFailedLoginAttempts: 3
failedLoginLockExpirationMillis: 5000 # 5 second
activationTokenExpirationMillis: 300000 # 5 minutes
passwordResetTokenExpirationMillis: 300000 # 5 minutes
failedLoginIntervalMillis: 10000 # 10 seconds
mailing:
host: "smtp.gmail.com"
port: 587
username: <YOUR ADMIN GMAIL>
password: <YOUR ADMIN GMAIL APP PASSWORD>
timeout: 10000
payment:
momo:
partnerCode: <YOUR MOMO PARTNER CODE>
accessKey: <YOUR MOMO ACCESS KEY>
secretKey: <YOUR MOMO SECRET KEY>
shipping:
ghtk:
apiToken: <YOUR GIAOHANGTIETKIEM TOKEN API>
- Navigate to the project's main directory and run the following command to start the container:
docker compose up -d
-
Once the container is running, access the Swagger documentation page at: http://localhost:5000/swagger-ui.html
-
Use the following accounts to access authorized endpoints:
User Admin Username user00
admin
Password String
String
-
Stop and remove the container by using:
docker compose down
Swagger Documentation Page
User-related APIs
Response example