Giter Site home page Giter Site logo

kalideir / express-rest-starter-typescript Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 823 KB

A production-ready, TypeScript-based and scalable Express Starter Template

Shell 0.32% JavaScript 1.10% Dockerfile 1.06% TypeScript 62.48% Handlebars 34.95% Makefile 0.10%
docker docker-compose express-passport express-starter expressjs nodejs typescript zod

express-rest-starter-typescript's Introduction

LinkedIn


Express-TypeScript-Starter

A ready-to-use Express and TypeScript REST API template based on MongoDB.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Althpugh there are many Express templates out there, most of them come lacking specific features like media file upload, schema validation, and no adoption of TypeScript, I built this probject as a template for my future Express projects since it contains the most imortant parts to get your hands on other parts of your code.

With this template you could benefit from:

  • Getting up and running as fast as possible with your projects. No need to write the functionality for auth from scratch.
  • Type-safe schemas and validation with Zod.
  • API Documentation with Swagge
  • Docker & Docker Compose integration.
  • E-mail service with Nodemailer.
  • Media & S3 upload and auto resize functinality with Sharp.
  • Metrics Report using Promethious.
  • Logging & rotation with Winston and Morgan.
  • REST API location that can be simple extended to any language.
  • E-mail Templates
  • Cookie-based & Google Oauth2 authentication.
  • Multi-role authorization.

You might want to furtherly tailor this template for your needs, for example you might use a different emailing service like Sendgrid instead of nodemailer. The separation of concerns approach implemented in this project makes customizying it super easy.

Built With

  • Node.js
  • MongoDB
  • TypeScript
  • Zod
  • Bullmq
  • Docker & Docker-Compose

Getting Started

Using this template in your new projects starts gives you the freedom to run it with a container tool like Docker, or you can use Node directly from the OS.

Prerequisites

To get this project working, the first step is to create an environment-variables .env file that contains all required variables needed in the project.

Installation

  1. If you don't want to use Docker, make sure you have a recent Node version.
  2. To use with Docker, have Docker installed on your computer from its website.
  3. Clone the repo / Use the template.
  4. Fill the values for the environment variables inside the .env file I have provided.
  5. If you wish to continue with Docker, run make build-up local or docker-compose --env-file .env.local up --build. This command will do the installation and running steps for your. If you have correctly set your environment variables, the server will be ready to use.
  6. Navigate to api folder.
  7. Install NPM packages
     npm i
    
  8. Execute the server entry index.ts using npm command npm run dev.
  9. Visit `http://localhost:8000

Roadmap

  • MVP API Starter
  • Add Tests
  • Improve the Swagger documentation
  • Deployment to AWS guide

Contributing

If you noticed anything that you could improve for the better/fix or recommend feel free to open an issue or make a pull request.

License

Distributed under the MIT License.

Contact

Ali H. Kudeir - @kalideir -

Acknowledgments

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.