BrightBoost is an interactive learning platform designed to help teachers create engaging lessons and students to learn in a fun, gamified environment.
- Teacher Accounts & Dashboard: Teachers can sign up, log in, and manage their lessons through a dedicated dashboard.
- Student Accounts & Dashboard: Students can sign up, log in, and access assigned lessons and activities.
- Lesson Creation & Management: Teachers can create, edit, and delete lessons, including title, content, category, and status.
- Student Lesson Viewing & Activity Tracking: Students can view lessons assigned to them and mark activities as complete.
- Persistent Data Storage: User and lesson data is stored persistently using a file-based database (
lowdb). - Role-Based Access Control: Clear distinction between teacher and student functionalities.
- E2E Tested Core Flow: The primary user journeys for teachers and students have been tested.
A typical demo showcases:
- A teacher signing up or logging in.
- The teacher navigating their dashboard and creating a new lesson (e.g., "Introduction to Photosynthesis", Category: "Science", Content: "Learn about how plants make food.", Status: "Published").
- The teacher verifying the lesson is displayed on their dashboard.
- The teacher logging out.
- A student signing up or logging in.
- The student viewing the "Introduction to Photosynthesis" lesson on their dashboard.
- The student marking an activity associated with this lesson as "complete".
- The student logging out.
This project is built with a modern web technology stack:
- Frontend:
- React
- Vite
- TypeScript
- Tailwind CSS
- shadcn-ui (for UI components)
- React Router (for navigation)
- Context API (for state management, e.g., AuthContext)
- Backend:
- Node.js with Express.js
lowdb(for file-based JSON database -db.json)- JSON Web Tokens (JWT) for authentication
bcryptjsfor password hashing
- Testing:
- Vitest (for unit/integration tests)
- Cypress (for End-to-End tests)
- Development Tools:
- ESLint (for linting)
- Storybook (for UI component development and testing)
To get a local copy up and running, follow these simple steps.
Prerequisites:
- Node.js (v18 or later recommended)
- npm (comes with Node.js)
Installation & Setup:
-
Clone the repository:
git clone <YOUR_GIT_URL> # Replace <YOUR_GIT_URL> with the actual Git URL of this project cd <YOUR_PROJECT_NAME> # Replace <YOUR_PROJECT_NAME> with the directory name
-
Install dependencies: This will install both frontend and backend dependencies.
npm install
-
Configure Environment Variables: The backend server (
server.cjs) uses a.envfile for configuration (e.g.,JWT_SECRET). Create a.envfile in the root of the project if it doesn't exist:JWT_SECRET=your_super_secret_jwt_key_here # PORT=3001 (Optional, defaults to 3000 or 3001 if not set)
Replace
your_super_secret_jwt_key_herewith a strong, unique secret. -
Running the Application (Full Stack): To run both the frontend Vite development server and the backend Node.js server concurrently:
npm run dev:full
This command typically starts:
- Frontend (Vite):
http://localhost:5173(or another port if 5173 is busy) - Backend Server:
http://localhost:3000(or the port specified in.env/default)
- Frontend (Vite):
-
Running Frontend Only:
npm run dev
-
Running Backend Server Only: For development with auto-reloading (using
nodemon):npm run dev:server
Or to run the plain Node.js server (e.g., for production testing):
npm run server
This project is configured for deployment to Azure.
The BrightBoost application is deployed to Azure using a GitHub Actions CI/CD pipeline. For details on the deployment process, refer to the Deployment Pipeline documentation (Note: This file might not exist in the current repository state).
For information on setting up Azure resources, refer to the Azure Deployment Configuration document.
The deployment pipeline typically:
- Builds and tests the application.
- Creates a Docker image and pushes it to a container registry (e.g., GitHub Container Registry or Azure Container Registry).
- Deploys the application to Azure App Service.
Note on db.json for Azure Deployment:
The current backend uses lowdb with a db.json file for data persistence. When deploying to Azure App Service:
- Ensure
db.jsonis included in your deployment package if you want to deploy pre-existing data (not recommended for secrets or dynamic data). - By default, Azure App Service file storage is ephemeral for scaling events or instance restarts (unless using features like "Path mappings" with Azure Storage or Web App for Containers with persistent storage).
- For a production-like or more robust demo environment on Azure, consider using an Azure database service (e.g., Azure Cosmos DB, Azure Database for PostgreSQL/MySQL) instead of
db.json. However, for the current scope,db.jsonwill be used and its persistence characteristics on App Service should be noted. TheAZURE_DEPLOYMENT.MDfile should contain more details or considerations for this.
├── public/ # Static assets
├── src/ # Frontend source code (React, Vite, TypeScript)
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React contexts (e.g., AuthContext)
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility functions
│ ├── pages/ # Page components (routed views)
│ ├── services/ # API service integration
│ ├── App.tsx # Main application component
│ └── main.tsx # Entry point for the React app
├── cypress/ # Cypress E2E tests
├── server.cjs # Backend Express server (Node.js, CommonJS)
├── db.json # lowdb JSON database file (gitignored by default, ensure handling for deployment)
├── vite.config.ts # Vite configuration
├── tailwind.config.js # Tailwind CSS configuration
├── postcss.config.js # PostCSS configuration
├── README.md # This file
└── package.json # Project dependencies and scripts
Note: db.json should ideally be in .gitignore if it contains sensitive or frequently changing data not meant for version control. If it's meant to be deployed with initial schema/data, ensure it's not gitignored.
This project was initially scaffolded or managed by Lovable. While direct local development (as described in "Getting Started") is the primary recommended method, you might find references to Lovable.
Use your preferred IDE (Recommended)
Clone this repo and push changes. Pushed changes will also be reflected in Lovable if the project is still linked. The only requirement is having Node.js & npm installed - install with nvm
Use Lovable (If Applicable)
If the project is actively managed via Lovable: Visit the Lovable Project and start prompting. Changes made via Lovable will be committed automatically to this repo.
Edit a file directly in GitHub / Use GitHub Codespaces Standard GitHub workflows are always available.
Lovable's specific advice was: "We don't support custom domains (yet). If you want to deploy your project under your own domain then we recommend using Netlify. Visit our docs for more details: Custom domains"
For deployments to Azure (as configured for this project), custom domains can be configured directly within Azure App Service.