A simple web-based system for lending professional equipment with user authentication, equipment browsing, borrowing workflow, and admin management.
- User Authentication: Registration and login with JWT tokens
- Equipment Browsing: View available equipment with search and filtering
- Booking System: Book equipment with date validation and conflict detection
- User Dashboard: View personal bookings and manage reservations
- Admin Panel: Manage equipment inventory (add, edit, delete)
- Users can only have one active booking per day
- Equipment cannot be double-booked for overlapping dates
- Admins have full CRUD access to equipment
- Users can only view/cancel their own bookings
- No return workflow - booking auto-completes after return date
- FastAPI (Python) - Web framework
- SQLAlchemy - ORM
- SQLite - Database
- JWT - Authentication
- Pydantic - Data validation
- React with TypeScript
- Tailwind CSS - Styling
- React Router - Routing
- Context API - State management
- Python 3.11+
- Node.js 16+
- uv (Python package manager)
- Navigate to the backend directory:
cd backend- Install dependencies:
uv sync- Run the development server:
uv run uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will be available at http://localhost:5173
For production deployment using Docker Compose with PostgreSQL, see the DEPLOYMENT.md guide.
# Copy environment templates
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
# Edit environment files with your settings
# Then deploy with Docker Compose
docker-compose -f docker-compose.prod.yml up -dThe application will be available at http://your-server-ip
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user
GET /api/equipment- List equipment (with filters)GET /api/equipment/{id}- Get equipment detailsPOST /api/equipment- Create equipment (admin only)PUT /api/equipment/{id}- Update equipment (admin only)DELETE /api/equipment/{id}- Delete equipment (admin only)GET /api/equipment/{id}/availability- Check availability
GET /api/bookings- List all bookings (admin only)GET /api/bookings/my-bookings- Get user's bookingsGET /api/bookings/{id}- Get booking detailsPOST /api/bookings- Create bookingDELETE /api/bookings/{id}- Cancel booking
- Email: admin@admin.com
- Password: admin123
Important: Change the admin password after first login in production.
- Login: Sign in with admin credentials or register a new account
- Browse Equipment: View available equipment with search and filters
- Book Equipment: Select equipment and choose borrow/return dates
- Manage Bookings: View and cancel your bookings from the dashboard
- Admin Functions: Admins can manage equipment inventory and users
- id, email, name, password_hash, role, created_at
- id, name, model, description, category, status, image_url, created_at
- id, equipment_id, user_id, borrow_date, return_date, status, created_at
- PostgreSQL database with automatic initialization
- Use
uv run uvicorn main:app --reloadfor development - API documentation available at
http://localhost:8000/docs - Environment variables configured via
.envfile
- Uses Vite for fast development
- Hot reload enabled
- TypeScript for type safety
- Tailwind CSS for styling
- Environment variables via
.envfile
- Docker containerization for both frontend and backend
- PostgreSQL database with persistent storage
- Nginx reverse proxy with static file serving
- Health checks and restart policies
- Environment-based configuration
- Security headers and optimizations
This project is licensed under the MIT License.