Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lissone/node-api-template

Template made in Typescript with Express and structured with an architecture based on clean and DDD.
https://github.com/lissone/node-api-template

commitlint docker-compose eslint express husky nodejs postgresql typeorm typescript yup

Last synced: 2 days ago
JSON representation

Template made in Typescript with Express and structured with an architecture based on clean and DDD.

Awesome Lists containing this project

README

        


Node Express API Template


Description   |   
Requirements   |   
Technologies   |   
Endpoints   |   
Usage





License
Repo size
Top lang
Stars repo
Forks repo
Pull requests
Last commit


Report bug
·
Request feature


## Description

Template made in Typescript with Express and structured with an architecture based on clean and DDD, to facilitate the creation of new projects and developer productivity, which can be created from this one.

Already configured with Typescript, ORM, Linter and Husky, with a pre-built CRUD and endpoints listed in the documentation.

### Requirements

- [Nodejs](https://nodejs.org/en/)
- [Npm](https://www.npmjs.com/)
- [Docker](https://www.docker.com/)

### Technologies

- NodeJs
- Typescript
- Express
- TypeORM
- PostgreSQL
- Yup
- Eslint
- @lissone/eslint-config/node
- Commitlint
- config-conventional
- Husky

### Endpoints

Base url: https://localhost:5000/api/v1

![GET](https://img.shields.io/badge/-GET-70BB60?style=for-the-badge) 
/user

![GET](https://img.shields.io/badge/-GET-70BB60?style=for-the-badge) 
/user/:email

![POST](https://img.shields.io/badge/-POST-2991B8?style=for-the-badge) 
/user

![PATCH](https://img.shields.io/badge/-PATCH-99768C?style=for-the-badge) 
/user/:email

![DELETE](https://img.shields.io/badge/-DELETE-DF807E?style=for-the-badge) 
/user/:email

### Usage

You can use this project as a template for another one, or clone it on your pc using the command:

```bash
git clone https://github.com/Lissone/node-api-template.git
cd node-api-template
```

Install dependencies using:

```bash
npm install
```

Need to add environment variables:

```bash
# .\.env

# APP
PORT=5000

# POSTGRESQL
POSTGRESQL_HOST=localhost
POSTGRESQL_PORT=5432
POSTGRESQL_USERNAME=docker
POSTGRESQL_PASSWORD=docker
POSTGRESQL_DATABASE=exampledb
```

You must have **Docker installed** on your machine to get the container up.
**Up PostgreSQL service** in a **Docker container** on your local machine using:

```bash
docker-compose up -d
# View all running containers
docker ps
```

Run api:

```bash
npm run dev
```

## License

Distributed under the MIT License. See `LICENSE` for more information.


Made with ❤️ by Lissone