Bookister is a Library System, where the users can borrow and return books, rate them, write a review about a book they have borrowed, read all the reviews about a book and rate the reviews. The page has an administration part and only the admins can create, edit, delete a book and ban user.
The application is written in TypeScript. The front-end part is done with Angular 7 and Bootstrap. The technologies used for the back-end are NestJS with TypeORM and MariaDB as a relational database. The authentication and authorization are working with JSON Web Token (JWT).
-
Create two files in api/src
- .env
PORT=3000 JWT_SECRET=VerySecr3t! JWT_EXPIRE=3600 DB_TYPE=mysql DB_HOST=localhost DB_PORT=3306 DB_USERNAME=root DB_PASSWORD=root DB_DATABASE_NAME=bookister
- ormconfig.json
{ "type": "mysql", "host": "localhost", "port": 3306, "username": "root", "password": "root", "database": "bookister", "entities": ["./src/**/*.entity{.ts,.js}"], "synchronize": true, "migrationsTableName": "custom_migration_table", "migrations": [ "src/data/migration/**/*.ts" ], "cli": { "entitiesDir": "src/data/entities", "migrationsDir": "src/data/migration" } }
# Usage Paths
Request body:
{
"username": string,
"password": string,
"email": string,
}
Request body:
{
"username": string,
"password": string
}
Request body:
{
"title": string,
"author": string,
"topic": string,
"language": string,
"averageRating": string,
}
(averageRating will be deleted from here later)
Request body:
{
"title": string,
"author": string,
"topic": string,
"language": string,
"averageRating": string,
}
(averageRating will be deleted from here later)
Request body:
{
"rating": RatingType,
"comment": string
}
(RatingType is enum with the following string options: Awful / Bad / Average / Good / Excellent )
Request body:
{
"rating": RatingType,
"comment": string
}
(RatingType is enum with the following string options: Awful / Bad / Average / Good / Excellent )