A personal project utilizing TSOA with Node, Express and MongoDB for the Server; Angular 5 for the Client.
- (Latest) I haven't made much progress over the last couple of days. All the commits were testing Heroku and Service Worker. Fetching data wise, I have been able to fetched the right data for the User (using their JWT issued on
successfully login
). - (Jan 13 2018) Deployed to Heroku as-is. Going to implement more on the Client-side when I've got time to work with it.
- (Jan 12 2018) Tested out the
ApiClient
that Swagger-Codegen generated. Everything worked out pretty well. I also initialized Angular-Redux from@angular-redux/store
. This is going well so far. - (Jan 11 2018) Initialized Angular 5 Frontend. I also tried to include Angular's Service Worker in this project. Let's see how far we can go. Swagger-Codegen is also working as expected. Good day!!
- (Jan 10 2018) Finally got Passport integrated successfully. My routes can be protected with just one line of code (
@Security('JWT')
). Going to implement the rest ofTaskController
then move on toFrontend
. - (Jan 10 2018) I've made some changes to
UserController
and finally got SwaggerUI integrated and working. The models are rendered fine. Next is to implement anotheractor
into the application then move on tofront-end
. - (Jan 09 2018) What a rough day! I've been looking for a working AutoMapper for JS/TS but to no-avail. I've looked at Automapper-ts but the author explicitly said he didn't build the package for using Node specifically. I am going to rewrite my
UserController
tomorrow. - (Jan 08 2018) I've completed utilizing Repository Pattern for the controllers and successfully generated the
routes.ts
file for the backend. Next, I'm looking into injecting SwaggerUI into the project. TSOA, so far, has been working wonder for me. One of the roadblocks was I want to use 3rd party package likepassportJS
to have protected route. However, theroutes
are generated by TSOA. Hence, I had to create acustom-template
that will injectpassport.authenticate
middleware into theroutes.ts
template. I haven't tested the result but will definitely have it tested in the next commit. - (Jan 06 2018) I was fascinated by the almighty Swagger (aka OpenAPI) and was really excited to discover
TSOA
package. As I am trying to integrate TypeScript with Node Express backend, I decide to start on a project withTSOA
. A lot of roadblocks at first but eventually, I found solutions for most of them.
- Install
nodemon
globally if haven't - Install
rimraf
globally if haven't - (Optional for generating Code for Angular front-end) Install
swagger-codegen
if haven't. Visit: https://github.com/swagger-api/swagger-codegen - Clone the project.
- Read
config/default-example.yaml
- Run
npm install
on both the Server and Client side (angular-src
)
- Run
npm run start-gen-dev
on project's root directory - Open a new terminal (still at the project's root), run
npm run swagger-client
- Open your browser on:
localhost:8080/api/docs
to check out the SwaggerUI Documentation - (Optional) If you want to run the
Angular front-end
,cd ./angular-src
thenng serve
- Node
- ExpressJS
- MongoDB
- TSOA
- TypeScript
- JWT
- PassportJS
- Various others