Professional line balancing app for textile production lines. Run MTE, SPT, and RPW methods, generate KPIs, and deliver PDF reports to clients.
- Client space: register/login, upload Excel, run balancing, download PDF, delete runs.
- Admin space: list users/jobs, retry jobs, resend reports, delete clients.
- Email verification and password reset by email.
- SMTP delivery of PDF reports.
- Max 10 runs per client (configurable).
- Backend: FastAPI, Motor (MongoDB), Celery, Redis
- Frontend: React, Vite, Recharts
- Storage: MongoDB Atlas (or local MongoDB)
- Copy
.env.exampleto.env. - Set at minimum:
MONGO_URIJWT_SECRETADMIN_EMAILandADMIN_PASSWORDFRONTEND_BASE_URL=http://localhost:5173
- Optional: SMTP settings (see below).
- Run:
docker compose up --build
URLs:
- Frontend:
http://localhost:5173 - API health:
http://localhost:8000/api/health
This repo publishes Docker images to GitHub Container Registry via GitHub Actions.
Images:
ghcr.io/<owner>/<repo>-apighcr.io/<owner>/<repo>-frontend
Triggers:
- Push to
main - Tag
v* - Manual run (Actions tab)
Notes:
- In GitHub: Settings → Actions → Workflow permissions → set Read and write.
- The frontend image runs Vite dev server. Provide
VITE_API_URLat runtime.
Example (local run):
docker pull ghcr.io/<owner>/<repo>-api:latest
docker run --rm -p 8000:8000 --env-file .env ghcr.io/<owner>/<repo>-api:latest
# frontend (set API URL)
docker pull ghcr.io/<owner>/<repo>-frontend:latest
docker run --rm -p 5173:5173 -e VITE_API_URL=http://localhost:8000 ghcr.io/<owner>/<repo>-frontend:latest
Required:
MONGO_URIJWT_SECRET
Optional but recommended:
ADMIN_EMAIL,ADMIN_PASSWORD(seed admin at startup)FRONTEND_BASE_URL(used in email links)EMAIL_VERIFICATION_REQUIRED=true|falseEMAIL_VERIFY_EXPIRES_HOURS=24PASSWORD_RESET_EXPIRES_MINUTES=60MAX_CLIENT_JOBS=10
SMTP (optional):
SMTP_ENABLED=trueSMTP_HOST,SMTP_PORTSMTP_USER,SMTP_PASSWORDSMTP_FROMSMTP_USE_TLS=true(default) orSMTP_USE_SSL=true
The frontend reads VITE_API_URL.
- Docker: set in
docker-compose.ymlunderfrontend.environment - Local dev: create
frontend/.envwith:
VITE_API_URL=http://localhost:8000
Note: VITE_API_BASE_URL is not used.
- Register a client account.
- A verification email is sent if SMTP is enabled.
- The client must verify before logging in or running jobs.
- You can resend verification from the client login screen.
Links use:
FRONTEND_BASE_URL + "?verify=TOKEN"
If you open the link on another device, do not use localhost. Use your PC IP or a public domain.
- Use "Forgot password" in the client space.
- A reset email is sent if SMTP is enabled.
- Opening the link shows the reset form.
Links use:
FRONTEND_BASE_URL + "?reset=TOKEN"
- At least 8 characters
- At least 1 uppercase, 1 lowercase, 1 symbol
- Max 72 bytes (bcrypt limit)
- Each client can store up to
MAX_CLIENT_JOBSruns (default 10). - Delete old runs to free space (client UI provides Delete).
Backend:
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --app-dir .
Worker (Celery):
cd backend
celery -A app.core.celery_app:celery_app worker --loglevel=info
Frontend:
cd frontend
npm install
npm run dev
Failed to fetch (verify/reset):
- Check API:
http://localhost:8000/api/health - Confirm
VITE_API_URLpoints to the API - Avoid mixed http/https
- If using another device, replace
localhostwith PC IP or domain
Gmail SMTP 535:
- Enable 2FA and create an app password
- Use the app password in
SMTP_PASSWORD
Research notebooks and previous scripts are kept in the repo (MTE*.ipynb, app_replit.py, etc.). The current app is the FastAPI + React stack described above.