/create-express-ts-api

A starter to kit for developing REST API in typescript and express.

Primary LanguageJavaScriptMIT LicenseMIT

create-express-ts-api

A starter to kit for developing REST API in typescript and express.

Licence NodeJS TypeScript Prisma Express.js



restapi



Table of Contents
  1. Getting Started
  2. Tech stack used
  3. Setting up Development DB
  4. Documentation

Getting Started

Follow the instructions to initialize your express-ts-api project using this starter kit:

Prerequisites

Install NodeJS LTS

  • npm

    npm install npm@latest -g

Initializing the project

  1. Initiate your project by using the following npm command:

    npx create-express-ts-api  <project-name>

    example : npx create-express-ts-api Firstapi

  2. Install NPM packages

    npm install

    After this follow the steps to setup the Development DB: Setting up Development DB

Note **If facing any issues, feel free to raise a issue or head towards Contact section **

  1. Start the server by running the following command

    npm run dev

Tech Stack Used


Setting up Development DB

To setup the DB follow the steps:

  1. To set up the development DB make sure you have docker and docker-compose installed in your system.

  2. Add a .env file at the root of the project and add a Database URL in the file

PORT=3000
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb"

To Trigger the Development DB Setup run following commands

npm run dev:db
npm run db-generate

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Refer to this Contribution.md if you have any difficulty in making a pull request

License

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


Contact

Sarthak Jain - @sarthakjdev

Email Id : contact.sarthakjain@gmail.com

Discord : Sarthak Jain#2443

LinkedIn: LinkedIn


Documentation

To know more details about it refer to the blog: Hashnode