Welcome to the Online Book Raffle System (OBRS) backend repository. This repository contains the backend code and infrastructure for the OBRS application, which facilitates the sale of raffle tickets for various books, conducts raffle draws, and serves as the core of the system.
- Purpose
- Project Structure
- Technologies
- Setup and Installation
- Contributing
- API Documentation
- Testing
- Continuous Integration
- Deployment
- License
The purpose of the OBRS backend is to:
- Handle the core functionality of the application, including book and user management, raffle ticket sales, and draw operations.
- Serve as the bridge between the frontend user interface and the database.
- Ensure data security, integrity, and reliability.
- Enable scalability, maintainability, and efficient performance of the system.
The backend project is structured as follows:
.
├── README.md
├── app
│ ├── Dockerfile
│ ├── Procfile
│ ├── __init__.py
│ ├── analytics
│ │ ├── __init__.py
│ │ ├── errors.py
│ │ ├── forms.py
│ │ └── views.py
│ ├── api
│ │ ├── __init__.py
│ │ ├── errors.py
│ │ ├── forms.py
│ │ └── views.py
│ ├── authentication
│ │ ├── __init__.py
│ │ ├── errors.py
│ │ ├── forms.py
│ │ └── views.py
│ ├── boot.sh
│ ├── docker-compose.yml
│ ├── main
│ │ ├── __init__.py
│ │ ├── errors.py
│ │ ├── forms.py
│ │ └── views.py
│ ├── models.py
│ ├── profiles
│ │ ├── __init__.py
│ │ ├── errors.py
│ │ ├── forms.py
│ │ └── views.py
│ ├── registration
│ │ ├── __init__.py
│ │ ├── errors.py
│ │ ├── forms.py
│ │ └── views.py
│ ├── static
│ │ └── js
│ │ ├── authentication
│ │ │ └── login_user.js
│ │ └── registration
│ │ └── register_user.js
│ └── templates
│ ├── 403.html
│ ├── 404.html
│ ├── 500.html
│ ├── analytics
│ │ ├── 403.html
│ │ ├── 404.html
│ │ └── 500.html
│ ├── api
│ │ ├── 403.html
│ │ ├── 404.html
│ │ └── 500.html
│ ├── authentication
│ │ ├── 403.html
│ │ ├── 404.html
│ │ ├── 500.html
│ │ └── login_user.html
│ ├── base.html
│ ├── main
│ │ ├── 403.html
│ │ ├── 404.html
│ │ ├── 500.html
│ │ └── index.html
│ ├── profiles
│ │ ├── 403.html
│ │ ├── 404.html
│ │ └── 500.html
│ └── registration
│ ├── 403.html
│ ├── 404.html
│ ├── 500.html
│ └── register_user.html
├── config.py
├── data-dev-sqlite
├── decorators.py
├── flasky.py
├── migrations
│ ├── README
│ ├── alembic.ini
│ ├── env.py
│ ├── script.py.mako
│ └── versions
│ ├── 2f0b818ece47_.py
│ └── 390fd091247c_.py
└── requirements.txt
The OBRS backend is built using Flask, a Python web framework, along with a variety of other technologies:
- Flask
- SQLAlchemy (for database management)
- Flask-RESTful (for building REST APIs)
- Flask-JWT-Extended (for JWT-based authentication)
- Pytest (for testing)
Please refer to the requirements.txt
file for a comprehensive list of dependencies and their versions.
To set up the OBRS backend locally, follow these steps:
- Clone this repository to your local machine.
- Install Python (if not already installed) and create a virtual environment.
- Install required dependencies:
pip install -r requirements.txt
- Create an
.env
file in the project root with the necessary environment variables (contact the project administrator for details). - Run the following command:
python run.py
The backend should now be running locally. You can access it via the specified port (default: 5000).
We welcome contributions from the development community to enhance the OBRS backend. To contribute:
- Fork this repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure they are thoroughly tested.
- Commit your changes and create a well-described pull request.
- The project maintainers will review your changes and provide feedback.
Please adhere to the contributing guidelines in the repository.
Comprehensive API documentation is available in the API Documentation file. This document outlines available endpoints, request formats, responses, and authentication requirements.
To ensure the reliability of the backend, we maintain a suite of automated tests. You can run the tests with the following command:
pytest
Make sure to add test cases for new features or bug fixes to maintain the test coverage.
We utilize a continuous integration (CI) system to automatically build, test, and deploy the backend. The CI system helps ensure code quality and reliability.
For deployment instructions and best practices, please refer to the Deployment document. This guide provides details on deploying the backend to various environments, including production servers.
The OBRS backend is released under the MIT License. You are encouraged to review and comply with the terms of this license when using or contributing to the project.
For questions, updates, or matters related to the OBRS backend, please contact the project administrator or the designated contact for backend inquiries.