Author
Created by Rafase282
Github | FreeCodeCamp | CodePen | LinkedIn | Blog/Site | E-Mail
Manga Record Microservice
This is an API created to store crucial information for any manga an authenticated user might read. Wtheer you want to keep track of the manga you will rea, already finished or are currently reading this microservice will help you get your data together. In the Future I intend on adding more features but meanwhile the user interface will be separated and this stays as the core backend.
There is an admin account that is declared onteh envarioment variables that basically has root access, it must be created and a secure password used. The admin can override any information if needed including passwords. In the future I will implement email services to mail queries, and particularly to allow for password reset if forgotten.
What you can do:
- Create a manga accessed at: POST
https://mangadb-r282.herokuapp.com/api/mangas/:user/title=Aiki&author=Isutoshi&url=http%3A%2F%2Fwww.readmanga.today%2Faiki&userStatus=reading&type=Japanese&categories=Action%2C+Ecchi%2C+Martial+Arts%2C+Mature%2C+Seinen&chapter=14&seriesStatus=Completed&plot=There+is+fighting+at+the+high+school+due+to+a+power+struggle+for+control.+The+granddaughter+of+the+chief+director+requests+help+from+the+Aikido+fighting+style+genius.+Will+he+help%3F+Or+will+he+show+his+true+colors+with+his+bad+boy+ways%3F
- Get the manga by title: GET
https://mangadb-r282.herokuapp.com/api/mangas/:user/:manga_title
- Update the manga with this title: PUT
https://mangadb-r282.herokuapp.com/api/mangas/:user/:manga_title
- Delete the manga by title: DELETE
https://mangadb-r282.herokuapp.com/api/mangas/:user/:manga_title
- Admin can get a list of all the mangas across the user base: GET
https://mangadb-r282.herokuapp.com/api/mangas
- Admin can get a list of all users: GET
https://mangadb-r282.herokuapp.com/api/users
- Admin can delete all users including itself, this requires the admin to be re-created: DELETE
https://mangadb-r282.herokuapp.com/api/mangas
- Admin can get a list of all the mangas across the user base: GET
https://mangadb-r282.herokuapp.com/api/mangas
Remember to use Content-Type: application/x-www-form-urlencoded
, the API will tell you what field are required in case you dont want to take a look at the schema.
The Manga Schema:
{
title: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: false,
match: /[a-z]/
},
author: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: false,
match: /[a-z]/
},
url: {
type: String,
trim: true,
required: true,
unique: false
},
userStatus: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: false,
match: /[a-z]/
},
type: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: false,
match: /[a-z]/
},
categories: [{
type: String,
lowercase: true,
trim: true,
required: true,
unique: false,
match: /[a-z]/
}],
chapter: {
type: Number,
required: true,
unique: false,
min: 0,
match: /[0-9]/
},
seriesStatus: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: false,
match: /[a-z]/
},
plot: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: false,
match: /[a-z]/
},
altName: [{
type: String,
lowercase: true,
trim: true,
required: false,
unique: false,
match: /[a-z]/
}],
direction: {
type: String,
lowercase: true,
trim: true,
required: false,
unique: false,
match: /[a-z]/
},
userId: {
type: String,
lowercase: true,
trim: true,
required: false,
unique: false,
match: /[a-z-0-9]+/
},
username: {
type: String,
lowercase: true,
trim: true,
required: false,
unique: false,
match: /[a-z-0-9]+/
},
thumbnail: {
type: String,
trim: true,
required: true,
unique: false
}
}
The User Schema:
{
username: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: true,
match: /[a-z-0-9]+/
},
password: {
type: String,
trim: true,
required: true,
unique: false
},
email: {
type: String,
lowercase: true,
trim: true,
required: true,
unique: true
},
firstname: {
type: String,
lowercase: true,
trim: true,
required: false,
unique: false,
match: /[a-z]/
},
lastname: {
type: String,
lowercase: true,
trim: true,
required: false,
unique: false,
match: /[a-z]/
}
}
To Do:
- Add thumbnail property to Mongoose Schema and make it work with current data.
- Switch to JSON Web Tokens.
- Validate E-mails.
- Verify E-mails.
- Implement password reset mechanism.
- Implement email support to send new passwords when a request for a forgotten password is made.