-
Couldn't load subscription status.
- Fork 11
Enhance Code - Add jwt auth, typescript, documentation, testing (TDD) #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Erick/update documentation
…erver and MongoDB connection using stopDatabase(). This improves stability in dev and production environments.
Erick/update documentation
update documentation
Migrate to ts
add auth middleware, correct type in git-username
update documentation
Documentation/swagger
remove type:module
remove console.error log
|
@johnny-rice forgot to make my PR some weeks ago. |
|
| @@ -0,0 +1,36 @@ | |||
| # 📦 .env.sample | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job adding an env sample
| # Dependency directories | ||
| node_modules/ | ||
| jspm_packages/ | ||
| package-lock.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes good to have package lock committed so the CI can use it with the exact packages it was committed with. Recomend removing it from the ignore.
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
| - Week 10: <https://github.com/SummerOfCode2020/week-10-store-manager-api> | ||
|
|
||
| - Week 12: <https://github.com/SummerOfCode2020/week-12-store-manager-api> | ||
| # Node.js and Express Backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow - nicely improved version.
| @@ -0,0 +1,19 @@ | |||
| /** @type {import('ts-jest').JestConfigWithTsJest} */ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love seeing jest
| { | ||
| "name": "week-10", | ||
| "version": "1.0.0", | ||
| "name": "backend-api", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long week 10!
| return; | ||
| } | ||
|
|
||
| const hashedPassword = await bcrypt.hash(password, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. 12 rounds could be a good way to go here.
| [](https://prettier.io/) | ||
| [](https://eslint.org/) | ||
| [](https://www.typescriptlang.org/) | ||
| [](http://localhost:3000/api-docs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be good to specify local here since we have localhost hardcoded here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR @pakeku !! This is a huge improvement to the aged project. Very nice modernization of the repo. These changes make it much more production ready than the old original.
✅ TypeScript conversion is clean and well structured
✅ JWT auth works well with solid tests
✅ Middleware and error handling are much more robust
✅ TDD setup with Jest + Supertest + in-memory DB is excellent
✅ Swagger docs + improved README are very helpful
✅ CI workflow is a great addition
Minor notes:
- In stores.ts, getStores() strips metadata from response. Just checking if this is intentional, since metadata is used in the update test.
- Store model vs HTTP test fields (store_profile, shipping_address) have some mismatch and could standardize.
Great work. Ready to approve once you confirm the small field consistency.
No description provided.