DEV Community

Cover image for Build Cool APIs In Express and TypeScript
Gentrit Abazi
Gentrit Abazi

Posted on

Build Cool APIs In Express and TypeScript

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)