Coder Social home page Coder Social logo

loginsample's Introduction

Simple user board project

Simple user board web application using several libraries. To learn graphql and other libraries.

Features

  • Login
  • CRUD a post (Need login to CUD)

What used
Front-end : Bootstrap 4, jQuery
Back-end : Node.js, Express.js
Data fetching : GraphQL, Mongoose
Authentication : JWT

This project does not use front-end framework like Vue.js or React.js, but just use Express.js, Bootstrap and jQuery.

Prerequisite

  • MongoDB and Node.js must be installed in your computer.
  • MongoDB must be run in your computer.

How to run

  1. Clone or download project
  2. Go to the project directory in command prompt
  3. Install dependencies -> "npm install"
  4. Run app -> "DEBUG=/:* npm start"
  5. Load "localhost:3000" in web browser

You can go to url : localhost:3000/graphql to test graphql api

GraphQL queries and mutations

  • Query

    • getUserInfo(Token): Return user information using token
    • getUsers(Token) : Return user information list (need token to auth and user level must be greater than 0 in DB)
    • getPosts : Return posts
    • getPost(pid): Return single post (need pid)
  • Mutation

    • signUp(userInfo) : Sign up for new user and return message of singup result
    • login(id, pw): Login using id and pw and return message of login result
    • writePost(postInput, token): Write a post and return message of write result (need token to verify document owner)
    • updatePost(pid, token, postInput): Update a post and return message of write result (need token to verify document owner)
    • deletePost(pid, token): Delete a post and return message of write result (need token to verify document owner)

Web endpoint

  • /
    - Main Page - List
    Main Page1

    - Main Page - Write
    Main Page2

    - Main Page - Detail (Update or delete)
    Main Page3

  • /login
    - Login Page - Login or sign up
    Login Page

  • /users
    - User Page - User information or log out
    User Page

  • /graphql
    - GraphQL Page - Test queries and mutations
    GraphQL Page

Mongoose Schema

  • User
    • id(_id)
    • uid
    • password
    • nickname
    • level
  • Post
    • id(_id)
    • pid
    • title
    • content
    • createdAt

loginsample's People

Contributors

hot6ix avatar jamesy5017 avatar

Watchers

James Cloos avatar

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.