Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewriting the backend to use tapir/http4s/doobie
- Loading branch information
Showing
135 changed files
with
2,443 additions
and
3,056 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,4 @@ | |
target/ | ||
*.log | ||
.DS_Store | ||
application.conf | ||
data/ | ||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,2 @@ | ||
style = defaultWithAlign | ||
maxColumn = 120 | ||
align.openParenCallSite = false | ||
align.openParenDefnSite = false | ||
danglingParentheses = true | ||
|
||
rewrite.rules = [RedundantBraces, RedundantParens, SortImports, PreferCurlyFors] | ||
rewrite.redundantBraces.includeUnitMethods = true | ||
rewrite.redundantBraces.stringInterpolation = true | ||
version = 2.0.0-RC8 | ||
maxColumn = 140 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
api { | ||
host = "localhost" | ||
host = ${?API_HOST} | ||
|
||
port = 8080 | ||
port = ${?API_PORT} | ||
} | ||
|
||
db { | ||
username = "postgres" | ||
username = ${?SQL_USERNAME} | ||
|
||
password = "" | ||
password = ${?SQL_PASSWORD} | ||
|
||
name = "bootzooka" | ||
name = ${?SQL_DBNAME} | ||
host = "localhost" | ||
host = ${?SQL_HOST} | ||
port = 25432 | ||
port = ${?SQL_PORT} | ||
|
||
url = "jdbc:postgresql://"${db.host}":"${db.port}"/"${db.name} | ||
|
||
migrate-on-start = true | ||
migrate-on-start = ${?MIGRATE_ON_START} | ||
|
||
driver = "org.postgresql.Driver" | ||
|
||
connect-thread-pool-size = 32 | ||
} | ||
|
||
email { | ||
enabled = false | ||
enabled = ${?EMAIL_ENABLED} | ||
|
||
smtp { | ||
host = "" | ||
host = ${?EMAIL_HOST} | ||
|
||
port = 25 | ||
port = ${?EMAIL_PORT} | ||
|
||
username = "" | ||
username = ${?EMAIL_USERNAME} | ||
|
||
password = "" | ||
password = ${?EMAIL_PASSWORD} | ||
|
||
ssl-connection = false | ||
ssl-connection = ${?EMAIL_SSL_CONNECTION} | ||
|
||
verify-ssl-certificate = true | ||
verify-ssl-certificate = ${?EMAIL_VERIFY_SSL_CERTIFICATE} | ||
} | ||
|
||
encoding = "UTF-8" | ||
encoding = ${?EMAIL_ENCODING} | ||
|
||
from = "info@bootzooka.com" | ||
from = ${?EMAIL_FROM} | ||
|
||
batch-size = 10 | ||
batch-size = ${?EMAIL_BATCH_SIZE} | ||
|
||
email-send-interval = 1 second | ||
email-send-interval = ${?EMAIL_SEND_INTERVAL} | ||
} | ||
|
||
password-reset { | ||
reset-link-pattern = "http://localhost:8080/#/password-reset?code=%s" | ||
code-valid-hours = 24 | ||
} | ||
|
||
bootzooka { | ||
default-api-key-valid-hours = 24 | ||
} |
72 changes: 44 additions & 28 deletions
72
backend/src/main/resources/db/migration/V1__create_schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,51 @@ | ||
-- USERS | ||
CREATE TABLE "users"( | ||
"id" UUID NOT NULL, | ||
"login" VARCHAR NOT NULL, | ||
"login_lowercase" VARCHAR NOT NULL, | ||
"email" VARCHAR NOT NULL NOT NULL, | ||
"password" VARCHAR NOT NULL NOT NULL, | ||
"salt" VARCHAR NOT NULL NOT NULL, | ||
"created_on" TIMESTAMP NOT NULL | ||
CREATE TABLE "users" | ||
( | ||
"id" TEXT NOT NULL, | ||
"login" TEXT NOT NULL, | ||
"login_lowercase" TEXT NOT NULL, | ||
"email_lowercase" TEXT NOT NULL, | ||
"password" TEXT NOT NULL, | ||
"created_on" TIMESTAMPTZ NOT NULL | ||
); | ||
ALTER TABLE "users" ADD CONSTRAINT "users_id" PRIMARY KEY("id"); | ||
ALTER TABLE "users" | ||
ADD CONSTRAINT "users_id" PRIMARY KEY ("id"); | ||
CREATE UNIQUE INDEX "users_login_lowercase" ON "users" ("login_lowercase"); | ||
CREATE UNIQUE INDEX "users_email_lowercase" ON "users" ("email_lowercase"); | ||
|
||
-- API KEYS | ||
CREATE TABLE "api_keys" | ||
( | ||
"id" TEXT NOT NULL, | ||
"user_id" TEXT NOT NULL, | ||
"created_on" TIMESTAMPTZ NOT NULL, | ||
"valid_until" TIMESTAMPTZ NOT NULL | ||
); | ||
ALTER TABLE "api_keys" | ||
ADD CONSTRAINT "api_keys_id" PRIMARY KEY ("id"); | ||
ALTER TABLE "api_keys" | ||
ADD CONSTRAINT "api_keys_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- PASSWORD RESET CODES | ||
CREATE TABLE "password_reset_codes"( | ||
"id" UUID NOT NULL, | ||
"code" VARCHAR NOT NULL, | ||
"user_id" UUID NOT NULL, | ||
"valid_to" TIMESTAMP NOT NULL | ||
CREATE TABLE "password_reset_codes" | ||
( | ||
"id" TEXT NOT NULL, | ||
"user_id" TEXT NOT NULL, | ||
"valid_until" TIMESTAMPTZ NOT NULL | ||
); | ||
ALTER TABLE "password_reset_codes" ADD CONSTRAINT "password_reset_codes_id" PRIMARY KEY("id"); | ||
ALTER TABLE "password_reset_codes" ADD CONSTRAINT "password_reset_codes_user_fk" | ||
FOREIGN KEY("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
ALTER TABLE "password_reset_codes" | ||
ADD CONSTRAINT "password_reset_codes_id" PRIMARY KEY ("id"); | ||
ALTER TABLE "password_reset_codes" | ||
ADD CONSTRAINT "password_reset_codes_user_fk" | ||
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- REMEMBER ME TOKENS | ||
CREATE TABLE "remember_me_tokens"( | ||
"id" UUID NOT NULL, | ||
"selector" VARCHAR NOT NULL, | ||
"token_hash" VARCHAR NOT NULL, | ||
"user_id" UUID NOT NULL, | ||
"valid_to" TIMESTAMP NOT NULL | ||
-- EMAILS | ||
CREATE TABLE "scheduled_emails" | ||
( | ||
"id" TEXT NOT NULL, | ||
"recipient" TEXT NOT NULL, | ||
"subject" TEXT NOT NULL, | ||
"content" TEXT NOT NULL | ||
); | ||
ALTER TABLE "remember_me_tokens" ADD CONSTRAINT "remember_me_tokens_id" PRIMARY KEY("id"); | ||
ALTER TABLE "remember_me_tokens" ADD CONSTRAINT "remember_me_tokens_user_fk" | ||
FOREIGN KEY("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
CREATE UNIQUE INDEX "remember_me_tokens_selector" ON "remember_me_tokens"("selector"); | ||
ALTER TABLE "scheduled_emails" | ||
ADD CONSTRAINT "scheduled_emails_id" PRIMARY KEY ("id"); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
-- | ||
Regards, | ||
SoftwareMill Bootzooka Dev Team | ||
http://SoftwareMill.com | ||
http://softwaremill.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
SoftwareMill Bootzooka password reset | ||
|
||
Dear {{userName}}, | ||
|
||
To be able to set a new password, please visit the link below: | ||
|
||
{{resetLink}} | ||
{{resetLink}} |
Oops, something went wrong.