Set up your institution, step by step. Start here.

How to Build Your Own Student Website with create-course37-app

One command creates a complete Next.js student website on your own domain — your pages, theme, courses and student accounts from Course37, in open-source code you can change.


Course37 hosts a student website for you. If you want one you fully control — your own code, design and hosting — create it with create-course37-app. One command gives you a complete Next.js website that looks like your Course37 site from the first minute. Your developer can then change anything.

The code is open source (MIT licence): github.com/Shaitrish/course37-js.


What You Get

Page Address What it shows
Home / Your Course37 home page: its sections, header, footer, notification bar and chat button
Custom pages /[slug] Any page built in the Website Editor, such as /about or /privacy-policy
Course catalog /courses Your Courses Page, or every course in your home page's card style
Course details /course/[slug] Your Course Details Page layout, with price, enroll card and teachers
Sign in, sign up, reset password /login Your Login Page style; codes arrive by SMS or email
Student dashboard /dashboard Your Student Dashboard sections and sidebar settings
Course home /dashboard/[course] Modules, recent videos, live classes and self-paced progress
Videos, PDFs, embeds /dashboard/[course]/videos … The player, with resume and watch progress
Exams, live classes /dashboard/[course]/exams, /live Listed here; taken or joined on your Course37 site
Syllabus /dashboard/[course]/course-plan Subjects, chapters and topics
Self-paced lessons /learn/[course]/[lesson] Lesson blocks, Mark as complete, previous and next
Profile /profile Details, signed-in devices (sign out the others) and payments

A few things open on your Course37 site, where the student signs in with the same account: checkout and paying dues; taking exams and assignments; joining live classes; certificates, orders and the community.


Before You Start

In Integrations → Developer API (see Set Up the Developer API):

  1. Create a Publishable (pk_) key.
  2. Under Allowed websites, add http://localhost:3000 for building, and your live address, such as https://learn.your-school.com.
  3. Under Your own website, choose Headless. In Hybrid mode the public pages work, but student sign-in and the student area need Headless.
  4. In the Website Editor, publish your home page. Its slug must be home.

Your developer needs Node.js 20.9 or newer.


Create the Website

  1. Run:

    npx create-course37-app my-school-site
    

    pnpm create course37-app, yarn create course37-app and bun create course37-app work too.

  2. Answer the questions:

    • Course37 API URL — press Enter to use https://api.course37.com.
    • Publishable key (pk_live_... or pk_test_...) — paste your key. The command checks it and shows Key accepted for [your organization].
    • Your site's public URL — your live address, used for SEO links. Press Enter to use http://localhost:3000 if you don't know it yet.
  3. The command copies the website into the folder, saves your settings in .env.local and installs everything. Then start it:

    cd my-school-site
    npm run dev
    
  4. Open http://localhost:3000.

To create a site without questions, for example in a script:

npx create-course37-app my-school-site --yes \
  --key pk_live_... --site-url https://learn.my-school.com

Make It Yours

Everything is ordinary Next.js code, so anything can change.

To change Edit
Colours, fonts and corner radius on every page Theme in Course37 (applied automatically), or the design tokens in app/globals.css
Page content and section order The Course37 Website Editor — the site shows what you publish
How one kind of section looks components/sections/section-map.tsx — point that section at your own component
Header, footer, notification bar components/site/
Sign-in screens and their text components/auth/login-form.tsx
Student sidebar and pages components/student/, components/modules/, components/lesson/
Video player components/player/
New pages app/(site)/ for public pages, app/(student)/ for signed-in pages

What you publish in Course37 shows up on the site within a minute.


Put It Online

Any host that runs Next.js works: Vercel, Netlify, your own Node.js server or Docker.

  1. Set these variables in your host's settings. Their values are in .env.local:
Variable Value
NEXT_PUBLIC_C37_API_URL https://api.course37.com
NEXT_PUBLIC_C37_PUBLISHABLE_KEY Your publishable key — safe in the browser
NEXT_PUBLIC_SITE_URL Your site's live address
C37_REVALIDATE_SECONDS How often pages re-read Course37, in seconds (default 60)
  1. Add the live address to Allowed websites.
  2. Use HTTPS: the sign-in cookies are marked Secure there.

Optional: C37_SECRET_KEY. A secret key in this server-only variable gives student sign-in its own request limit. Never put a secret key in a variable that starts with NEXT_PUBLIC_ — those are sent to every visitor's browser.


How Sign-In Stays Safe

Sign-in goes through your website's own server (app/api/course37/). The long-lived sign-in token stays in a cookie that page scripts can't read, and the browser only holds an access token that lasts 15 minutes. The device limit works as it does on your Course37 site, and students can see and sign out their other devices on Profile.


Current Limits

  • Theme: the background tone and custom CSS you set in Course37 are not applied yet.
  • Course pages: there's no reviews list.
  • Dashboard: Today & Upcoming is empty, and course access links (group, Zoom …) are not shown.
  • Language: the website's own text is in English. Your developer can translate it in the components.

Troubleshooting

What you see What to do
Course37 did not accept this key: invalid_api_key Copy the key again from Developer API — it may have been deleted, disabled or rotated
Course37 did not accept this key: api_disabled Under Your own website, choose Hybrid or Headless
… is not the Course37 API Check the API URL: https://api.course37.com
The home page is empty Publish your home page in the Website Editor, with the slug home
Student sign-in is not switched on for this website yet Under Your own website, choose Headless
Only student accounts can sign in here Admin and teacher accounts can't sign in on this website — use a student account
The site works on your computer but the student area fails on the live address Add the live address to Allowed websites, exactly as the browser shows it
A change made in Course37 isn't on the site yet Wait a minute — pages re-read Course37 every C37_REVALIDATE_SECONDS

Related: Set Up the Developer API · Use the Course37 JavaScript SDK · Customize the Student Dashboard & Course Pages · Customize Theme and Branding

#own website #headless #starter site #create-course37-app #next.js #open source #custom domain #deploy