Node is a run-time environment that makes it possible to write server-side JavaScript. It has gained widespread adoption since its release in 2011. Writing server-side JavaScript can be challenging as a codebase grows due to the nature of the JavaScript language; dynamic and weak typed.
Developers coming to JavaScript from other languages often complain about its lack of strong static typing, but this is where TypeScript comes into the picture â to bridge this gap.
TypeScript is a typed (optional) super-set of JavaScript that can help with building and managing large-scale JavaScript projects. It can be thought of as JavaScript with additional features like strong static typing, compilation, and object-oriented programming.
How we start a new Express and TypeScript project?
The main idea is how to build applications with Express and TypeScript ðĪ ?
In Kutia we have created a project starter that allows you to have all the right configurations and just start dealing with business logic and not waste time on project configurations ðĪŠ.
What are the features of this project starter?
Some of features that project contains are:
Beautiful Code ð.
Dependency Injection âĪïļ.
Simplified Database Query ð.
Clear Structure with different layers such as controllers, services, repositories, models, middlewares ðââïļ.
Easy Exception Handling ð.
Smart Validation âïļ.
Easy event dispatching ð.
Fast Database Building with migrations ð.
Easy Data Seeding with our own factories ð.
Auth System ð.
Docker ðģ.
Class-based to handle WebSocket events ð.
Class-based to handle Cron Jobs ðž.
API Documentation ð.
GraphQL ð.
Queue Jobs ð§.
How to install the starter project?
You can check all details of a project on GitHub, but to install a project in a short way, you need to: Clone from GitHub, Run npm install and npm run dev.
Now what?
Now you have a project with Scalable structure, Error handling, Authentication, etc.
Also, you are ready to connect your API with cool javascript clients using the latest sexy frameworks.
Original Article
https://kutia.net/build-cool-apis-in-express-and-typescript/
Top comments (0)