A comprehensive farm management web application for Farming Simulator 25 players
Track fields, livestock, equipment, and finances with a realistic British farming dashboard
- Track crop growth stages, fertiliser application, and weed states
- Visual field cards with status indicators
Access the app:
http://localhost:3000
- Intelligent 4-year rotation suggestions based on UK farming best practices
- Prevents disease buildup and optimizes soil health
- Season-specific planting recommendations
- Complete income/expense tracking with real-time balance calculations
- Category-based organization (Sales, Purchases, Equipment, etc.)
- Track animal counts by type (Cows, Sheep, Chickens, Pigs)
- Monitor feed requirements and productivity
- Machinery tracking with ownership status (owned/leased)
- Daily cost calculations and condition monitoring
- Role-based access control (Owner, Editor, Viewer)
- Time-limited join codes for farm invitations
# Clone the repository (correct repo name)
git clone https://github.com/Callum-Mason/FS25-Farm-Managment-System.git
cd FS25-Farm-Managment-System
# Install dependencies
npm install
# Create environment file (PowerShell)
Copy-Item .env.example .env
# On macOS / Linux use: cp .env.example .env
# Start the development server
npm run devAccess the app: http://localhost:3000
- Email:
demo@farm.local - Password:
Demo1234!
You can build and run the whole application with Docker Compose. By default the app uses the bundled SQLite database (persisted to ./data), but you can switch to the included PostgreSQL service by setting the appropriate env vars.
PowerShell (from project root):
# Build images (uses Dockerfile in repo root)
docker compose build
# Start services (foreground)
docker compose up
# Start services detached
docker compose up -d
# Stop and remove containers
docker compose downNotes:
- The server will be available at: http://localhost:3000
- If you want to use the bundled Postgres service, copy
.env.sampleto.envand set:
DB_HOST=db
DB_USER=farm
DB_PASSWORD=farm_pass
DB_NAME=farm_manager
- By default the app uses SQLite (no extra config). The SQLite DB file is stored in
./dataon the host (this folder is mounted into the container by the Compose file). - To follow logs for the
appservice:
docker compose logs -f appFS25-Farm-Managment-System/
├── server/ # Backend (Node.js + Express)
│ ├── routes/ # API endpoints
│ ├── middleware/ # Auth & permissions
│ └── database/ # Database adapters & migrations
├── src/ # Frontend (Vue 3 + TypeScript)
│ ├── components/ # Reusable Vue components
│ ├── views/ # Page components
│ ├── stores/ # Pinia state management
│ └── router/ # Vue Router config
└── tests/ # Test suites
# Development
npm run dev # Start dev server with hot reload
# Database
npm run migrate # Run database migrations (auto-detects SQLite/PostgreSQL)
# Building
npm run build # Build frontend and backend for production
npm run build:frontend # Build Vue.js frontend only
npm run build:backend # Compile TypeScript backend only
# Production
npm start # Run production build
# Testing
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:api # Run API tests (test:api)The project uses a unified migration system that works with both SQLite (local) and PostgreSQL (production):
# Run migrations (auto-detects database type)
npm run migrate
# Or run directly
node server/database/migrate.cjs-
What it does:
-
✅ Creates all tables (users, farms, fields, animals, equipment, finances, etc.)
-
✅ Sets up indexes for performance
-
✅ Creates triggers and helper functions
-
✅ Tracks applied migrations to prevent duplicates
-
✅ Safe to run multiple times (idempotent)
For detailed migration documentation, see MIGRATION_GUIDE.md.
Create a .env file in the project root:
# Server Configuration
PORT=3000
NODE_ENV=development
# Authentication
JWT_SECRET=your-random-secret-key-min-32-characters
# Database (SQLite for local development)
DB_FILE=./data/farm_manager.db
# For PostgreSQL (optional local testing)
# DB_HOST=localhost
# DB_PORT=5432
# DB_NAME=farmmanager
# DB_USER=postgres
# DB_PASSWORD=your-password- Hot Module Replacement (HMR) - Instant updates without refresh
- SQLite Database - Zero-config local database
- TypeScript - Full type safety
- Demo Data - Pre-seeded with sample farm data
Deploy your Farm Management System to Azure with automated CI/CD using GitHub Actions. The application will run on:
- Azure App Service (B1 tier) - ~£40/month
- Azure PostgreSQL Flexible Server (B1ms tier) - ~£10/month
- Total cost: ~£50/month
-
Azure Account - Create free account
-
Azure CLI - Install via:
winget install Microsoft.AzureCLI
-
GitHub Account - Your repository must be on GitHub
# Login to Azure
az login
# Set your subscription (if you have multiple)
az account set --subscription "Your-Subscription-Name"
# Clone and navigate to repository
git clone https://github.com/Callum-Mason/FS25-Farm-Managment-System.git
cd FS25-Farm-Managment-System
# Install dependencies
npm install
# Run deployment script
.\deploy-infrastructure.ps1The deployment script will:
- ✅ Create Azure resource group
- ✅ Provision PostgreSQL Flexible Server
- ✅ Set up App Service with Node.js 20
- ✅ Configure environment variables
- ✅ Run database migrations
Note: You'll be prompted for a PostgreSQL admin password. Save this securely!
Your GitHub Actions workflow needs two pieces of information:
- Go to your repository on GitHub
- Navigate to Settings → Secrets and variables → Actions
- Click the Variables tab
- Click New repository variable
- Add:
- Name:
AZURE_WEBAPP_NAME - Value: Your Azure Web App name (e.g.,
fs25fms-app-xxxxx)
- Name:
-
Get your publish profile:
az webapp deployment list-publishing-profiles ` --name YOUR-AZURE-APP-NAME ` --resource-group YOUR-RESOURCE-GROUP ` --xml > publish-profile.xml
-
In GitHub, go to Settings → Secrets and variables → Actions
-
Click the Secrets tab
-
Click New repository secret
-
Add:
- Name:
AZURE_WEBAPP_PUBLISH_PROFILE - Value: Paste the entire contents of
publish-profile.xml
- Name:
-
Important: Delete the local
publish-profile.xmlfile:Remove-Item publish-profile.xml
# Commit your changes (if any)
git add .
git commit -m "Configure deployment"
# Push to GitHub - this triggers deployment
git push origin main- Go to your repository's Actions tab on GitHub
- Watch the "Deploy to Azure" workflow run
- Deployment typically takes 3-5 minutes
Once complete, your app will be live at: https://YOUR-AZURE-APP-NAME.azurewebsites.net
Every time you push to the main branch, GitHub Actions will:
- ✅ Install dependencies
- ✅ Build frontend (Vite)
- ✅ Compile TypeScript backend
- ✅ Deploy to Azure App Service
- ✅ Your app updates automatically
Check application logs:
az webapp log tail --name YOUR-AZURE-APP-NAME --resource-group YOUR-RESOURCE-GROUPRestart the app:
az webapp restart --name YOUR-AZURE-APP-NAME --resource-group YOUR-RESOURCE-GROUPVerify environment variables:
az webapp config appsettings list `
--name YOUR-AZURE-APP-NAME `
--resource-group YOUR-RESOURCE-GROUP `
--output table- Node.js 20 LTS - Runtime environment
- Express.js - Web framework
- PostgreSQL / SQLite - Dual database support
- JWT + bcrypt - Authentication
- Vue 3 - Progressive JavaScript framework
- TypeScript - Type safety
- Pinia - State management
- Vue Router - Navigation
- Tailwind CSS - Utility-first styling
- Vite - Build tool
- GitHub Actions - CI/CD pipeline
- Azure App Service - Hosting (Linux)
- Azure PostgreSQL - Production database
- Azure Key Vault - Secrets management
POST /api/auth/register # Create new account
POST /api/auth/login # Login and get JWT tokenGET /api/farms # List your farms
POST /api/farms # Create new farm
GET /api/farms/:farmId # Get farm details
PATCH /api/farms/:farmId # Update farm
DELETE /api/farms/:farmId # Delete farm (owner only)GET /api/farms/:farmId/fields # List fields
POST /api/farms/:farmId/fields # Create field
PATCH /api/fields/:farmId/:id # Update field
DELETE /api/fields/:farmId/:id # Delete fieldGET /api/farms/:farmId/finances # Get transactions + balance
POST /api/farms/:farmId/finances # Add transaction
DELETE /api/finances/:farmId/:id # Delete transactionAll endpoints (except auth) require:
Authorization: Bearer <jwt-token>- ✅ Password Hashing - bcrypt with 10 rounds
- ✅ JWT Authentication - 7-day token expiry
- ✅ Role-Based Access - Owner, Editor, Viewer permissions
- ✅ SQL Injection Protection - Parameterized queries
- ✅ HTTPS Enforced - In production
- ✅ Environment Variables - Never commit secrets
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Watch mode during development
npm run test:watchTest Coverage:
- ✅ API endpoint tests
- ✅ Authentication & authorization
- ✅ Database operations
- ✅ Vue component tests
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run tests:
npm test - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
This project is provided as-is for personal use.
Built for the Farming Simulator 25 community with ❤️