FacilityOps is a comprehensive, production-ready web-based facility management application. It is designed to handle ticketing, asset tracking, preventive maintenance scheduling, staff allocation, vendor management, inventory tracking, incident reporting, document storage, project management, and utility tracking.
Additionally, FacilityOps integrates an AI Brain to help facility managers quickly analyze trends, prioritize incidents, evaluate staff performance, and optimize maintenance costs.
- Dashboard & Analytics: Get a bird's-eye view of open tickets, critical incidents, and pending tasks.
- Ticketing System: Report, assign, track, and resolve facility issues efficiently.
- Asset Management: Track critical infrastructure, monitor service schedules, and manage AMC renewals.
- Staff & Vendor Management: Monitor team performance and manage vendor contracts.
- Preventive Maintenance: Schedule and track regular maintenance tasks.
- AI Brain Module: A built-in AI assistant that uses OpenAI to analyze facility data and provide actionable recommendations.
- Progressive Web App (PWA): Installable on mobile devices with offline capabilities and native-like experiences.
- Frontend: Next.js 14 (App Router), React 18, Tailwind CSS
- Backend/API: Netlify Functions (
/.netlify/functions/*) - Database: Local SQLite database using
sql.js(Multi-tenant SaaS capable)
- Node.js (v18 or higher recommended)
npm
-
Clone the repository:
git clone <repository-url> cd facilityops
-
Install dependencies:
npm install
-
Configure Environment Variables: Create a
.env.localfile in the root directory and set theJWT_SECRET:echo "JWT_SECRET=supersecret" > .env.local
(Note: Replace
supersecretwith a secure random string in production) -
Initialize the Database (Important!): The application uses a local SQLite database file (
facilityops.db). To create the multi-tenant SaaS schema and populate it with the default login accounts, run the following scripts in order:cat db/schema.sql | sqlite3 facilityops.db npm run db:migrate-saas npm run db:seedDefault Accounts:
- Facility Manager:
keerthi/facility123 - Technician:
rajan/electrician123 - Management:
management/admin123 - Platform Admin:
admin/admin(must change password on first login)
- Facility Manager:
-
Run the Development Server: FacilityOps relies on Netlify Functions for its backend API. You must use the Netlify CLI to run both the Next.js frontend and the functions simultaneously:
npx netlify dev
Open the Local server URL (typically
http://localhost:8888) in your browser to view the application.
The AI Brain uses the OpenAI API to analyze data. For the module to work, you must provide your own OpenAI API Key.
How to set up the AI Brain:
- Log in to the application as an Administrator or Facility Manager (e.g., using the
keerthiaccount). - Navigate to the Settings module from the sidebar.
- Click on the AI Brain tab.
- Enter your OpenAI API Key (
sk-...) in the provided input field. - Click Save AI Key.
The key is securely stored in the server's tenant settings database and will be used by the backend functions to process all AI queries securely. It is not exposed to the client browser.
FacilityOps is optimized to be deployed on Netlify.
- Connect your GitHub repository to Netlify.
- Ensure you have set the
JWT_SECRETenvironment variable in your Netlify site settings. - Netlify will automatically detect the Next.js framework and configure the build settings.
- Ensure the Build Command is set to
npm run buildand the Publish Directory is set toout(or.nextdepending on export configuration). - Deploy the site!
(Note: The default database is a local file facilityops.db. In a true serverless production environment, you should migrate the database connection logic in netlify/functions/lib/db.js to use an external managed PostgreSQL provider since serverless functions are ephemeral.)
If you encounter any issues, please refer to the documentation or contact support.