Giter VIP home page Giter VIP logo

todolist's Introduction

Todo List Web Application

Todo-list Web Application made using NodeJS, Express, React, MySQL, GraphQL, Apollo-Client, Sequelize ORM, Here you can Add todo, Update, Delete and Strikethrough, All the data are stored in MySQL Database.

Screenshots:

Todo list Home Todo list Added Todo Todo list Operations in Todo

Installation

Install NodeJS

Install Todo list Server files

cd server/
npm install -g nodemon
npm install
nodemon server.js

Install Todo list

cd todolist/
npm install
npm start

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

PROXY_PORT=4000

Usage/Examples

To use GraphiQL Developer Tool


  1. For getting all Data from tododb database
query{
  msglist{
    id,
    jobtodo,
    toggle
  }
}

Get data of single ID

query{
  msgDetail(id:1){
    id,
    jobtodo,
    toggle
  }
}

Get data of single ID by passing ID as query variable in JSON format

query($msgid:Int){
  msgDetail(id:$msgid){
    id,
    jobtodo,
    toggle
  }
}

Passing ID as query variable in json format
{
    "msgid": 1
}




2. To Create/Add Data

mutation{
  msgCreate(jobtodo:"1st Data Added"){
	jobtodo
  }
}

To Create using query variable

mutation msgCreate($jobtodo: String!){
  msgCreate(jobtodo:$jobtodo){
    id,
    jobtodo
  }
}

Pass query variable
{
	jobtodo:"New Msg Added"
}




3. To Update Data and show some message when the data is Updated

mutation{
  msgUpdate(id:1, jobtodo:"1st Data Updated Modified"){
    toggle,
    message,
    error
  }
}

To Update using query variable

mutation msgUpdate($id: Int!, $jobtodo: String!){
  msgUpdate(id:$id, jobtodo:$jobtodo){
    toggle,
    message,
    error
  }
}

Pass query variable
{
  "id": 3,
  "jobtodo": "3rd data Updated now"
}




4. To Delete Data on provided ID and show StatusType, some message etc.

mutation{
  msgDelete(id:2){
    toggle,
    message,
    error
  }
}

To Delete using query variable

mutation msgDelete($id: Int!){
  msgDelete(id:$id){
    toggle,
    message
  }
}

Pass query variable
{
id: 21
}




5. Get Toggle Data and show some message when data is Updated

mutation{
  msgToggle(id:1, toggle: 1){
    toggle,
    message,
    error
  }
}

To Toggle Update using query variable

mutation msgToggle($id: Int!, $toggle: Int!){
  msgToggle(id:$id, toggle:$toggle){
    id,
    toggle
  }
}

Pass query variable
{
  "id": 1,
  "toggle": 1
}

Author

๐Ÿ‘ค Rajneesh Kumar

todolist's People

Contributors

ancod3r avatar rajneeshweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

todolist's Issues

Proxy-Setup

Proxy is not working while passing Protocol, Host and Port in setupProxy.js file.

`
const { createProxyMiddleware } = require('http-proxy-middleware');

// const env = dotenv.config({ path: '../config.env' })
// const protocol = 'http://'
const protocol = JSON.parse(process.env.HTTPS) ? "https:" : "http:";
const host = process.env.PROXY_HOST
const port = process.env.PROXY_PORT

module.exports = function (app) {

module.exports = function (app) {
try{
app.use(
'/graphql',
createProxyMiddleware({
target: {
protocol: protocol,
host: host,
port: port
},
changeOrigin: true,
})
);
}
catch(err){
console.log(err.message);
}
};
`

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.