Coder Social home page Coder Social logo

webapp-exam's Introduction

Server side

API Server

  • POST /session
    • request: username, password
    • response: user (id,role,name,email)
  • GET /session/current
    • request: NONE (except session cookie)
    • response user (id,role,name,email)
  • DELETE /logout
    • request: NONE (except session cookie)
    • response: {message:string}
  • GET /pages/:pageSlug
    • request: pageSlug (param)
    • response: page (id,title,author,publication_date,creation_date,contents)
  • GET /pages
    • request: NONE (except session cookie if any)
    • response: array of pages
  • GET /users
    • request: NONE (except session cookie) -> admin only
    • response: array of users (email,name)
  • POST /pages
    • request: page (author,title,author,publicationDate,contents) -> logged only
    • response: data: { id, slug } or { error }
  • DELETE /pages/:id
    • request: id(param) (and session cookie) <- logged only
    • response: {error} or {message}
  • PUT /site
    • request: (name) <- admin only
    • response: {name} or {error}

Database Tables

  • Table USERS - (id,name,email,password,salt,role)
  • Table PAGES - (id,title,author,creation_date,publication_date,slug)
  • Table CONTENTS - (page,type,data,sequence)
  • Table SITE_DETAILS- (name,val)

Client side

React Client Application Routes

  • Route /: page list (home)
  • Route /add-page: page for creating pages
  • Route /pages/:pageSlug: page for viewing the page in detail
  • Route /pages/:pageSlug: page for viewing the page in detail
  • Route /edit/pages/:pageSlug: page for editing a page
  • Route /site-name: page for editing the site name
  • Route /login: login page
  • Route /*: Not found page

Main React Components

  • AddPage (in /pages/AddPage/index.jsx): page component add new page
  • EditSiteName (in /pages/EditSiteName/index.jsx): page component for editing the site name
  • Login (in /pages/Login/index.jsx): page component for login
  • NotFound (in /pages/NotFound/index.jsx): page component for not found page
  • PagesList (in /pages/PageList/index.jsx): page component for home page (/)
  • PageView (in /pages/PageList/index.jsx): page component display a page content

(only main components, minor ones may be skipped)

Usage info

Example Screenshot

Screenshot Screenshot

Users Credentials

{
    email: "[email protected]",
    name: "Admin1",
    password: "psw",
    role: "admin",
},
{
  email: "[email protected]",
  name: "Admin2",
  password: "psw",
  role: "admin",
},
{
  email: "[email protected]",
  name: "User1",
  password: "psw",
  role: "user",
},
{
  email: "[email protected]",
  name: "User2",
  password: "psw",
  role: "user",
},
{
  email: "[email protected]",
  name: "User3",
  password: "psw",
  role: "user",
}

webapp-exam's People

Contributors

mecios01 avatar

Watchers

 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.