Mangos Team presents a system for books exchange.
Where users can finally make their reader's dreams come true. All of us, the readers, are struggling with the same problem - after some time our bookshelves are full of volumes, series of books we've already read. As there are books we want to keep for life, there are some that were meant to be read only once (We feel sorry for them too). PikaBook can give them a second life! Our API allows you to find other people that are willing to adopt your unneeded books in exchange for readings they offers.
- Node.js / Express
- REST API
- JWT validation
- NoSQL MongoDB and mongoose
- authorization and authentication with Json Web Token
- jest
- Aleksandra Cypko
- Agata Ludwiczyńska
- Daria Dziubałtowska (Tech Lead)
- Małgorzata Dziewit (Develepment Manager)
- Mariusz Smarż (Business Owner)
Mentor: Łukasz Dutka
Local set up
- Clone the repo
npm install
- update
src/pre-start/env/developement.env
file with your Mongo database urlDATABASE_URL=
npm start:dev
To use most of API functionalities, you need to make an account and authorize yourself.
- Register with
POST /api/users
and provide
{
"password":
"email":
"name":
"location":
}
- Log in using
POST /api/auth
with
{
"password":
"email":
}
- create an accaunt and log in to the system
- add and remove books to/from their collection
- filter books by users, location or title
- user can initiate exchange with other user, propose its own books for other user's titles by creating a basket
- possible to change basket status to track the book exchange
- users can communicate over messages to agree on a details of the exchange
- pokes - interaction between users, to let others know you are interested in one of their books
Get the full list of all books. Possible parameters:
Parameter | Type | Description |
---|---|---|
location | string | Filter books by owner's location |
name | string | Filter book by title |
author | string | Filter book by author |
year | number | Filter book by year published |
genres | list of strings separated by comma | Filter by genre |
GET /api/books
GET /api/books?name=book&location=city?genres=action,fantasy
Get a book by id
GET /api/books/:id
Add book
POST /api/books
Update one of actually logged in user books
PUT /api/books/:id
Delete book of actually logged in user
DELETE /api/books/:id
Get the list of all users
GET /api/users
Get a user by id
GET /api/users/:id/
Get user's books by id
GET /api/users/:id/books
Send a new messaage
POST /api/conversations
Update a message
PUT /api/conversations
Available basket's status codes: 'pending', 'accepted', 'rejected', 'cancelled', 'offered','failedByRequestor', 'failedByTarget', 'success'
Create a basket
POST /api/baskets
Get a basket by id
GET /api/baskets/:id
Update a basket
PUT /api/baskets/:id
Poke a user
POST /api/pokes
Update a poke
POST /api/pokes/:id
Get a currently logged user
GET /api/me/
Get all books of the currently logged user
GET /api/me/books
Get all baskets of the currently logged user, possible to filter by status
GET /api/me/baskets
GET /api/me/baskets=offered
Get all conversations of the currently logged user
GET /api/me/conversations
Get a conversation with a specific user
GET /api/me/conversations/:id
Get all pokes of the currently logged user
GET /api/me/pokes
Get a poke by its ID
GET /api/me/pokes/:id
Get all baskets of currently logged user
GET /api/me/baskets