Logo Lanfrica

autancybirnin123-cloud/student-portal-courses

Domaine:

educationnatural language processing

Type de record:

software
Créateur:
aut
Hôte:
Student portal with book-style bilingual (Hausa/English) courses in coding, computer science, and cybersecurity. Starter scaffold: Next.js (TypeScript) + Tailwind + Supabase (Postgres + Auth) + Cloudinary examples. ### Cloudinary unsigned uploads & Course saving I implemented direct unsigned Cloudinary uploads in the admin editor and added a server API to persist course records to Supabase. What I changed - pages/admin/editor.tsx now uploads the selected cover image directly to Cloudinary using an unsigned upload preset, then calls /api/courses to insert the course record into Supabase. - pages/api/courses.ts accepts a POST with the course payload and an Authorization: Bearer header. It verifies the token (server-side) and inserts the course into the `courses` table. Setup steps (in Hausa) 1. A Cloudinary dashboard, create an "unsigned" Upload Preset: - Dashboard → Settings → Upload → Upload presets → Add upload preset - Name it misali: student_portal_unsigned (ko wani suna da kake so) - Make it unsigned and optionally restrict folder, file size, and formats. 2. A .env.local (ba a turawa Git): - NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloud_name - NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET=student_portal_unsigned - NEXT_PUBLIC_SUPABASE_URL=... - NEXT_PUBLIC_SUPABASE_ANON_KEY=... - SUPABASE_SERVICE_ROLE_KEY=... (server-only) 3. Run the app and sign in (/auth/register). Then /admin/editor zai iya yin upload da adana course. Security note (Hausa) - Unsigned preset ba ta buƙatar CLOUDINARY_API_SECRET a server, amma kar ka yi preset ɗin public ba tare da ƙayyade iyaka ba. Tabbatar ka sa girman fayil (max size) da takamaiman extensions daga Cloudinary dashboard. Idan kana so in yi wannan a madadin signed uploads, in yi server endpoint na signature kuma in sabunta editor — faɗa "B" kuma zan aiwatar.