initial commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.mindflux;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
public class HelloController {
|
||||
|
||||
@GetMapping("/")
|
||||
public Map<String, String> hello() {
|
||||
return Map.of(
|
||||
"app", "mindflux",
|
||||
"status", "running",
|
||||
"message", "Hello from Spring Boot 🚀"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.mindflux;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class MindfluxApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MindfluxApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
server.port=8080
|
||||
|
||||
spring.datasource.url=jdbc:postgresql://postgres:5432/mindfluxdb
|
||||
spring.datasource.username=mindflux
|
||||
spring.datasource.password=mindflux_pass
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=validate
|
||||
spring.jpa.show-sql=true
|
||||
@@ -0,0 +1,20 @@
|
||||
CREATE TABLE users (
|
||||
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
username VARCHAR(100) NOT NULL UNIQUE,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255),
|
||||
role VARCHAR(50) NOT NULL,
|
||||
profile_picture VARCHAR(255)
|
||||
);
|
||||
|
||||
CREATE TABLE achievements (
|
||||
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
username VARCHAR(100),
|
||||
title VARCHAR(255),
|
||||
description TEXT,
|
||||
icon VARCHAR(255),
|
||||
date_achieved TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX idx_achievements_username
|
||||
ON achievements (username);
|
||||
Reference in New Issue
Block a user