Skip to content

charzlwebz256/SmartLearn

Repository files navigation

SmartLearn

SmartLearn Banner

SmartLearn is an online learning platform designed to make digital education accessible, interactive, and engaging for everyone.

This repository contains the front-end application built with React + Vite. Below are concise, corrected instructions to run and build the project locally.

Quick links

Prerequisites

Reachout through

charzlwebz256@gmail to get login credentials

  • Node.js 18+ (recommended)
  • npm (bundled with Node) or preferred package manager

Setup and Run (local)

  1. Install dependencies

    npm install
  2. Create a .env.local file in the project root and add your Gemini API key. The project expects an environment variable named GEMINI_API_KEY (the Vite config maps this into the app):

    # .env.local (example)
    GEMINI_API_KEY=your_gemini_api_key_here
    

    After changing environment variables, restart the dev server so Vite picks up the new values.

  3. Start the development server

    npm run dev
  4. Build for production

    npm run build
  5. Preview the production build locally

    npm run preview

Environment details

  • The Vite config (vite.config.ts) loads environment variables using loadEnv and exposes GEMINI_API_KEY to the client as process.env.API_KEY and process.env.GEMINI_API_KEY.
  • Several components (for example, the AI assistant) read process.env.API_KEY in the browser bundle; ensure GEMINI_API_KEY is set prior to starting the dev server.

Troubleshooting

  • If the AI assistant fails to connect or returns errors, confirm:
    • You added GEMINI_API_KEY to .env.local (not .env only) and restarted the dev server.
    • The key is valid and has network access.
  • If you see stale env values, stop the dev server and restart it after editing .env.local.
  • If you run into TypeScript or build issues, ensure your Node.js version matches the project's requirements and that you have the required devDependencies installed.

Scripts (package.json)

  • npm.cmd run dev — start Vite dev server
  • c npm run build — build production assets
  • npm run preview — locally preview the production build

Contributing

  • Feel free to open issues or PRs. Keep changes focused and include a short description of what was changed and why.

If you'd like, I can also add a small example .env.example file to the repo, or update any other docs/pages that currently show the wrong env variable.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published