TutorLoom
The learning platform for companies, colleges and training institutes. Free and open source, with an Enterprise edition.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證NextJS Repo
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Admin interface for managing JNV (Jawahar Navodaya Vidyalaya) student enrollments for Avanti Fellows.
admin (Admin): all features, all Schools and all programsprogram_admin (Program Admin): oversees scoped Schools and their own School visitsprogram_manager (Program Manager): conducts School visits in their assigned Schoolsteacher (Teacher): views and manages Students in their assigned Schoolsholistic_mentorship_admin (Holistic Mentorship Admin): manages Holistic Mentorship onlypmu_manager (PMU Manager): Avanti's internal PMU team; JNV NVS only, in one or more JNV Schools (or all of them), with the JNV NVS Schools dashboardpmu_govt_school_user (PMU Govt School User): an external stakeholder of exactly one JNV NVS School (e.g. its principal); JNV NVS only, and lands straight on that Schoolalumni_manager (Alumni Manager): views and updates alumni of their assigned Schools only; no Students, programs or other featuresnvm lets you install and switch between different Node.js versions.
On macOS/Linux, open Terminal and run:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
After it finishes, close and reopen your terminal, then verify it worked:
nvm --version
You should see a version number like 0.40.1.
Troubleshooting: If nvm: command not found, run this and try again:
source ~/.bashrc
Or if you use zsh (default on newer Macs):
source ~/.zshrc
nvm install 22
Verify it installed correctly:
node --version
You should see v22.x.x (e.g., v22.21.1).
git clone https://github.com/avantifellows/af_lms.git
cd af_lms
The project includes a .nvmrc file that specifies the Node version. Run:
nvm use
You should see: Now using node v22.x.x
npm install
This will download all required packages. Wait for it to complete.
Copy the example file:
cp .env.example .env.local
Open .env.local in a text editor and fill in the values. Ask your team lead for the actual credentials:
# Database (get these from your team lead)
DATABASE_HOST=your-db-host
DATABASE_PORT=1357
DATABASE_USER=postgres
DATABASE_PASSWORD=your-db-password
DATABASE_NAME=your-db-name
# DB Service (get these from your team lead)
DB_SERVICE_URL=https://staging-db.avantifellows.org/api
DB_SERVICE_TOKEN=your-db-service-token
# NextAuth
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=generate-a-random-string
# Google OAuth (get these from your team lead)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
To generate NEXTAUTH_SECRET, run:
openssl rand -base64 32
Copy the output and paste it as the value.
npm run db:setup-permissions
This creates the permissions table. It's safe to run multiple times.
npm run dev
Open your browser and go to: http://localhost:3000
Close and reopen your terminal, or run source ~/.zshrc (Mac) or source ~/.bashrc (Linux).
Run nvm install 22 then nvm use.
Check that your .env.local has the correct database credentials. Make sure your IP is whitelisted if connecting to a remote database.
Make sure you ran nvm use before npm run dev or npm run build.
Each time you open a new terminal to work on this project:
cd af_lms # Go to the project folder
nvm use # Switch to the correct Node version
npm run dev # Start the development server
| Command | Description |
|---|---|
npm run dev | Start development server |
npm run build | Build for production |
npm run start | Start production server |
npm run lint | Run ESLint |
npm run db:setup-permissions | Create/update permissions table |
This app uses a hybrid approach:
This is intentional technical debt for rapid development. The DB Service is Avanti Fellows' canonical data layer.
Permissions are stored in user_permission table:
email: User's email (unique)level: School scope level (1-3)school_codes: Array of school codes (for level 1)regions: Array of region names (for level 2)read_only: Boolean for view-only accesssrc/
├── app/
│ ├── dashboard/ # School listing + student search
│ ├── school/[udise]/ # Student table for a school
│ ├── admin/ # Admin pages
│ │ └── users/ # User management
│ └── api/
│ ├── admin/ # Admin API routes
│ ├── student/ # Student update API
│ └── students/search # Student search API
├── components/
│ ├── StudentTable.tsx # Student list with grade filter
│ ├── StudentSearch.tsx # Global student search
│ └── EditStudentModal.tsx
├── lib/
│ ├── auth.ts # NextAuth config
│ ├── db.ts # PostgreSQL connection
│ └── permissions.ts # Permission helpers
└── scripts/
└── setup-permissions.ts
/admin/users (requires admin access)Or manually via database:
INSERT INTO user_permission (email, level, school_codes, regions, read_only)
VALUES ('[email protected]', 3, NULL, NULL, false);
The app is deployed on AWS Amplify. Pushes to main trigger automatic deployments via GitHub Actions.
| Environment | URL |
|---|---|
| Production | https://lms.avantifellows.org |
See AMPLIFY_DEPLOYMENT.md for full deployment setup and instructions.
Environment variables are managed via GitHub Secrets and synced to Amplify by GitHub Actions. See .env.example for the full list.
The Google OAuth client must have the authorized redirect URI:
https://lms.avantifellows.org/api/auth/callback/google
Configure this in Google Cloud Console.