-
Any video or readme, how to setup a development server without mail/redis/cloudinary/rabbitmq? I followed a readme: git clone git@github.com:rubiin/ultimate-nest.git
cd ultimate-nest
cp env/.env.example env/.env.dev
npm install I commented out in .env the things I won't use: redis/rabbitmq/cloudinary/social oauth/and throttler: # This is a sample file generated by sample-env
### Environment File ##################################################################
# This file is a "template" of which env vars need to be defined for your application
########################################################################################
APP_PORT=3333
APP_PREFIX=v1
APP_NAME=testmikrorm
NODE_ENV=dev
API_URL=http://localhost
CLIENT_URL=http://localhost
SWAGGER_USER=test
ALLOWED_HOSTS=origin
SWAGGER_PASSWORD=test
# database
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=root
DB_DATABASE=ultimate_nestjs_db
# encryption
# ENC_IV=
# ENC_KEY=
# jwt
JWT_ACCESS_EXPIRY=9999
JWT_REFRESH_EXPIRY=9999
JWT_SECRET=secret-jwt
# mail
# MAIL_HOST=
# MAIL_PASSWORD=
# MAIL_USERNAME=
# MAIL_PORT=
# MAIL_SERVER=
# MAIL_PREVIEW_EMAIL=
# MAIL_SENDER_EMAIL=
# MAIL_TEMPLATE_DIR=
# cloudinary
# CLOUDINARY_CLOUD_NAME=
# CLOUDINARY_API_KEY=
# CLOUDINARY_API_SECRET=
# redis
# REDIS_TTL=
# REDIS_USERNAME=
# REDIS_PASSWORD=
# REDIS_HOST=
# REDIS_PORT=
# REDIS_URI=
#REDIS_URI=
# rabbitmq
# RABBITMQ_DEFAULT_USER=
# RABBITMQ_DEFAULT_PASS=
# RABBITMQ_EXCHANGE=
# RABBITMQ_DEFAULT_PREFETCH=
# RABBITMQ_URI=
#sentry
# SENTRY_DSN=
#google ouath
# GOOGLE_CLIENT_ID=
# GOOGLE_CLIENT_SECRET=
# GOOGLE_CALLBACK_URL=
#facebook ouath
# FACEBOOK_CLIENT_ID=
# FACEBOOK_CLIENT_SECRET=
# FACEBOOK_CALLBACK_URL=
#throttle
# THROTTLE_LIMIT=
# THROTTLE_TTL= In config.module.ts I commented out the things I won't use: import process from "node:process";
import { HelperService } from "@common/helpers";
import { Module } from "@nestjs/common";
import { ConfigModule, ConfigService } from "@nestjs/config";
import Joi from "joi";
import {
app,
appConfigValidationSchema,
// cloudinary,
// cloudinaryConfigValidationSchema,
database,
databaseConfigValidationSchema,
// facebookOauth,
// facebookOauthConfigValidationSchema,
// googleOauth,
// googleOauthConfigValidationSchema,
jwt,
// mail,
// mailConfigValidationSchema,
// rabbitmq,
// rabbitmqConfigValidationSchema,
// redis,
// redisConfigValidationSchema,
// sentry,
// sentryConfigurationValidationSchema,
// throttle,
// throttleConfigValidationSchema,
} from "./configs";
@Module({
imports: [
ConfigModule.forRoot({
envFilePath: [`${process.cwd()}/env/.env.${process.env.NODE_ENV}`],
load: [
app,
jwt,
database,
// mail,
// redis,
// cloudinary,
// rabbitmq,
// googleOauth,
// facebookOauth,
// throttle,
// sentry,
],
cache: true,
isGlobal: true,
expandVariables: true,
validationSchema: Joi.object({
...appConfigValidationSchema,
...databaseConfigValidationSchema,
// ...mailConfigValidationSchema,
// ...redisConfigValidationSchema,
// ...cloudinaryConfigValidationSchema,
// ...rabbitmqConfigValidationSchema,
// ...googleOauthConfigValidationSchema,
// ...facebookOauthConfigValidationSchema,
// ...throttleConfigValidationSchema,
// ...sentryConfigurationValidationSchema,
}),
validationOptions: {
abortEarly: true,
cache: !HelperService.isProd(),
debug: !HelperService.isProd(),
stack: !HelperService.isProd(),
},
}),
],
providers: [ConfigService],
exports: [ConfigService],
})
export class NestConfigModule {} I installed postgresql locally on my Windows, enter it to it and created db: ultimate_nestjs_db and then i run seeds: Error: Seeder class DatabaseSeeder not found in ./seeders/!(*.d).{js,ts}
at SeedManager.seedString (E:\nestjs\test-starterkits\ultimate-nest\node_modules\@mikro-orm\seeder\SeedManager.js:52:23)
at async Object.handler (E:\nestjs\test-starterkits\ultimate-nest\node_modules\@mikro-orm\cli\commands\DatabaseSeedCommand.js:23:9) After all, I tried for a test to run npx cross-env NODE_ENV=dev npm run start and got the error: [Nest] 6260 - 20.08.2024, 14:04:05 ERROR [ExceptionHandler] Nest can't resolve dependencies of the UserService (?, ReferralRepository, SqlEntityManager, ConfigService, AmqpConnection, CloudinaryService, MailerService). Please make sure that the argument "UserRepository" at index [0] is available in the UserModule context.
Potential solutions:
- Is UserModule a valid NestJS module?
- If "UserRepository" is a provider, is it part of the current UserModule?
- If "UserRepository" is exported from a separate @Module, is that module imported within UserModule?
@Module({
imports: [ /* the Module containing "UserRepository" */ ]
}) Are you planning how to run a development server, especially with docker? For me is quite hard to start it up. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
mail/redis/cloudinary/rabbitmq these are integrated not just as a module but on code part as well. What you can do is remove the modules from shared, remove references of |
Beta Was this translation helpful? Give feedback.
mail/redis/cloudinary/rabbitmq these are integrated not just as a module but on code part as well. What you can do is remove the modules from shared, remove references of
rabbitmq
,caching
,mailservice
andcloudinaryservice