GithubHelp home page GithubHelp logo

tsoa-sandbox's Introduction

TSOA-Sandbox

A personal project utilizing TSOA with Node, Express and MongoDB for the Server; Angular 5 for the Client.

Progress

  • (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 of TaskController then move on to Frontend.
  • (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 another actor into the application then move on to front-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 like passportJS to have protected route. However, the routes are generated by TSOA. Hence, I had to create a custom-template that will inject passport.authenticate middleware into the routes.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 with TSOA. A lot of roadblocks at first but eventually, I found solutions for most of them.

Steps to get the environment ready

  1. Install nodemon globally if haven't
  2. Install rimraf globally if haven't
  3. (Optional for generating Code for Angular front-end) Install swagger-codegen if haven't. Visit: https://github.com/swagger-api/swagger-codegen
  4. Clone the project.
  5. Read config/default-example.yaml
  6. Run npm install on both the Server and Client side (angular-src)

Steps to start the project

  1. Run npm run start-gen-dev on project's root directory
  2. Open a new terminal (still at the project's root), run npm run swagger-client
  3. Open your browser on: localhost:8080/api/docs to check out the SwaggerUI Documentation
  4. (Optional) If you want to run the Angular front-end, cd ./angular-src then ng serve

Technologies

  1. Node
  2. ExpressJS
  3. MongoDB
  4. TSOA
  5. TypeScript
  6. JWT
  7. PassportJS
  8. Various others

tsoa-sandbox's People

Contributors

nartc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.