Skip to content
/ node-api-template Public template

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

Notifications You must be signed in to change notification settings

Lissone/node-api-template

Repository files navigation

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

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  /user

GET  /user/:email

POST  /user

PATCH  /user/:email

DELETE  /user/:email

Usage

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

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

Install dependencies using:

npm install

Need to add environment variables:

# .\.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:

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

Run api:

npm run dev

License

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

Made with ❤️ by Lissone