This application provides a simple backend CRUD functionality using the Bottle framework. It covers user authentication, item management, category management, comments, and notifications.
-
Clone the repository:
git clone https://github.com/asterginete/backend-api-bottle.git cd backend-api-bottle
-
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database:
python run.py initdb
-
Run the application:
python run.py
Once the application is running, you can access it at http://localhost:8080
.
- Register:
POST /auth/register
- Login:
POST /auth/login
- Request Password Reset:
POST /auth/request-password-reset
- Reset Password:
POST /auth/reset-password/<token>
- Get Profile:
GET /auth/profile
- Update Profile:
PUT /auth/profile
- List All Items:
GET /items/
- Get Single Item:
GET /items/<item_id>
- Create Item:
POST /items/
- Update Item:
PUT /items/<item_id>
- Delete Item:
DELETE /items/<item_id>
- List All Categories:
GET /categories/
- Get Single Category:
GET /categories/<category_id>
- Create Category:
POST /categories/
- Update Category:
PUT /categories/<category_id>
- Delete Category:
DELETE /categories/<category_id>
- List All Comments for an Item:
GET /comments/item/<item_id>
- Create Comment:
POST /comments/
- Update Comment:
PUT /comments/<comment_id>
- Delete Comment:
DELETE /comments/<comment_id>
- List All Notifications:
GET /notifications/
- Mark Notification as Read:
PUT /notifications/<notification_id>/read
- Delete Notification:
DELETE /notifications/<notification_id>
- User registration and authentication
- Password reset functionality
- CRUD operations for items
- CRUD operations for categories
- Commenting on items
- Notifications for users
- Image upload for items
- Email notifications
- Pagination support
- Search functionality
- Filtering and sorting of items
- User profiles with avatars
- Rate limiting for API requests
- Detailed logging
Tests are written using pytest
. To run the tests:
pytest tests/
- Fork the repository.
- Create a new branch.
- Make your changes and write tests.
- Commit your changes.
- Push to your branch.
- Create a pull request.
This project is licensed under the MIT License.