Frappe 开发人员招聘测试
Shelf Ease 应用
为当地图书馆创建了一个用户友好的应用程序,以简化日常任务。图书管理员可以轻松管理书籍、会员和交易。该系统允许对书籍和会员进行 CRUD 操作,允许书籍的借阅和归还,按所有参数搜索,应用租金费用,并对会员强制执行 500 卢比的债务限额。集成的 Frappe API 支持轻松导入书籍,支持标题和作者等参数。代码结构简单清晰。抽象函数确保代码可重用性,简洁的 SQL 查询可实现高效的数据处理。部署在 Vercel。
目录
- 描述
- 功能
- 技术栈
- 屏幕截图
- 如何运行?
- 数据库结构
- API 文档
- Queries(查询)
- 联系方式
功能
- 登录身份验证和注销
- 导入书籍:图书管理员可以将书籍导入数据库(PostGre SQL)。允许以计数、标题、作者、ISBN、出版商、页数为参数。
- 添加/删除书籍:从 PostgreSQL 添加或删除书籍。只能删除未借出的书籍。
- 借阅书籍:通过标题和 ISBN 搜索,允许列出给图书管理员,在详细信息页面上,允许列出可以借阅书籍的会员。借阅时,债务必须低于 500 卢比。
- 归还书籍:显示了分配给会员的所有书籍,图书管理员可以从会员那里归还书籍。归还后会重新计算逾期费用。
- 所有罚款:简明地查看已借出书籍的罚款。
- 月度报告:查看本月的交易金额和库存书籍的报告。
- 添加/删除会员:将会员添加到会员列表或在没有未结款项的情况下删除会员。
- 搜索数据库:通过 5 个参数搜索整个数据库。
技术栈
- Flutter
- Dart
- Python
- Flask
- PostgreSQL
- Vercel(用于托管)
- Supabase(数据库托管)
- Github
屏幕截图
| 登录页面 | 主页 | 搜索书籍 | 仪表板 |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| 个人资料 | 导入书籍 | 添加书籍 | 导入确认屏幕 |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| 借阅书籍 | 书籍详情 | 选择要借阅的会员 | 带过滤器的书籍搜索结果 |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| 所有会员 | 添加会员 | 报告 | 会员已借阅的 respective 书籍 |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
如何运行?
在此处下载应用的 APK 文件: https://drive.google.com/drive/folders/1oqIPQqbu8Rf9z_MVq1O87sr23w7G9uce?usp=sharing
登录凭据
用户名:admin
密码:admin_123
数据库结构和模式
API 文档
https://kumar-harsh-frappe-api-dev-hiring-test.vercel.app/
此 API 使用 POST 请求进行通信,并使用 HTTP 指示状态和错误。所有响应都采用标准 JSON 格式。所有请求都必须包含 application/json 的 content-type、application/json 的 accept,并且请求体必须是有效的 JSON。
登录
您发送:您的登录凭据。
请求
POST /user/verify
Accept: application/json
Content-Type: application/json
Query:
{
'username': 'admin',
'password': 'admin_123'
}
**Successful Response:**
200 OK
{
'users': [{'userid': 1, 'username': 'admin'}, {'userid': 2, 'username': 'devil'}, {'userid': 3, 'username': 'library'}],
'state': True
}
导入数据
您发送:可选:标题、作者、ISBN、出版商、页数、数量。
请求
POST /importData
Accept: application/json
Content-Type: application/json
{
'count': '30',
'title': 'witchcraft'
}
**Successful Response:**
200 OK
{
'message': 'Data imported successfully and Data stored successfully',
'data': [{'bookID': '2002', 'title': 'Harry Potter Schoolbooks
Box Set: Two Classic Books from the Library of Hogwarts School
of Witchcraft and Wizardry', 'authors': 'J.K. Rowling', 'average_rating':
'4.40', 'isbn': '043932162X','isbn13': '9780439321624', 'language_code':
'eng', ' num_pages': '240', 'ratings_count': '11515',
'text_reviews_count': '139', 'publication_date': '11/1/2001',
'publisher': 'Arthur A. Levine'}], 'count': 1
}
搜索数据库
您发送:可选:标题、作者、ISBN、出版商、页数。
请求
POST /search/data
Accept: application/json
Content-Type: application/json
select * from shelfease.books_master where title ILIKE '%harry potter boxed%'
{
'title': 'harry potter boxed'
}
**Successful Response:**
200 OK
{
'message': 'Success', 'data': [{' num_pages': 2690, 'authors':
'J.K. Rowling/Mary GrandPré', 'average_rating': 4.78, 'bookID': 8,
'isbn': '0439682584', 'isbn13': '9780439682589', 'language_code':
'eng', 'publication_date': datetime.date(2004, 9, 13), 'publisher':
'Scholastic', 'ratings_count': 41428, 'text_reviews_count': 164,
'title': 'Harry Potter Boxed Set Books 1-5 (Harry Potter #1-5)',
'isAvailable': True, 'issuedate': 0}], 'count': 1
}
借阅前检查可用性
您发送:book_id。
请求
POST /isbookavailable
Accept: application/json
Content-Type: application/json
select isavailable from shelfease.books_master where book_id=25257;
{
'book_id': '25257'
}
**Successful Response:**
200 OK
{
'available': True
}
获取所有会员
您发送:null。
请求
POST /members/all
Accept: application/json
Content-Type: application/json
select * from shelfease.members;
**Successful Response:**
200 OK
{
'message': 'success', 'data': [{'id': 6, 'name': 'Kumar Harsh', 'email':
'[email protected]', 'phone': '7979844513', 'mem_status': True,
'books_id': [26968], 'due_amt': 610}, {'id': 9, 'name': 'Sumeet', 'email':
'[email protected]', 'phone': '1111223344', 'mem_status': True,
'books_id': [9742, 32816, 2912], 'due_amt': 210}, {'id': 4, 'name':
'Will Smith', 'email': '[email protected]', 'phone': '9986754563',
'mem_status': True, 'books_id': [], 'due_amt': 0}, {'id': 2, 'name':
'Jane Smith', 'email': '[email protected]', 'phone': '987-654-3210',
'mem_status': True, 'books_id': [], 'due_amt': 0}], 'count': 4
}
借阅书籍
您发送:book_id 和 member_id。
请求
POST /members/all
Accept: application/json
Content-Type: application/json
{
'member_id': '4',
'book_id': '25257'
}
select book_list from shelfease.members where member_id=4
update shelfease.books_master set issuedate=1691931114 where book_id=25257;
update shelfease.books_master set isavailable=false where book_id=25257;
update shelfease.members set book_list=ARRAY[25257] where member_id=4;
**Successful Response:**
200 OK
{
'message': 'Book Issued'
}
归还书籍
您发送:book_id 和 member_id。
请求
POST /returnbook
Accept: application/json
Content-Type: application/json
{
'book_id': '25257',
'member_id': '4',
'amt_returned': '1'
}
select book_list from shelfease.members where member_id=4
update shelfease.members set due_amt=0 where member_id=4 ;
update shelfease.members set book_list=ARRAY[]::integer[] where member_id=4;
update shelfease.books_master set issuedate=0 where book_id=25257;
update shelfease.books_master set isavailable=true where book_id=25257;
**Successful Response:**
200 OK
{
'message': 'Book returned'
}
添加书籍
请求
POST /addbook
Accept: application/json
Content-Type: application/json
{
'num_pages': '12', 'authors': 'kumar', 'average_rating': '4',
'book_id': '3', 'isbn': '1', 'isbn13': '13', 'language_code':
'Ger', 'publication_date': '28-10-2012', 'publisher': 'kumar',
'ratings_count': '66', 'text_reviews_count': '13', 'title': 'book1'
}
insert into shelfease.books_master(book_id,title,authors,average_rating,
isbn,isbn13,language_code,num_pages,ratings_count,text_reviews_count,
publication_date,publisher) values (3,'book1','kumar',4.0,'1','13','Ger'
,12,66,13,'28-10-2012','kumar');
**Successful Response:**
200 OK
{
'message': 'data added successfully'
}
添加会员
您发送:姓名、电子邮件、电话请求:
POST /addmembers
Accept: application/json
Content-Type: application/json
{
'name': 'Harsh',
'email': '[email protected]',
'phone': '2345678987'
}
insert into shelfease.members (name, email,phone) values ('Harsh','[email protected]','2345678987');
**Successful Response:**
200 OK
{
'message': 'Member added successfully'
}
删除会员
您发送:姓名、电子邮件、电话请求:
POST /memberdelete
Accept: application/json
Content-Type: application/json
{
'member_id': '10'
}
**Successful Response:**
200 OK
{
'message': 'Delete Successful'
}
删除书籍
您发送:姓名、电子邮件、电话请求:
POST /bookdelete
Accept: application/json
Content-Type: application/json
{
'book_id': '44145'
}
delete from shelfease.books_master where book_id=44145
**Successful Response:**
200 OK
{
'message': 'Delete Successful'
}
Queries(查询)















