Git Product home page Git Product logo

felipebhz / express-typescript-skeleton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from borjapazr/express-typescript-skeleton

0.0 0.0 0.0 6.21 MB

๐Ÿ”ฐ๐Ÿฆธ Template to start developing a REST API with Node.js (Express), TypeScript, Ts.ED, ESLint, Prettier, Husky, Prisma, etc.

Home Page: https://express-typescript-skeleton.marsmachine.space/api/docs

License: MIT License

Shell 1.06% JavaScript 7.79% TypeScript 88.16% Makefile 1.99% Dockerfile 1.01%

express-typescript-skeleton's Introduction

Node.js, Typescript and Express template

GitHub package.json version GitHub CI Workflow Status GitHub CD Workflow Status GitHub LICENSE

๐Ÿ”ฐ๐Ÿฆธ Production-ready template for backends created with Node.js, Typescript and Express

โ„น๏ธ About โ€ข ๐Ÿ“‹ Features โ€ข ๐Ÿค Contributing โ€ข ๐Ÿ›ฃ๏ธ Roadmap โ€ข ๐ŸŽฏ Credits โ€ข ๐Ÿšฉ License


โ„น๏ธ About

The main goal of this project is to provide a base template for the generation of a production-ready REST API made with Node.js, Express and Typescript. The idea is to avoid having to configure all the tools involved in a project every time it is started and thus be able to focus on the definition and implementation of the business logic.

๐Ÿ“ฃ This is an opinionated template. The architecture of the code base and the configuration of the different tools used has been based on best practices and personal preferences.

๐Ÿš€ Quick start

  • Generate Prisma Client:

    npm run prisma:generate
  • Start project in development mode:

    npm run dev
  • Start project in production mode:

    npm run start
  • Open the following URL to interact with the API using Swagger UI:

    http://localhost:5000/api/docs
    # Sample username and password: janedoe / 123456

๐Ÿ“‹ Features

  • Built using Typescript
  • Built using Express Framework: Fast, unopinionated, minimalist web framework for node.
  • Built using Prisma: Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB
  • Built using Ts.ED: Ts.ED is a Node.js Framework on top of Express/Koa.js. Written in Typescript, it helps you build your server-side application easily and quickly. If you want to start a complete out-of-the-box project or fully customize it yourself, Ts.ED will guide you there!
  • JWT authentication and role based authorization using custom middleware
  • OpenAPI definition
  • Fully configured logger with Winston and Morgan
  • Unit, Integration and E2E tests using Jest and Supertest
  • Linting with ESLint
  • Formatting with Prettier
  • Spell check
  • Git hooks with Husky and lint-staged
  • Containerised using Docker and Docker Compose
  • Path aliases support
  • Commit messages must meet conventional commits format
  • GitHub Actions
  • Makefile as project entrypoint
  • A lot of emojis ๐Ÿ›ธ

๐Ÿ Makefile rules

The main actions on this project are managed using a Makefile as an entrypoint.

Usage: make TARGET [ARGUMENTS]

Targets:
  build/prod                Build production environment
  clean/prod                Clean production environment
  deps                      Check if the dependencies are installed
  help                      Show this help
  install                   Install the project
  logs                      Show logs for all or c=<name> containers
  start                     Start application in development mode
  start/db                  Start database container
  start/prod                Start application in production mode
  stop/db                   Stop database container
  stop/prod                 Stop production environment

โšก Scripts

package.json scripts:

  • dev: Start project in development mode
  • build: Build project and generate final build
  • start: Start project in production mode
  • check:types: Check if project types are correct
  • check:format: Check if project is formatted correctly
  • check:lint: Check if project is linted correctly
  • check:spelling: Check if project is spelled correctly
  • fix:format: Fix project format issues
  • fix:lint: Fix project lint issues
  • fix:staged: Check and fix staged files
  • test: Run all tests
  • test:unit: Run unit tests
  • test:int: Run integration tests
  • test:e2e: Run e2e tests
  • test:watch: Run tests in watch mode
  • test:coverage: Run tests with coverage
  • coverage:view: Show coverage information
  • commit: Help to commit changes using conventional commits
  • version: Generate new project version
  • reset-hard: Reset git repository to a clean state
  • prepare-release: Prepare the project for a release and generates a new release
  • update-deps: Update the project dependencies

๐Ÿค Contributing

Just fork and open a pull request. All contributions are welcome ๐Ÿค—

๐Ÿ›ฃ๏ธ Roadmap

Please, check TODO for the current roadmap.

๐ŸŽฏ Credits

To implement this project I have based myself on many similar projects. There were countless of them and I gave them all a star.

๐Ÿ™ Thank you very much for these wonderful creations.

โญ Stargazers

Stargazers repo roster for @borjapazr/express-typescript-skeleton

๐Ÿšฉ License

MIT @ borjapazr. Please see License for more information.

express-typescript-skeleton's People

Contributors

borjapazr avatar dependabot[bot] avatar felipebhz 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.