Skip to content

Commit

Permalink
add configuration files; add in-memory database for dev and test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikhofer committed Mar 15, 2019
1 parent 15b6fbd commit 2fe137a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
/dist/
/nbdist/
/.nb-gradle/

src/main/resources/application-dev.properties
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Code FREAK

Code Feedback Review & Evaluation Kit | Educational Online IDE

## Development environment setup

1) Set up a database (optional). Currently, drivers for PostgreSQL are included. You can also use the embedded in-memory database.
2) Create a file `src/main/resources/application-dev.properties`. For documentation on how to configure the
server see [application.properties](https://github.com/code-freak/code-freak/blob/master/src/main/resources/application.properties)
in the same directory. Minimum configuration that uses the in-memory database:
```
spring.jpa.database=HSQL
spring.jpa.hibernate.ddl-auto=create
```
3) Run the command `./gradlew bootRun`. The application is started at http://localhost:8080.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'org.hsqldb:hsqldb'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}
Expand Down
27 changes: 27 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
##########################################################################################
## These environment-specific properties should be placed in application-dev.properties ##
## and application-prod.properties respectively: ##
##########################################################################################

# Database configuration, e.g.
#
# spring.datasource.url=jdbc:postgresql://localhost:5432/code-freak
# spring.datasource.username=postgres
# spring.datasource.password=postgres
# spring.datasource.driver-class-name=org.postgresql.Driver
# spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
#
# or in-memory (DO NOT USE IN PRODUCTION)
#
# spring.jpa.database=HSQL

# Dev-only
# spring.jpa.show-sql=true
# spring.jpa.hibernate.ddl-auto=create
# logging.level.root=DEBUG

##########################################################################################

spring.profiles.active=dev

# Hides HHH000424: Disabling contextual LOB creation as createClob() method threw error
logging.level.org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl = WARN
4 changes: 4 additions & 0 deletions src/test/resources/application-test.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
spring.jpa.database=HSQL
spring.jpa.show-sql=false

spring.jpa.hibernate.ddl-auto=create

0 comments on commit 2fe137a

Please sign in to comment.