Skip to content

Add ORM to backend with db container#30

Merged
sanderhurlen merged 32 commits intodevelopfrom
feature/add-orm
Feb 3, 2021
Merged

Add ORM to backend with db container#30
sanderhurlen merged 32 commits intodevelopfrom
feature/add-orm

Conversation

@sanderhurlen
Copy link
Copy Markdown
Contributor

@sanderhurlen sanderhurlen commented Feb 3, 2021

  • adds container for setting up db with own network and volume
  • app connects to db on network
  • adds orm for interacting with db
  • sets up entities we probably will use for application

use the sample code to see that everything is working.

Remember to:

rename 'env.example' to use appropriate variables and rename file to '.env' in your root dir

Closes #13

@sanderhurlen sanderhurlen added performance The app is not performing as expected feature A new feature we need to add labels Feb 3, 2021
@sanderhurlen sanderhurlen added infastructure Code, work, cloud infastructure related priority: high High priority, needs immediate response labels Feb 3, 2021
@sanderhurlen sanderhurlen added this to the Sprint 4 milestone Feb 3, 2021
Comment thread docker-compose.yml
command:
[
"denon",
"run --unstable --config tsconfig.json --allow-read --allow-write --allow-net --allow-env ./src/main.ts",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maby we should change this so that is starts httpServer.ts

Copy link
Copy Markdown
Contributor Author

@sanderhurlen sanderhurlen Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am only using main.ts to show that the db works. On this PR, I was not interested in starting the HTTP server...

However, I personally feel main should be the main starting point for the application.

Comment thread .gitignore Outdated
Comment on lines -1 to -106
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
.idea/
.vscode/
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
build/
tmp/
temp/
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

.DS_Store No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all these be removed?

Copy link
Copy Markdown
Contributor Author

@sanderhurlen sanderhurlen Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. Def, not. Looks like it overrides the develop file. Its a merge conflict

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should just merge dev before merge then.

Comment thread src/studs/elections.ts Outdated
Comment thread src/entity/Ballot.ts Outdated
Comment on lines +13 to +31
enum BallotType {
SINGLE,
MULTIPLE,
RANKED,
}

enum BallotResultDisplay {
NONE,
SINGLE,
RUNNER_UP,
ALL,
}

enum BallotStatus {
IN_QUEUE,
IN_PROGRESS,
IN_RESULT,
IN_ARCHIVE,
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be exported?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of right now, yes. As I don't know why it stops working from a separate file, we would have to use the enums from this file anyway.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment they are not exported though... But probably we will use them in other parts of the project

@sanderhurlen sanderhurlen merged commit 59440ac into develop Feb 3, 2021
@sanderhurlen sanderhurlen deleted the feature/add-orm branch February 3, 2021 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new feature we need to add infastructure Code, work, cloud infastructure related performance The app is not performing as expected priority: high High priority, needs immediate response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup database layer

3 participants