Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ Dashboard

---

## Legal Notice
## License

This project was generated using [Selleo Boilerplate](https://github.com/Selleo/boilerplate) which is licensed under the MIT license.
See `LICENSE`.

## About Selleo

![selleo](https://raw.githubusercontent.com/Selleo/selleo-resources/master/public/github_footer.png)

Software development teams with an entrepreneurial sense of ownership at their core delivering great digital products and building culture people want to belong to. We are a community of engaged co-workers passionate about crafting impactful web solutions which transform the way our clients do business.

All names and logos for [Selleo](https://selleo.com/about) are trademark of Selleo Labs Sp. z o.o. (formerly Selleo Sp. z o.o. Sp.k.)
21 changes: 12 additions & 9 deletions apps/api/.env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# GENERAL
NODE_ENV=development
LOG_LEVEL=debug
CORS_ORIGIN="https://app.boilerplate.localhost"
EMAIL_ADAPTER="mailhog"
CORS_ORIGIN=https://app.boilerplate.localhost
COOKIE_DOMAIN=boilerplate.localhost
EMAIL_ADAPTER=mailhog

# DATABASE
DATABASE_URL="postgres://postgres:boilerplate@localhost:5432/boilerplate"
DATABASE_TEST_URL="postgres://postgres:boilerplate@localhost:5432/boilerplate_test"
REDIS_URL="redis://localhost:6379"
DATABASE_URL=postgres://postgres:boilerplate@localhost:5432/boilerplate
DATABASE_TEST_URL=postgres://postgres:boilerplate@localhost:5432/boilerplate_test
REDIS_URL=redis://localhost:6379
BULLBOARD_PASSWORD=admin123

# MAILS
Expand All @@ -18,16 +19,18 @@ SMTP_PASSWORD=

# AWS
AWS_REGION=eu-central-1
AWS_ACCESS_KEY_ID=AKIAV2CD6JAAAAAAAA
AWS_SECRET_ACCESS_KEY=SECREETTTTTTTTTTTTTTTTTTT
AWS_ACCESS_KEY_ID=rustfsadmin
AWS_SECRET_ACCESS_KEY=rustfsadmin
S3_ENDPOINT=http://127.0.0.1:9000
S3_FORCE_PATH_STYLE=true

FILE_STORAGE_ADAPTER=s3
AWS_BUCKET_NAME=2m3d-boilerplate-prod
AWS_BUCKET_NAME=boilerplate-prod


# AUTH

BETTER_AUTH_SECRET="secret999"
BETTER_AUTH_SECRET=secret99secret99secret99secret99secret99
BETTER_AUTH_URL=http://localhost:3000

GOOGLE_CLIENT_ID=1111111111111-example.apps.googleusercontent.com
Expand Down
3 changes: 2 additions & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
"@nestjs/terminus": "^11.0.0",
"@repo/email-templates": "workspace:*",
"@sinclair/typebox": "^0.34.41",
"@thallesp/nestjs-better-auth": "^2.4.0",
"add": "^2.0.6",
"bcrypt": "^6.0.0",
"better-auth": "1.4.5",
"better-auth": "1.4.19",
"bullmq": "^5.66.0",
"cookie": "^1.1.1",
"cookie-parser": "^1.4.7",
Expand Down
21 changes: 5 additions & 16 deletions apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ import { JwtModule, JwtModuleOptions } from "@nestjs/jwt";
import emailConfig from "./common/configuration/email";
import awsConfig from "./common/configuration/aws";
import fileStorageConfig from "./common/configuration/file-storage";
import { APP_GUARD } from "@nestjs/core";
import { EmailModule } from "./common/emails/emails.module";
import { FileStorageModule } from "./file-storage";
import { TestConfigModule } from "./test-config/test-config.module";
import { StagingGuard } from "./common/guards/staging.guard";
import { HealthModule } from "./health/health.module";
import { BetterAuthModule, AuthGuard } from "./auth";
import { AuthModule } from "./auth/auth.module";
import { AuthService } from "./auth/auth.service";
import { buildBetterAuthInstance } from "./lib/better-auth-options";
import { LoggerMiddleware } from "./logger/logger.middleware";
import { QueueModule } from "./queue/queue.module";
import { AuthModule as BetterModule } from "@thallesp/nestjs-better-auth";

import type { DatabasePg } from "./common";

Expand Down Expand Up @@ -49,18 +47,18 @@ import type { DatabasePg } from "./common";
return {
secret: configService.get<string>("jwt.secret")!,
signOptions: {
expiresIn: configService.get<number>("jwt.expirationTime"),
expiresIn: configService.get<number>("jwt.expirationTime"),
},
};
},
inject: [ConfigService],
global: true,
}),
AuthModule,
BetterAuthModule.forRootAsync({
BetterModule.forRootAsync({
imports: [EmailModule, AuthModule],
inject: [ConfigService, AuthService, "DB"],
useFactory: (
useFactory: (
configService: ConfigService,
authService: AuthService,
db: DatabasePg,
Expand All @@ -83,16 +81,7 @@ import type { DatabasePg } from "./common";
HealthModule,
],
controllers: [],
providers: [
{
provide: APP_GUARD,
useClass: AuthGuard,
},
{
provide: APP_GUARD,
useClass: StagingGuard,
},
],
providers: [],
})
export class AppModule {
configure(consumer: MiddlewareConsumer) {
Expand Down
4 changes: 3 additions & 1 deletion apps/api/src/auth/auth-email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { EMAIL_QUEUE, EmailQueueJobPayloads } from "./auth.queue";
export class AuthEmailService {
private readonly jobSettings = { age: 3600 };

constructor(@InjectQueue(EMAIL_QUEUE.name) private readonly queue: Queue) {}
constructor(
@InjectQueue(EMAIL_QUEUE.name) private readonly queue: Queue,
) {}

public async sendWelcomeMessageEmailAsync(
payload: EmailQueueJobPayloads["SEND_WELCOME_EMAIL"],
Expand Down
Loading