DevMind is a full-stack AI coding assistant built with a static frontend, a FastAPI backend, MongoDB for persistence, and Groq for model inference.
The app supports:
- User registration and login with JWT auth
- Persistent chat sessions
- Multiple agent modes:
explain,debug,doc,test, andauto - Usage statistics by mode
- Frontend: HTML, CSS, vanilla JavaScript
- Backend: FastAPI
- Database: MongoDB
- AI provider: Groq
- Auth: JWT + bcrypt
Devmind/
├─ frontend/
│ ├─ index.html
│ ├─ style.css
│ └─ app.js
├─ backend/
│ ├─ main.py
│ ├─ config.py
│ ├─ requirements.txt
│ ├─ db/
│ │ └─ database.py
│ ├─ middleware/
│ │ └─ auth.py
│ ├─ models/
│ │ └─ schemas.py
│ └─ routes/
│ ├─ auth.py
│ ├─ chat.py
│ └─ sessions.py
└─ readme.md
- Register a new user
- Log in and receive a JWT token
- Fetch current user profile and usage stats
explain: explain code and conceptsdebug: find bugs and suggest fixesdoc: generate docs and docstringstest: generate testsauto: generate scripts and automation workflows
- Sessions are stored in MongoDB
- Messages are stored per session
- Usage logs track tokens and mode usage
Base URL:
http://localhost:8000/api
Key endpoints:
POST /auth/registerPOST /auth/loginGET /auth/meGET /sessionsPOST /sessionsGET /sessions/{session_id}PATCH /sessions/{session_id}DELETE /sessions/{session_id}POST /chatGET /chat/statsGET /health
Interactive docs:
http://localhost:8000/api/docs
Create a .env file for the backend or export these in your shell:
MONGODB_URL=mongodb://127.0.0.1:27017
DB_NAME=devmind
MONGODB_TIMEOUT_MS=5000
JWT_SECRET=change_this_in_production
JWT_ALGORITHM=HS256
JWT_EXPIRE_DAYS=7
GROQ_API_KEY=your_groq_api_key
GROQ_MODEL=llama-3.3-70b-versatile
ENVIRONMENT=development
FRONTEND_URL=*Notes:
GROQ_API_KEYis required for chat replies.- The current backend defaults already point to
mongodb://127.0.0.1:27017.
From the project root:
python -m venv .venv
.venv\Scripts\activate
pip install -r backend\requirements.txtStart the API:
python -m uvicorn backend.main:app --host 127.0.0.1 --port 8000 --reloadAlternative:
python backend\main.pyThe backend requires a running MongoDB instance on port 27017.
If MongoDB is installed as a Windows service:
sc.exe start MongoDBIf the service is unavailable, run MongoDB manually:
mkdir .mongo-data
mkdir .mongo-log
"C:\Program Files\MongoDB\Server\8.2\bin\mongod.exe" --dbpath "C:\path\to\Devmind\.mongo-data" --logpath "C:\path\to\Devmind\.mongo-log\mongod.log" --bind_ip 127.0.0.1 --port 27017If startup fails, the backend now returns a clearer MongoDB connection error instead of hanging indefinitely.
The frontend is static and expects the backend at:
http://localhost:8000/api
You can open frontend/index.html directly, but using a simple static server is better for browser behavior.
Example with Python:
cd frontend
python -m http.server 5500Then open:
http://localhost:5500
The UI shows a demo login hint:
test@devmind.ai / password123
That account is not seeded automatically by the backend. Create it first through registration if you want to use those exact credentials.
- The frontend authenticates against the FastAPI backend.
- The backend stores users, sessions, messages, and usage logs in MongoDB.
- Chat requests are routed through the selected mode prompt.
- The backend sends the prompt and recent history to Groq.
- The response is saved and returned to the frontend.
- Auth uses
HTTPBearertokens. - Passwords are hashed with
bcryptthroughpasslib. - Rate limiting is enabled through
slowapi. - Session titles are auto-generated from the first message when a chat starts.
- The frontend uses plain JavaScript and does not require a build step.
Check:
- MongoDB is running on
127.0.0.1:27017 - The backend terminal has no startup exception
- Port
8000is free
Make sure:
- MongoDB is installed
- The MongoDB service is running, or
mongod.exeis running manually MONGODB_URLmatches the server bind address
Check:
GROQ_API_KEYis set- Your Groq model name is valid
- Outbound network access is available
No license file is currently included in this repository.