AlbaSly / Nest-CRM

CRM REST API (Backend Side).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NEST CRM API

Nest Logo

Tech Stack Used

  • Nest
  • MongoDB
  • Docker

How to run this

  1. Clone the repo

  2. Exec with yarn install

  3. You must need already have CLI installed: npm i -g @nestjs/cli

  4. Up Database with docker-compose up-d

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Endpoints

{{API_URL}} = http://localhost:{your_port}/api/v1/

Clients Endpoint

Get Clients

as GET method:

{{API_URL}}/clients/
//This will return all clients

Get Single Client

as GET method

{{API_URL}}/clients/:id

//id must be a valid mongo id

Create Client

as POST method:

{{API_URL}}/clients/

//data
{
  name: "Bob",                          //string, required
  email: "bob@email.com",               //string, required
  company: "Microhard",                 //string, required
  phone: "123456",                      //string, optional
  notes: "Is my most important client"  //string, optional
}

Update Client

as PATCH method

{{API_URL}}/clients/:id

//id must be a valid mongo id

//new data
{
  //ALL VALUES CAN BE optional
  name: "Bob update",                   //string, optional
  email: "bob@email.com",               //string, optional
  company: "Microsoft",                 //string, optional
  phone: "123456",                      //string, optional
  notes: "Hello World"                  //string, optional
}

Delete Client

as DELETE method

{{API_URL}}/clients/:id
//id must be a valid mongo id

About

CRM REST API (Backend Side).


Languages

Language:TypeScript 91.1%Language:JavaScript 8.9%