Closed BenjaminTanguay closed 5 years ago
We may be able to use our typescript classes with https://libraries.io/npm/typegoose
A great mongo video to start: https://www.youtube.com/watch?v=WDrU305J1yw
Hi, before going further into a specific technology. We must read/acknowledge strengths of each technology.
Please have a look at: https://www.quora.com/Which-database-you-recommend-for-web-based-big-data-reporting-with-high-speed-processing
It seems like since MongoDB is a NoSQL, the transaction cost may be high if we have a lot of information to go through.
Also found this: https://tutorialedge.net/typescript/typescript-mongodb-beginners-tutorial/ A good way to get started using Docker.
Watch out before creating container or files we have to agree on a tech. to use
A free cloud MongoDB can be used, atlas: https://www.mongodb.com/cloud/atlas
Alright, we now have a connection factory that doesn't need .env
variable (connection URL configurable on the go).
@ddicorpo and @philbeaudry You are assigned to the next task schema
Why you always want to use testingContext
-> true when not running node.
https://www.quora.com/Is-it-necessary-to-close-the-mongoose-connection
In order to facilitate the completion of the story I've made a sample case with the data User
. As in the data model on draw.io the schema has all field needed.
I've also design a architecture wich will allow us to be independent from the ORM technologies.
The User
persistant storage is made of:
UserTDG
: Insert/Update/DeleteUserFinder
: Possible find method neededIUserModel
an interface for the fieldUserSchema
a schema of the table for the ORMUserIntegration.test
a test showing the user actionWe have 8 other tables todo. I will not be able to it all. You should choose a table and start doing it.
You should test your code with npm run test
. You can also check the database for your data you can simply use the Mongo
plugin in Intellij Ultimate (I've made a tutorial on it in README
)
We still have to build the reset database command/util tool.
(assigned: @MewtR , @23jams , @ddicorpo , @Winterhart , @rena-21, @philbeaudry )
Write your name in front of at least two tables, then you can copy/paste from the User
example.
In order to make our data independent from our business logic. We will add our method/business logic
in a mapper
folder in domain
e.g. We will have a UserMapper
with methods register
login
, hashPassword
src/domain/mapper/UserMapper.ts
Example of registration function
public Register(newUser: IUserModel) : Promise<boolean> {
...
// If user already created
let userExists: boolean = userFinder.findByUsername(newUser);
// Hash Password
...
// User Register
userTDG.create(newUser);
...
}
Conclusion: Our front-end, will be able to call .../register as a POST
with username, password, firstName, LastName...
The delete
method in baseTDG
is not done yet
baseTDG
, update
and delete
are completed...
We having a problem with using the ref
option in the mongoose...
The problem with ref
has been resolved
We have a few remaining tasks:
Token
and Git
API key
to prevent anyone from calling the API
?front-end
needs rigth now?
Description
As a HR employee at IBM Consulting, I want to have access to a persistent list of potential candidates so that I can retrieve them at any given time
Risk
Low
Value
Medium
Story points
8
General Description
Explore database options, implements
.env
variable. Explore ORMs.We need to include an ORM to streamline the database creation process. Once the database schema has been created, put it in a docker container.
Dev. shall be able to use the microservices architecture in its environment.
How
.env
files and variables, refactor to send token into those files @Winterhart Ideal Hours: 2hIdeal Hours: 4h
Ideal Hours: 4h
Acceptance Criteria
Acceptance Tests
(Initial) Data Model Document