A comprehensive web-based church management system built with pure Lua and SQLite. This application provides a complete RESTful API for managing church operations with 100% test coverage and robust functionality.
โ Completed Features:
โ Not Implemented:
luarocks install luasql-sqlite3
luarocks install lua-cjson
luarocks install luasocket
Run Tests (Verify everything works):
lua run_tests.lua
Run Simple Demo (See basic functionality):
lua simple_demo.lua
Test API Endpoints:
lua api_test.lua
Start Demo Server (With sample data):
lua start_demo_server.lua
Start Production Server:
./start.sh
The system includes a comprehensive test suite with 100% pass rate:
# Run all tests
lua run_tests.lua
# Expected output:
# Total: 85
# Passed: 85
# Success rate: 100.0%
Test Coverage:
./build.sh
This will create a distributable package at dist/church-management-<version>.tar.gz
and build a Docker image.
./build.sh --help
Common options:
--version VALUE
: Set version number--env VALUE
: Set environment (default: production)--no-docker
: Skip Docker image building--docker-tag VALUE
: Set Docker tag--push-docker
: Push Docker image to registry--docker-registry URL
: Set Docker registry URLdocker-compose -f docker-compose.production.yml up -d
This will start the application in a Docker container with persistent storage.
GET /health
- Health checkGET /members
- List all membersPOST /members
- Create a new memberGET /members/{id}
- Get a member by IDPUT /members/{id}
- Update a memberDELETE /members/{id}
- Delete a memberGET /tithes
- List all tithesPOST /tithes
- Create a new titheGET /tithes/{id}
- Get a tithe by IDPUT /tithes/{id}
- Update a titheDELETE /tithes/{id}
- Delete a tithePOST /tithes/{id}/pay
- Mark a tithe as paidGET /members/{id}/tithes
- Get all tithes for a memberGET /members/{id}/tithe-calculation
- Calculate tithe amount for a memberPOST /tithes/generate-monthly
- Generate monthly tithes for all members# Health check
curl http://localhost:8080/health
# Create a member with salary
curl -X POST http://localhost:8080/members \
-d "name=John Doe" \
-d "[email protected]" \
-d "phone=1234567890" \
-d "salary=5000"
# List all members
curl http://localhost:8080/members
# Calculate tithe for a member (10% of salary)
curl http://localhost:8080/members/1/tithe-calculation
# Generate monthly tithes for all members
curl -X POST http://localhost:8080/tithes/generate-monthly \
-d "month=5" \
-d "year=2025"
# Mark a tithe as paid
curl -X POST http://localhost:8080/tithes/1/pay \
-d "payment_method=Cash" \
-d "notes=Paid on Sunday service"
This project uses GitHub Actions for continuous integration and deployment. The pipeline includes:
luacheck
develop
branchmain
branchv1.0.0
) is createdCreate and push a new tag following semantic versioning:
git tag v1.0.0
git push origin v1.0.0
The CI/CD pipeline will automatically:
For the CI/CD pipeline to work, you need to set up the following secrets in your GitHub repository:
SONAR_TOKEN
: SonarCloud token for code quality analysisDEPLOY_USERNAME
: SSH username for deploymentDEPLOY_KEY
: SSH private key for deploymentDEPLOY_PORT
: SSH port for deployment (usually 22)STAGING_HOST
: Hostname/IP for staging serverPRODUCTION_HOST
: Hostname/IP for production serverFor detailed SonarQube setup instructions, see docs/SONARQUBE_SETUP.md.
For security scanning to work properly, you need to enable GitHub Advanced Security features:
Note: GitHub Advanced Security is free for public repositories but requires GitHub Enterprise for private repositories.
MIT