- Implement a simple bulletin board CRUD using Nest.js.
- Connect to a DB.
- Deploy it, not just run it locally.
- Launch Docker.
- Build CI/CD.
- To have fun working on projects after work to find personal development fun.
- To document my troubleshooting process and learnings to grow technically.
isntall
brew install postgresql
Start the service
brew services start postgresql
connect psql
psql postgres
Issue of not being able to create DB itself
At first, I couldn't guess at all, and after searching, I realized that it was a permission issue.
- pgadmin create database not found
- could not create the role pgadmin
- how to setting role of pgadmin
- why can't create database pgadmin
ALTER ROLE {userName} CREATEDB;
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: `.env.${process.env.NODE_ENV}`,
}),
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
type: 'postgres',
host: configService.get('DATABASE_HOST'),
port: 5432,
username: configService.get('DATABASE_USERNAME'),
password: configService.get('DATABASE_PASSWORD'),
database: configService.get('DATABASE_DATABASE'),
entities: [__dirname + '/../**/*.entity.{js,ts}'],
synchronize: true,
}),
}),
BoardsModule,
],
})
- Myth: Relational DBs have huge permissions issues (especially relational DBs).
- it's pretty annoying to configure with Nest.
- I thought process.env would work right away, but it snapped something undefined...
- There's no problem that can't be solved, even if it takes time.
- Connecting to a relational DB was trickier than I thought it would be, but I didn't compromise with myself and stuck with it.
- Listing the problems one by one.