Created base BE. Auth + /current endpoint

This commit is contained in:
AddictionGames
2026-01-03 15:34:33 +02:00
parent bff056e094
commit 27a261eb44
30 changed files with 1998 additions and 22 deletions

View File

@@ -0,0 +1,68 @@
server:
port: 8080
spring:
application:
name: honey-be
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:mysql://localhost:3306/honey_db}
username: ${SPRING_DATASOURCE_USERNAME:root}
password: ${SPRING_DATASOURCE_PASSWORD:password}
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
connection-timeout: 30000
initialization-fail-timeout: -1
jpa:
hibernate:
ddl-auto: validate
show-sql: false
properties:
hibernate:
format_sql: false
dialect: org.hibernate.dialect.MySQLDialect
flyway:
enabled: true
locations: classpath:db/migration
baseline-on-migrate: true
connect-retries: 20
connect-retry-interval: 3000
validate-on-migrate: false
repair: true
telegram:
bot-token: ${TELEGRAM_BOT_TOKEN}
logging:
level:
root: INFO
org.springframework.boot.context.config: DEBUG
org.springframework.core.env: DEBUG
com.honey: DEBUG
management:
endpoints:
web:
exposure:
include: health,info
base-path: /actuator
endpoint:
health:
show-details: when-authorized
probes:
enabled: true
group:
readiness:
include: db,ping
liveness:
include: ping
health:
db:
enabled: true
diskspace:
enabled: false
ping:
enabled: true

View File

@@ -0,0 +1,9 @@
-- Create users table
CREATE TABLE IF NOT EXISTS users (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
telegram_id BIGINT NOT NULL UNIQUE,
username VARCHAR(255),
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
INDEX idx_telegram_id (telegram_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;