/armadillo

:leaves: my personal backend server

Primary LanguageJavaScriptMIT LicenseMIT

armadillo

my personal backend server for any and all sites or site extensions

🔧 Installation

Clone repo and navigate to project

git clone https://github.com/dchima/armadillo.git && cd ariel

Install latest version of node

nvm install

Install dependencies

npm i

Run development server

npm run start:dev

Tasks

The client side should be able to

  • add project
  • Get all project
  • edit project
  • remove project
  • add internet article
  • get all internet articles
  • edit internet article
  • remove internet article
  • add a story
  • edit a story
  • remove a story
  • get all stories
  • get one story.

Queries

@ localhost:3000/graphql

Projects

add project

request

mutation {
  addProject(
    title: "project tite",
    category: "project category",
    description: "project description",
    stacks: ["stack", "stack"],
    githubUrl: "github.com/url",
    extenralUrl: "https://example.com",
    docsUrl: "https://docs.com",
    secretKey: "sec_key"
  ) {
    id
    title
    category
    description
    stacks
    githubUrl
    externalUrl
    docsUrl
  }
}

get project

request

query {
    getProjects(secretKey: "sec_key") {
        id
        title
        category
        description
        stacks
        githubUrl
        externalUrl
        docsUrl
        
    }
}

edit project

request

mutation {
    editProject(
        id: 3,
        title: "Site V1",
        secretKey: "sec_key"
    ){
        id
        title
        category
    }
}

remove project

request

mutation {
    removeProject(id: 3, secretKey: "sec_key")
}

Articles

add articles

request

mutation {
  addArticle(
    title: "article tite",
    author: "article author",
    category: "article category",
    link: "article link",
    summary: "article summary",
    imageUrl: "https://image.com",
    secretKey: "secret_key"
  ) {
    id
    title
    author
    category
    link
    summary
    imageUrl
  }
}

edit articles

request

mutation {
  editArticle(
    id: 2,
    secretkey: "sec_key
    author: "article author",
  ) {
    id
    title
    author
  }
}

get articles

request

query {
  getArticles(secretKey: "sec_key") {
        id
    title
    author
    category
    link
    summary
    imageUrl
  }
}

remove articles

request

mutation {
    removeArticle(id: 3, secretKey: "sec_key")
}

Publications

add publication

request

mutation {
  addPublication(
    title: "publication title",
    author: "publication author",
    category: "category",
    description: "publication description",
    body: "<p>publication body</p>"
    imageUrl: "https://image.com",
    secretKey: "sec_key"
  ) {
    id
    title
    author
    category
    description
    body
    imageUrl
  }
}

edit publication

request

mutation {
    editPublication(
        id: 1,
        description: "new publication description",
        secretKey: "sec_key"
    ){
        id
        title
        category
    }
}

remode publication

request

mutation {
    removePublication(id: 1, secretKey: "sec_key")
}

get publications

request

query {
    getPublications {
        title
        id
        author
        category
        description
        slug
    }
}

get sinlge publication

request

// slug or id
query {
    getPublication(slug: "welcome-home") {
        title
        id
        author
        category
        description
        slug
    }
}