Both servers are now running:
- URL: http://localhost:5173
- Status: ✅ Running
- Technology: React with Vite
- URL: http://localhost:5000
- Status: ✅ Running
- Technology: Express.js
-
Open your browser and go to: http://localhost:5173
-
Ask any question about:
- Tenant rights (rent, eviction, deposits)
- Housing discrimination
- Legal regulations
- Or any other legal question
-
Get comprehensive answers with:
- Clear Yes/No/It Depends answers
- Detailed explanations
- Actionable steps
- Links to authoritative sources
- "Can my landlord raise my rent?"
- "Can I be evicted without notice?"
- "Can I be discriminated against in housing?"
- "What are my rights regarding security deposits?"
- "Can my landlord inspect my apartment?"
- User enters a question on the home page
- Frontend sends request to the backend API
- Backend searches knowledge base for matching keywords
- Backend returns comprehensive answer with sources
- Frontend displays answer with formatting and links
server.js- Backend Express server with knowledge basesrc/pages/Home.jsx- Question input pagesrc/pages/Answer.jsx- Answer display pagesrc/components/Header.jsx- Reusable header component
curl -X POST http://localhost:5000/api/answer \
-H "Content-Type: application/json" \
-d '{"question":"Can my landlord raise my rent?"}'In the terminal where npm is running:
- Press
Ctrl + Cto stop both services
Edit the legalKnowledgeBase in server.js:
"keyword": {
answer: "Yes/No/It Depends",
explanation: "Your explanation here...",
actions: ["Action 1", "Action 2"],
sources: [
{ title: "Source Name", url: "https://..." }
]
}Then restart the server for changes to take effect.
Q: "Failed to fetch answer" error? A: Make sure both frontend and backend are running. Check:
- Backend running on http://localhost:5000
- Frontend running on http://localhost:5173
Q: Port already in use?
A: Change the port in .env or use npm run dev and npm run server separately with different ports
Q: CORS error? A: The backend has CORS enabled. Ensure frontend and backend can communicate.
Your "Is This Allowed?" application is fully functional!
Visit: http://localhost:5173 to start using it.