AutonomousVehicleControlBeginnersGuide
關於自動駕駛車輛控制演算法的 Python 示例程式碼與文件。本專案可作為技術指南書,供初學者學習這些演算法與軟體架構。
AI 翻譯
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗Live demo: https://mongodb-library-management-system.vercel.app
A library management web app built with MongoDB, Node.js/Express and a plain HTML/CSS/JavaScript frontend. It has a dashboard, dark/light themes, and an "Index lab" that shows MongoDB's query plans live.
$$NOW in a pipeline update)| Feature | Where to see it |
|---|---|
| CRUD | Books, borrowers and authors can all be created, read, updated and deleted |
| Indexing | Unique, compound, case-insensitive (collation), weighted text and partial unique indexes; the Books page shows explain() output comparing the text index with a full collection scan |
| Aggregation | Dashboard: $facet, $group, $bucket, $dateToString, $lookup, $sort/$limit; pagination uses $facet |
| Text Search | $text over title (weight 10), author (5) and description (1), ranked by textScore |
| Data Validation | $jsonSchema with types, ranges, pattern for ISBN/email, plus $expr rules (availableCopies ≤ totalCopies, dueDate > issuedAt) |
findOneAndUpdate with a filter): two people can't grab the last copy at the same timeauthorId (joined with $lookup) and a copy of the author's name (for text search)$setWindowFields + $documentNumber| Feature | How it works |
|---|---|
| Reservations | When every copy is out, borrowers join a queue. A returned copy is held for the first person (heldCopies) for 3 days and they're notified; uncollected holds pass to the next person automatically |
| Fine payment tracking | Fines are fixed on return; paying records a payments document and marks the loan paid in one transaction. Borrowers owing more than ₹100 can't borrow |
| Email / SMS reminders | A reminder 2 days before the due date, an overdue notice, and "your reservation is ready". Sent by SMTP / Twilio when configured; always recorded in the notifications outbox |
| Barcode / QR scanning | Scan desk on Circulation: scan a library card, then a book's ISBN barcode or QR label. It issues or returns automatically. Works with USB scanners, the camera (Chrome/Edge) or typing |
| Backups | Automatic backup every 24 h (newest 7 kept), "Back up now" and download on the System page, npm run backup / npm run restore |
| Audit log | Every change is logged with who did it, in the same transaction as the change (Activity page) |
| Automated tests | npm test: 15 end-to-end tests against a throwaway database, including a 6-way race for the last copy |
| Collection | Purpose |
|---|---|
books | title, author, authorId, isbn, description, totalCopies, availableCopies, heldCopies, borrowCount |
authors | name (unique, case-insensitive) |
borrowers | name, email (unique), phone, activeLoans |
loans | bookId, borrowerId, issuedAt, dueDate, returned, returnedAt, fine, finePaid, reminder timestamps |
reservations | bookId, borrowerId, status (waiting / ready / fulfilled / cancelled / expired), holdUntil |
payments | loanId (unique), borrowerId, amount, method, paidAt, receivedBy |
notifications | type, channel (email / sms), to, subject, body, status (sent / logged / failed) |
auditLogs | at, action, entity, entityId, summary, actor |
Database name: library_management
Requires Node.js 20.12+ and MongoDB 6+.
npm install
npm run seed # optional sample data (refuses to wipe existing data without --force)
npm start
npm run dev restarts the server automatically when you edit a file.
| Command | What it does |
|---|---|
npm test | Runs the automated tests (needs a local MongoDB; uses its own temporary database) |
npm run backup | Saves every collection to backups/backup-<time>.json |
npm run restore -- backups/<file> --force | Replaces all data with a backup |
Copy .env.example to .env to change the MongoDB URL, database name, port and library rules. It also explains how to turn on real email (any SMTP server, e.g. Gmail with an app password) and SMS (Twilio). Without them, reminders are still recorded in the outbox on the System page.
The app runs on Vercel as a serverless function (server.js exports the Express app; vercel.json sets the Mumbai region and a daily cron).
0.0.0.0/0) in MongoDB Atlas → Network Access, because Vercel's IP addresses change.MONGO_URI (your Atlas connection string) and CRON_SECRET (any random string).vercel deploy --prod, or push to GitHub if the repository is connected.On Vercel, reminders and reservation-hold expiry run once a day through Vercel Cron (/api/cron), and backups are written to temporary storage, so download them straight away from the System page.
Transactions need MongoDB to run as a replica set. A single-node replica set is enough:
以上為 README 的開頭部分。其餘內容請閱讀原文。 檢視完整 README ↗