|
| 1 | +#DFSM Analyzer: Visual DFA Simulator & Verifier : |
| 2 | +A full-stack web application that allows users to define a**Deterministic Finite State Machine (DFA)**, simulate input strings against it, and generate a**visual PDF representation** of the DFA. Built using**Angular** and**FastAPI**, with DFA logic powered by`automata-lib` and Graphviz. |
| 3 | + |
| 4 | +##🚀 Features |
| 5 | +- Define DFA (states, alphabet, transitions, start/accept states) |
| 6 | +- Input a string and check if it's accepted |
| 7 | +- Visualize the DFA structure as a downloadable PDF |
| 8 | +- Practical tool for automata theory |
| 9 | + |
| 10 | +##🛠️ Tech Stack |
| 11 | +Frontend: Angular 17+ |
| 12 | +Backend: FastAPI (Python 3.10+) |
| 13 | +DFA logic: automata-lib v1.0.0 |
| 14 | +Visualization: graphviz |
| 15 | + |
| 16 | +##📂 Project Structure |
| 17 | +project-root/ |
| 18 | +│ |
| 19 | +├── Angular_frontend/ # Angular UI app (DFSM form, results) |
| 20 | +├── backend/ # FastAPI app (DFA logic + PDF generation) |
| 21 | +│ └── utils/ |
| 22 | +│ └── visualize.py # Graphviz DFA rendering logic |
| 23 | +└── pdf/ # Output folder for DFA PDFs |
| 24 | + |
| 25 | +##🧑💻 Installation |
| 26 | +##Backend: |
| 27 | +1. Navigate to backend: |
| 28 | + cd backend |
| 29 | + |
| 30 | +2. Create and activate virtual environment: |
| 31 | + python -m venv venv |
| 32 | + source venv/bin/activate # On Windows: venv\Scripts\activate |
| 33 | + |
| 34 | +3. Install dependencies: |
| 35 | + pip install -r requirements.txt |
| 36 | + |
| 37 | +4. Install Graphviz (Required for PDF output): |
| 38 | + Linux/macOS: |
| 39 | + sudo apt install graphviz |
| 40 | + Windows: |
| 41 | + Download fromhttps://graphviz.org/download/ |
| 42 | + |
| 43 | +5. Run the FastAPI server: |
| 44 | + uvicorn main:app --reload |
| 45 | + |
| 46 | +##Frontend: |
| 47 | +1. Navigate to frontend folder: |
| 48 | + cd Angular_frontend |
| 49 | + |
| 50 | +2. Install dependencies: |
| 51 | + npm install |
| 52 | + |
| 53 | +3. Run the frontend app: |
| 54 | + ng serve |
| 55 | + |
| 56 | +Visit:http://localhost:4200 |
| 57 | + |
| 58 | +##🧱 Dependencies: |
| 59 | +Backend (requirements.txt): |
| 60 | +fastapi==0.111.0 |
| 61 | +uvicorn==0.30.1 |
| 62 | +automata-lib==1.0.0 |
| 63 | +graphviz==0.20.3 |
| 64 | +pydantic==2.7.1 |
| 65 | + |
| 66 | +Frontend (Angular v17+): |
| 67 | +Angular CLI v17 |
| 68 | +RxJS v7+ |
| 69 | +TypeScript v5+ |
| 70 | + |
| 71 | +##🙌 Author |
| 72 | +Mohammed Basith |
| 73 | +📫 LinkedIn:www.linkedin.com/in/mohammed-basith-97326321b |
| 74 | + |
| 75 | + |
| 76 | + |