Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout #1

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
244 changes: 243 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,243 @@
# mini-wp
# 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
}
```

4 changes: 4 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.DS_Store
.cache
dist
Loading