A comprehensive full-stack Ramadan companion application with secure authentication and role-based access control. This is a secure, production-ready architecture. All user credentials are managed server-side with industry-standard password hashing.
- RESTful API with secure authentication
- Password hashing using
werkzeug.security(PBKDF2-SHA256) - PostgreSQL for production / SQLite for development
- User credentials stored encrypted in database
- Role-based access control (RBAC)
- Modern UI with signals and computed properties
- HTTP-only communication with backend
- No credentials stored in frontend code
- LocalStorage for auth state only
- Password Hashing: All passwords stored using PBKDF2-SHA256
- Backend Authentication: Login verification happens on server
- Secure User Creation: Auto-generated secure passwords
- No Plain-Text Storage: Passwords never stored in plain text
- API-Only User Management: All user CRUD operations through backend
- CORS Protection: Configured for specific origins
- Add JWT tokens for stateless authentication
- Implement rate limiting for login endpoints
- Add HTTPS/TLS encryption
- Use environment-based CORS origins
- Implement session timeout
- Add audit logging for security events
deplyment/
βββ backend/
β βββ app.py # Flask app with secure endpoints
β βββ models.py # SQLAlchemy models
β βββ requirements.txt # Python dependencies
β βββ .env # Environment variables (excluded from git)
β βββ instance/
β βββ qareeb.db # SQLite database (excluded from git)
βββ frontend/
β βββ src/
β β βββ app.component.ts
β β βββ components/ # UI components
β β βββ services/
β β β βββ data.service.ts # API communication
β β β βββ auth.service.ts # Secure authentication
β β βββ environments/
β β βββ environment.ts # Dev config
β β βββ environment.prod.ts # Prod config
β βββ angular.json
β βββ package.json
β βββ tsconfig.json
βββ .gitignore
## π Getting Started
### **Prerequisites**
- Python 3.8+
- Node.js 18+
- PostgreSQL (for production) or SQLite (auto-configured for dev)
### **Backend Setup**
1. **Navigate to backend directory**
```bash
cd backend
-
Create virtual environment
python -m venv venv .\venv\Scripts\activate # Windows # source venv/bin/activate # Linux/Mac
-
Install dependencies
pip install -r requirements.txt
-
Configure environment (Optional - defaults to SQLite)
# Edit .env file DATABASE_URL=postgresql://user:password@localhost:5432/qareeb SECRET_KEY=your-secret-key-here -
Run backend server
python app.py
β Default admin user created automatically:
- Username:
qareeb.admin@duck.com - Password:
QareebCommunitySuperAdmin@2026
- Username:
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install --legacy-peer-deps
-
Run development server
npm run dev
-
Access application
- Open browser to:
http://localhost:3000 - Admin panel:
http://localhost:3000/#/admin
- Open browser to:
POST /api/login- Secure login with password verification
GET /api/admin/users- Get all usersPOST /api/admin/users- Create new userDELETE /api/admin/users/<id>- Delete userPOST /api/admin/users/<id>/reset-password- Reset password
GET /api/events- Get all eventsPOST /api/events- Create eventPUT /api/events/<id>- Update eventDELETE /api/events/<id>- Delete event
GET /api/catering- Get all servicesPOST /api/catering- Create servicePUT /api/catering/<id>- Update serviceDELETE /api/catering/<id>- Delete service
GET /api/markaz- Get all updatesPOST /api/markaz- Create updatePUT /api/markaz/<id>- Update markazDELETE /api/markaz/<id>- Delete markaz
POST /api/requests- Submit public requestGET /api/admin/requests- Get pending requests (admin)POST /api/admin/approve/<id>- Approve request (admin)
- super: Full system access
- event_manager: Manage events
- catering_manager: Manage catering services
- markaz_manager: Manage markaz updates
- alert_viewer: View alerts/requests
- Stores admin users with hashed passwords
- Supports multiple roles per user
- City-level access scoping
- Religious and community events
- Catering services with tags (JSON)
- City-specific listings
- Jamaat updates and announcements
- Public submissions pending approval
- Update
DATABASE_URLto PostgreSQL connection string - Set strong
SECRET_KEY - Configure SMTP credentials
- Enable production mode in Flask
- Use a WSGI server (Gunicorn/uWSGI)
- Update
environment.prod.tswith production API URL - Build:
npm run build - Deploy
dist/folder to static hosting
**Developed by Thousif ibrahim