This project is a library management system with a backend built using Ruby on Rails and a frontend built using React.
In this particular case Book copies are borrowed by members and managed by librarians. Members can borrow and return book copies, while librarians can manage books, and book copies.
Endpoints are documented using Swagger and are grouped by Member and Librarian roles.
Authentication is implemented with JWT and devise for user management.
Authorization is implemented with Policy Object pattern.
- Backend: Ruby on Rails 3.1.2
- Frontend: React with Node.js 20
- Database: PostgreSQL
- Docker
- Docker Compose
- Git
git clone https://github.com/yourusername/ballast-library.git
cd ballast-library
Running the Application with Docker
docker-compose up --build -d
- Backend: The Rails server will be running at
http://127.0.0.1:3000
- API Documentation: The Swagger documentation will be available at
http://127.0.0.1:3000/api-docs/index.html
- Frontend: The React development server will be running at
http://127.0.0.1:3001
docker-compose down
To run the backend tests, use the following command:
docker-compose exec backend bash -c "RAILS_ENV=test rspec"
- Member:
- Email: member@example.com
- Password: Mpassword
- Librarian:
- Email: librarian@example.com
- Password: Lpassword
- Backend: The backend is configured to use PostgreSQL. Ensure that the database configuration in
backend/config/database.yml
matches your setup. - Frontend: The frontend is configured to run on port 3001 to avoid conflicts with the backend.