Skip to content

elmgdad/MyLessonPal

 
 

Repository files navigation

MyLessonPal (Create classroom resources in seconds)

This is a generative AI tool for teachers and professors.

Live Demo

Usage Dataset [Most Recent 10,000+ Generations]

Overview

Stack

The stack is based on the AI Getting Started Stack:

Quickstart

The following instructions should get you up and running with a fully functional, local deployment of MyLessonPal, ready to generate resources right out the gate.

1. Fork and Clone repo

Fork the repo to your Github account, then run the following command to clone the repo:

git clone git@github.com:[YOUR_GITHUB_ACCOUNT_NAME]/MyLessonPal.git

2. Install dependencies

cd MyLessonPal
npm install

3. Fill out secrets

cp .env.local.example .env.local

Secrets mentioned below will need to be copied to .env.local

a. Clerk Secrets

Go to https://dashboard.clerk.com/ -> "Add Application" -> Fill in Application name/select how your users should sign in -> Create Application Now you should see both NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY on the screen Screen Shot 2023-07-10 at 11 04 57 PM

If you want to text your AI companion in later steps, you should also enable "phone number" under "User & Authentication" -> "Email, Phone, Username" on the left hand side nav:

Screen Shot 2023-07-10 at 11 05 42 PM

b. OpenAI API key

Visit https://platform.openai.com/account/api-keys to get your OpenAI API key if you're using OpenAI for your language model.

c. Upstash API key

  • Sign in to Upstash

  • Under "Redis" on the top nav, click on "Create Database"

  • Give it a name, and then select regions and other options based on your preference. Click on "Create" Screen Shot 2023-07-10 at 11 06 36 PM

  • Scroll down to "REST API" section and click on ".env". Now you can copy paste both environment variables to your .env.local Screen Shot 2023-07-10 at 11 07 21 PM

4. Run app locally

Now you are ready to test out the app locally! To do this, simply run npm run dev under the project root.

You can connect to the project with your browser typically at http://localhost:3000/.

5. Deploy the app

Deploy to fly.io

  • Register an account on fly.io and then install flyctl

  • If you are using Github Codespaces: You will need to install flyctl and authenticate from your codespaces cli by running fly auth login.

  • Run fly launch under project root. This will generate a fly.toml that includes all the configurations you will need

  • Run fly scale memory 512 to scale up the fly vm memory for this app.

  • Run fly deploy --ha=false to deploy the app. The --ha flag makes sure fly only spins up one instance, which is included in the free plan.

  • For any other non-localhost environment, the existing Clerk development instance should continue to work. You can upload the secrets to Fly by running cat .env.local | fly secrets import

  • If you are ready to deploy to production, you should create a prod environment under the current Clerk instance. For more details on deploying a production app with Clerk, check out their documentation here. Note that you will likely need to manage your own domain and do domain verification as part of the process.

  • Create a new file .env.prod locally and fill in all the production-environment secrets. Remember to update NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY by copying secrets from Clerk's production instance -cat .env.prod | fly secrets import to upload secrets.

How to contribute to this repo

Code contribution workflow

You can fork this repo, make changes, and create a PR. Add **@bvergara87 as a reviewer.

If you are new to contributing on github, here is a step-by-step guide:

  1. Click on Fork on the top right of this page

  2. Work on your change and push it to your forked repo. Now when you navigate to the forked repo's UI, you should see something like the following: pr-preview

  3. Click on "Contribute" -> "Open Pull Request".

  4. Once you have a PR, you can add reviewers.

Other contributions

Feel free to open feature requests, bug reports etc under Issues.

About

Create classroom resources in seconds.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.1%
  • JavaScript 3.9%
  • Dockerfile 2.9%
  • CSS 1.1%