Week 6 #
Links #
Specify all the necessary links to your resources:
Category | Link |
---|---|
π Deployment | libnet |
π API Docs | FastAPI |
π¨ Design | Figma |
βΆοΈ Demo | Video |
π¦ Repository | GitHub |
Final deliverables #
Project overview #
Problem Statement #
LibNet addresses three core challenges in library management systems:
- Fragmented book search across multiple libraries
- Outdated interfaces with poor user experience
- Difficulties in obtaining books simplified the search and booking of books
Key Implemented Features #
For Readers #
- π Unified book search across all partner libraries
- π Online reservation system with status tracking
- β€οΈ Favorites list for saved books
- π± Responsive design for devices
For Library Staff #
- π Manager dashboard for reservations
- π Book inventory management
- π’ Multi-library support
Technical Highlights #
- β‘ FastAPI backend with JWT authentication
- π¨ React frontend with Vite optimization
- π Grafana/Loki monitoring stack
- π Automated database migration (Ollama)
- π‘οΈ Role-based access control
Impact #
- Fast book discovery for users
- Centralized management for library networks
Features #
For All Users #
Book Search & Discovery
- Unified catalog across multiple libraries
- Advanced filters (author, genre, year, availability)
- βNothing foundβ handling with suggestions
- Book details with cover images
User Management
- Registration with email validation
- Login/Logout functionality
- Password reset/change flow
- Profile editing
For Readers #
Reservation System
- Book reservation with status tracking
- Booking cancellation
- Favorites list (like/unlike books)
- Order history
UI/UX
- Responsive design (mobile/desktop)
- Loading skeletons
- Accessible navigation
For Library Staff #
Manager Tools
- Library-specific dashboard
- Booking management (approve/reject)
- Book inventory CRUD operations
- Library working days configuration
- Manager assignment system
Admin Features
- Multi-library management
- User role administration
- System monitoring access
- Self-deletion protection
Technical Features #
Security
- JWT authentication
- Role-based access control
- DDOS protection
- HTTPS enforcement
Infrastructure
- Dockerized deployment
- Grafana/Loki monitoring
- CI/CD pipelines
- Automated database migrations
Tech stack #
Backend #
Python
- Simple syntax with extensive libraries
- Rapid development capabilities
FastAPI
- High-performance async framework
- Seamless PostgreSQL integration
- Automatic OpenAPI documentation
Frontend #
React
- Component-based architecture
- Reusable UI elements (book cards, forms)
- Future-proof scalability
Vite
- Lightning-fast build tool
- Hot module replacement
Database #
PostgreSQL
- Relational structure for complex queries
- Built-in JSON support
- Easy schema migrations
Monitoring & Analytics #
Grafana + Loki
- Real-time application monitoring
- Centralized logging system
- Performance dashboards
Data Processing #
Ollama
- Library database migration tool
- Cross-format parsing (.xls, .csv, .json)
- Schema mapping automation
DevOps #
Docker
- Containerized environments
- Development/production parity
GitHub Actions
- Automated CI/CD pipelines
- Pull request testing
- Zero-downtime deployments
Project Management #
ClickUp
- Task tracking
- Sprint planning
- Team coordination
Setup instructions #
Prerequisites #
- Docker and Docker Compose installed
- Google account with 2FA enabled
- Git installed
Deployment Steps #
Clone the repository
git clone https://github.com/IU-Capstone-Project-2025/libnet.git cd libnet
Configure environment
cd backend nano .env # Create environment file
Edit
.env
file:DATABASE_URL=database-url SECRET_KEY=your-secret-key POSTGRES_USER=your_db_user POSTGRES_PASSWORD=your_db_password POSTGRES_DB=your_db_name SMTP_USER=your-email@gmail.com SMTP_PASS=your-google-app-password
Google SMTP Setup:
- Enable 2FA on your Google account
- Get a key for the application via Google
- Enter the key in SMTP_PASS, SMTP_USER as email
Launch services
docker-compose up -d --build
The project has been launched!
Presentation draft #
Production (Bonus Assignment) #
Production Deployment #
For production deployment, we selected a reliable Virtual Dedicated Server (VDS) provider.
At first, we compared several platforms: host-wds, Beget, and Timeweb. We went with Beget, because:
- It came with a pre-installed Docker service, making environment setup easier.
- Pricing was attractive.
- The UX/design was user-friendly.
- Some competitors offered VDS abroad with latency and performance issues; we preferred speed and chose a server in Russia.
Server configuration:
- 2 CPU cores (for multiprocessing)
- 4GB RAM
- 50GB NVMe SSD (fast SSD connected directly to motherboard)
Production environment setup:
Purchased the server and connected via SSH.
Cloned the repository to the server.
Created a local
.env
for secrets:- DB connection string (includes DB name, user, password)
- Credentials for a DB user
- Secret key for password encoding
- SMTP user/password for sending confirmation codes
The
.env
is only on the server; never committed to source control.Containerization/Orchestration:
- Used
docker-compose.yml
to configure and run all containers. - Authored Dockerfiles for both backend and frontend.
- Initially, Nginx was in a separate container; to simplify, later merged Nginx and frontend into one container.
The frontend Dockerfile has build and production stages. - Nginx has its own config for HTTPβHTTPS redirection.
- Custom
loki.yml
andprometheus.yml
for logging and monitoring setup.
- Used
CI/CD Pipeline:
docker-compose.test.yml
runs backend and test Postgres for CI.- GitHub Actions (.github/workflows) was split:
- One file for CI (triggered on push to
main
/devops
) - One file for CD (auto-deploy, on push to
main
, runs only after CI passes)
- One file for CI (triggered on push to
- Secrets (.env) are never in git, only on the server.
.dockerignore
is set up. - For autodeploy:
- Created a
deploy.yml
workflow in.github/workflows
with commands for deployment. - Generated a private SSH key on a different workstation;
added the public key to~/.ssh/authorized_keys
on the server. - Stored the private key in GitHub repo secrets as
SSH_PRIVATE_KEY
. - Other secrets:
SSH_HOST
,SSH_USER
,PROJECT_DIR
.
- Created a
Domain name setup:
- Registered
libnet.site
at reg.ru. - Configured DNS:
- A-record
@
β83.222.17.10
- A-record
www
β83.222.17.10
- A-record
- Registered
Weekly commitments #
Individual contribution of each participant #
Plan for Future #
Backend #
- Recursive deletion of objects to avoid conflicts
Frontend #
- Fix possible bugs
- Clean up code from console output
Confirmation of the codeβs operability #
We confirm that the code in the main branch:
- In working condition.
- Run via docker-compose (or another alternative described in the README.md).