A modern, full-stack MERN application for SFAC (School of Future Academy of Cebu) that provides comprehensive stock management, reservation handling, user management, and a student lost & found posting system with premium UX/UI design.A full-stack MERN application for SFAC that provides stock management, reservation handling, and a student lost & found posting system.
- π¦ Stock Management β manage and track items in SFACβs inventory
π For Students & Teachers- π Reservation System β students and staff can reserve items seamlessly
-
π¦ Stock Availability β Browse and search available items across multiple categories- π Lost & Found β students can post and browse lost & found items
-
π Reservation System β Reserve items seamlessly with real-time availability tracking- π User Authentication β secure login & role-based access
-
π Lost & Found β Post and browse lost & found items with image support- π RESTful API (Express + MongoDB) β backend handles stock, reservations, and posts
-
π Personal Dashboard β Track reservations, view popular items, and access quick actions- β‘ Frontend (React + Vite) β fast, modern UI with responsive design
-
π¨ Modern UI/UX β Glassmorphism design with smooth animations and responsive layouts- π Real-time Updates β reservations and inventory sync instantly
-
π Deployment Ready β easily deployed via Vercel and Node servers
-
ποΈ Staff Panel β Dedicated control center for managing all reservations---
-
β Reservation Management β View, filter, search, and mark reservations as collected
-
π Real-time Stats β Dashboard showing total reservations, pending items, and collected items## π οΈ Tech Stack
-
π Advanced Filtering β Filter by status, sort by date/user/item, dual view modes (cards/table)- MongoDB β database
-
π Detailed Views β Comprehensive modal with user info, item details, and timeline- Express.js β backend framework
-
React β frontend library
-
π‘οΈ Admin Panel β Complete user management and system administration- TypeScript β safer development
-
π₯ User Management β View all users with verification status indicators- CSS / Tailwind β styling
-
β User Verification β Verify user emails and ID documents
-
π Security Controls β Reset user passwords, delete accounts with confirmation---
-
π Advanced Search β Filter by role, verification status, search by name/email
-
π User Analytics β Track verified, partially verified, and unverified users## π― Roadmap
-
β Core stock + reservation system
-
π JWT Authentication β Secure token-based authentication with automatic refresh- β³ Admin dashboard for inventory analytics
-
π‘οΈ Role-based Access Control β Admin, Staff, Teacher, and Student roles- β³ Notification system for reservations
-
π§ Email & ID Verification β Two-factor verification system- β³ File upload support (lost item images)
-
πΌοΈ Cloudinary Integration β Secure image upload and storage for ID verification
-
π Protected Routes β Middleware-based authentication for all sensitive endpoints
- π RESTful API β Clean, organized Express.js backend with MongoDB
- π Real-time Updates β Socket.io integration for live data synchronization
- π± Responsive Design β Mobile-first approach, works on all devices
- π Modern CSS β Glassmorphism, gradients, animations, and smooth transitions
- π Performance Optimized β Built-in performance monitoring and optimization
- π Production Ready β Deployed on Fly.io (backend) and Vercel (frontend)
- Node.js β JavaScript runtime environment
- Express.js β Fast, unopinionated web framework
- MongoDB β NoSQL database with Mongoose ODM
- Socket.io β Real-time bidirectional communication
- JWT β JSON Web Tokens for authentication
- bcrypt β Password hashing and security
- Cloudinary β Cloud-based image management
- CORS β Cross-Origin Resource Sharing
- Fly.io β Backend deployment platform
- React β Component-based UI library
- TypeScript β Type-safe JavaScript
- Vite β Next-generation frontend build tool
- React Router β Client-side routing
- Tailwind CSS β Utility-first CSS framework
- Custom CSS β Glassmorphism and modern design patterns
- Socket.io Client β Real-time client integration
- React Loading Indicators β Elegant loading states
- Vercel β Frontend deployment platform
- User Model β Authentication, roles, verification, ID storage
- Product Model β Inventory items with categories and stock tracking
- Reservation Model β Booking system with status management
- User Post Model β Lost & found posts with images
- User Token Model β Refresh token management
SFAC_HUB/
βββ backend/
β βββ config/
β β βββ cloudinary.js # Cloudinary configuration
β βββ controllers/
β β βββ admin.controller.js # Admin operations
β β βββ staff.controller.js # Staff operations
β β βββ user.controller.js # User authentication & profile
β β βββ product.controller.js # Product management
β β βββ post.controller.js # Lost & found posts
β βββ middleware/
β β βββ auth.admin.js # Admin authentication
β β βββ auth.staff.js # Staff authentication
β β βββ auth.login.js # Login middleware
β β βββ auth.token.js # Token verification
β βββ models/
β β βββ user.model.js # User schema
β β βββ product.model.js # Product schema
β β βββ product.reservation.model.js # Reservation schema
β β βββ user.post.model.js # Post schema
β β βββ user.token.model.js # Token schema
β βββ routes/
β β βββ admin.route.js # Admin endpoints
β β βββ staff.route.js # Staff endpoints
β β βββ user.route.js # User endpoints
β β βββ protected.route.js # Protected endpoints
β βββ server.js # Express server & Socket.io
β βββ Dockerfile # Container configuration
β βββ fly.toml # Fly.io deployment config
β
βββ frontend/sfac-hub/
βββ src/
β βββ components/
β β βββ Header.tsx # Reusable header with logout
β β βββ Footer.tsx # Reusable footer
β β βββ PerformanceDashboard.tsx # Performance monitoring
β βββ pages/
β β βββ LandingPage.tsx # Public landing page
β β βββ Dashboard.tsx # User dashboard
β β βββ StockAvailability.tsx # Browse items
β β βββ MakeReservation.tsx # Reserve items
β β βββ Reservations.tsx # User reservations
β β βββ LostAndFound.tsx # Lost & found
β β βββ StaffPanel.tsx # Staff control center
β β βββ AdminPanel.tsx # Admin control center
β β βββ About.tsx # About page
β β βββ login/
β β βββ LoginLanding.tsx # Login page
β β βββ RegistrationPage.tsx # Registration
β βββ utils/
β β βββ apiService.ts # API client with token refresh
β β βββ ProtectedLayout.tsx # Protected route wrapper
β β βββ socket.ts # Socket.io client
β β βββ performanceMonitor.ts # Performance tracking
β β βββ imageOptimization.ts # Image optimization
β βββ App.tsx # Main app & routing
β βββ main.tsx # React entry point
βββ vite.config.ts # Vite configuration
βββ tailwind.config.js # Tailwind configuration
βββ vercel.json # Vercel deployment config
- Node.js (v18 or higher)
- MongoDB database
- Cloudinary account (for image uploads)
Backend (.env)
PORT=5000
USERS_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JWT_REFRESH_SECRET=your_refresh_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secretFrontend (.env)
VITE_API_URL=http://localhost:5000- Clone the repository
git clone https://github.com/whenzer/SFAC_HUB.git
cd SFAC_HUB- Install backend dependencies
cd backend
npm install- Install frontend dependencies
cd ../frontend/sfac-hub
npm install- Start development servers
Backend:
cd backend
npm startFrontend:
cd frontend/sfac-hub
npm run dev- Access the application
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
POST /api/user/registerβ Register new userPOST /api/user/loginβ User loginPOST /api/user/logoutβ User logoutPOST /api/user/refreshβ Refresh access token
GET /protected/dashboardβ Get dashboard dataGET /protected/userβ Get user profile
GET /api/staff/reservationsβ Get all reservationsPUT /api/staff/reservations/:id/collectβ Mark as collected
GET /api/admin/usersβ Get all usersPUT /api/admin/users/verify/:userIdβ Verify userPUT /api/admin/users/reset-password/:userIdβ Reset passwordDELETE /api/admin/users/delete/:userIdβ Delete userPOST /api/admin/createproductβ Create new product
- Admin Panel: Pink/Purple gradient (#f093fb β #f5576c)
- Staff Panel: Blue/Purple gradient (#667eea β #764ba2)
- Success: #10b981
- Warning: #f59e0b
- Error: #ef4444
- Info: #3b82f6
- Glassmorphism: Frosted glass effect with backdrop blur
- Card-based Layout: Elevated cards with hover animations
- Gradient Backgrounds: Dynamic multi-layer gradients
- Smooth Transitions: Cubic-bezier easing for all animations
- Responsive Grid: Auto-fit grid layouts for all screen sizes
- Password Hashing: bcrypt with salt rounds
- JWT Tokens: Access tokens (15min) + Refresh tokens (7 days)
- Automatic Token Refresh: Seamless token renewal
- Role-based Middleware: Endpoint protection by role
- Input Validation: Server-side validation for all inputs
- CORS Protection: Whitelisted origins only
- Secure Image Upload: Cloudinary with transformation
cd backend
fly deploycd frontend/sfac-hub
vercel --prodLive URLs:
- Frontend: https://sfac-hub-bq7y.vercel.app
- Backend: https://sfac-hub.fly.dev
| Feature | Student | Teacher | Staff | Admin |
|---|---|---|---|---|
| Browse Stock | β | β | β | β |
| Make Reservations | β | β | β | β |
| Lost & Found | β | β | β | β |
| View Reservations | Own | Own | All | All |
| Collect Items | β | β | β | β |
| Staff Panel | β | β | β | β |
| User Management | β | β | β | β |
| Create Products | β | β | β | β |
| Admin Panel | β | β | β | β |
- β Full authentication system with JWT
- β Role-based access control
- β Stock management and browsing
- β Reservation system with status tracking
- β Lost & found module with image uploads
- β Staff panel with reservation management
- β Admin panel with user management
- β Real-time updates with Socket.io
- β Responsive design for all devices
- β Performance monitoring dashboard
- β Automatic token refresh
- β Cloudinary image integration
- β Production deployment (Fly.io + Vercel)
- π§ Email notifications for reservations
- π± Push notifications for item availability
- π Advanced analytics and reporting
- π¦ Bulk operations for admin
- π Real-time notification system
- π Dark mode toggle
- π₯ Export data to CSV/PDF
- π Advanced search with filters
- π« QR code generation for reservations
- π Inventory forecasting
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- SFAC (School of Future Academy of Cebu)
- React & Vite communities
- MongoDB & Express.js documentation
- Tailwind CSS team
- Cloudinary for image hosting
Built with β€οΈ for SFAC