Skip to content

Commit d3c863c

Browse files
author
Emre Camkerten
committed
Add local storage checks for API keys in AppLayout and document Django admin panel setup
1 parent 15367c8 commit d3c863c

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Tezrisat_Frontend/tezrisat_frontend/src/components/AppLayout.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ const AppLayout = ({ children }: { children: ReactNode }) => {
3939
}
4040
} catch (error) {
4141
console.error("Error checking API key status:", error);
42+
const localOpenai = window.localStorage.getItem("tezrisat.openai_key");
43+
const localSerpapi = window.localStorage.getItem("tezrisat.serpapi_key");
44+
if (!localOpenai || !localSerpapi) {
45+
setRequiredMissing({
46+
openai: !localOpenai,
47+
serpapi: !localSerpapi,
48+
});
49+
setIsKeysModalOpen(true);
50+
}
4251
}
4352
};
4453

docs/setup.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,25 @@ Frontend:
116116
- Port 5173 in use: `npm run dev -- --port 5174`
117117
- API connection errors: ensure backend is running and CORS is enabled
118118

119+
## Django Admin Panel
120+
121+
1. Create an admin user:
122+
123+
```bash
124+
cd Tezrisat_Backend
125+
python manage.py createsuperuser
126+
```
127+
128+
2. Start the backend:
129+
130+
```bash
131+
python manage.py runserver
132+
```
133+
134+
3. Open `http://localhost:8000/admin` and sign in.
135+
136+
From there you can inspect microcourses, sections, glossary terms, quizzes, and recall notes.
137+
119138
## Next Steps
120139

121140
- See [docs/api.md](api.md) for API overview.

0 commit comments

Comments
 (0)