Skip to content

Cado21/mini-wp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mini-WP - DeepPress Documentation

Getting Started

Client
===================
1. npm install
2. npm run dev

Server
===================
1. npm install 
2. please get your keyfile.json from google to enable upload image to google cloud storage
3. insert your env variables, see the template
4. npm run dev

Link : http://deeppress.cado.store/

User

Login

Route : /login
Method : POST
Headers : -
Body :

{
    "email" : "[email protected]",
    "password" : "johnDoe123"
}

Response :

Success :
{
    "status": 200,
    "token": <TOKEN>
}

Error :
{
    "status": 400,
    "message": "Invalid Email/Password"
}

Register

Route : /register
Method : POST
Headers : -
Body :

{
    "username" : "johnDoe",
    "email" : "[email protected]",
    "password" : "johnDoe123"
}

Response :

Success :
{
    "status": 201,
    "message": "User Registered",
    "createdUser"
}
Error :
{
    "status": 401,
    "message": "User already registered"
}

Articles

All of routes below need token! [ Authentication ] 

Headers : TOKEN

Create Articles

Route : /articles
Method : POST
Body :

{
    title : STRING,
    content : STRING,
    tags : [],
    file : <IMAGE TYPE FILE>
}

Response :

Success :
{
    status : 200,
    createdArticle
}

Get All Articles

Route : /articles
Method : GET
Body : -
Response :

Success :
{
    status : 200,
    articles : []
}

Get Article by ID

Route : /articles/:id
Method : GET
Body : -
Response :

Success :
{
    status : 200,
    article
}

Get user article

Route : /articles/user
Method : GET
Body : -
Response :

Success :
{
    status : 200,
    articles
}

Search Article by Title

Route : /articles/user
Method : GET
Body : -
Query :

{
    title
}

Response :

Success :
{
    status : 200,
    articles
}

Search Article By Tag

Route : /articles/tag
Method : POST
Body :

{
    tags : []
}

Response :

Success :
{
   status : 200,
   articles : []
}

Search User Article by Title

Route : /articles/user/search
Method : GET
Query :

{
    title
}

Body : -
Response :

Success :
{
   status : 200,
   articles : []
}
Will Authorized , You need to be the owner of the article to user this feature

Update by ID

Route : /articles/:id
Method : PUT
Body :

    title : STRING,
    content : STRING,
    tags : [],
    file : <IMAGE FILE TYPE>

Response :

Success :
{
    status : 200,
    message,
    updatedCount
}

Delete by ID

Route : /articles/:id
Method : DELETE
Body : -
Response :

Success :
{
    status : 200,
    message,
    deletedCount
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 57.2%
  • CSS 25.4%
  • JavaScript 15.8%
  • HTML 1.6%