{"id":27061198,"url":"https://github.com/felipefma/tcard","last_synced_at":"2026-05-04T07:38:14.148Z","repository":{"id":285801992,"uuid":"959369364","full_name":"FelipeFMA/TCard","owner":"FelipeFMA","description":"TCard is a premium RFID access control system.","archived":false,"fork":false,"pushed_at":"2025-04-02T21:25:03.000Z","size":8286,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T21:33:58.905Z","etag":null,"topics":["arduino","nfc","rfid"],"latest_commit_sha":null,"homepage":"https://github.com/FelipeFMA/TCard","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FelipeFMA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-02T17:20:24.000Z","updated_at":"2025-04-02T21:25:07.000Z","dependencies_parsed_at":"2025-04-02T21:44:42.272Z","dependency_job_id":null,"html_url":"https://github.com/FelipeFMA/TCard","commit_stats":null,"previous_names":["felipefma/arduino-rfid-webui","felipefma/tcard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeFMA%2FTCard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeFMA%2FTCard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeFMA%2FTCard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelipeFMA%2FTCard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FelipeFMA","download_url":"https://codeload.github.com/FelipeFMA/TCard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248098687,"owners_count":21047483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","nfc","rfid"],"created_at":"2025-04-05T14:20:01.511Z","updated_at":"2026-05-04T07:38:09.121Z","avatar_url":"https://github.com/FelipeFMA.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eTCard | Premium Access Control System\u003c/h1\u003e\n  \n  ![ezgif-18e4284d54978d](https://github.com/user-attachments/assets/4e7233ed-80b6-4c48-826b-b058e5a7781c)\n  \n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/College%20Project-UNIFRAN-8E9BAE?style=for-the-badge\" alt=\"UNIFRAN College Project\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Status-In%20Development-3BB77E?style=for-the-badge\" alt=\"Status: In Development\"/\u003e\n\u003c/div\u003e\n\n## 📋 Overview\n**TCard** is a premium RFID access control system developed as a learning project at **UNIFRAN** (Universidade de Franca). It combines Arduino hardware with a modern web interface to create a feature-rich door access management solution.\n\n## 🏗️ System Architecture\n\n### Hardware Layer\nThe system's hardware component is built around an **Arduino UNO** microcontroller interfaced with an **MFRC522 RFID** reader module. The Arduino continuously polls for RFID card presence and communicates with the server via a serial connection at 9600 baud rate.\n\n### Communication Layer\nThe system implements a bidirectional serial communication protocol between the Arduino and Node.js server:\n- **Arduino → Server**: Sends `CARD:{UID}` messages when cards are scanned\n- **Server → Arduino**: Returns `GRANTED` or `DENIED` access commands\n\n### Application Layer\n- **Backend**: A Node.js/Express server that:\n  - Manages serial communication with Arduino\n  - Implements RESTful API endpoints for user management\n  - Persists data in SQLite3 through structured SQL queries\n  - Broadcasts real-time events using Socket.io\n\n- **Frontend**: A responsive single-page application using:\n  - Vanilla JavaScript with event-driven architecture\n  - CSS3 with Flexbox/Grid for responsive layouts\n  - WebSocket connections for real-time updates\n  - Local browser storage for user preferences\n\n### Database Schema\nThe SQLite database implements a structured user management system:\n```sql\nCREATE TABLE users (\n  id INTEGER PRIMARY KEY AUTOINCREMENT,\n  name TEXT NOT NULL,\n  cardId TEXT UNIQUE NOT NULL,\n  role TEXT NOT NULL,\n  active INTEGER NOT NULL DEFAULT 1\n);\n```\n\n## ✨ Features\n\n- 🎨 **Elegant UI** - Beautiful, responsive interface with light/dark modes\n- 👤 **Role-based Access** - Different permissions for admins and users\n- ⚡ **Real-time Updates** - Instant access notifications via WebSockets\n- 📊 **User Management** - Easily add, edit and remove users\n- 🔒 **Security** - RFID card-based authentication system\n- 💻 **Cross-platform** - Works on any device with a web browser\n\n## 🛠️ Technology Stack\n\n| Component | Technologies |\n|-----------|-------------|\n| **Frontend** | HTML5, CSS3, JavaScript, Socket.io |\n| **Backend** | Node.js, Express, SQLite3, Socket.io |\n| **Hardware** | Arduino UNO, RFID-RC522 Module |\n\n## 🔌 Hardware Setup\n\nConnect the RFID-RC522 module to Arduino UNO:\n\n| RFID-RC522 Pin | Arduino UNO Pin |\n|----------------|-----------------|\n| SDA (SS)       | 10              |\n| SCK            | 13              |\n| MOSI           | 11              |\n| MISO           | 12              |\n| IRQ            | Not connected   |\n| GND            | GND             |\n| RST            | 9               |\n| 3.3V           | 3.3V            |\n\n## 💾 Technical Implementation\n\n### RFID Card Detection\nThe Arduino sketch continuously polls for RFID cards using the MFRC522 library. When a card is detected:\n1. The UID is read and formatted as a hexadecimal string\n2. A `CARD:{UID}` message is sent via serial to the server\n3. The system waits for server response to grant/deny access\n\n### Server-side Authentication\n1. Incoming card data is parsed from serial data buffer using string manipulation\n2. Card UID is validated against the database with prepared SQL statements\n3. Authentication result is transmitted to both:\n   - Arduino (for physical access control)\n   - Web clients (via Socket.io for real-time updates)\n\n### RESTful API\nThe server exposes a complete REST API for user management:\n- `GET /api/users` - List all users\n- `POST /api/users` - Create new user\n- `PUT /api/users/:id` - Update user details\n- `DELETE /api/users/:id` - Remove a user\n- `GET /api/scan-card` - Send a scan request to the Arduino\n\n## 🚀 Getting Started\n\n### Arduino Setup\n1. Upload the sketch to your Arduino:\n   ```\n   arduino/rfid_access_control/rfid_access_control.ino\n   ```\n\n### Server Setup\n1. Install dependencies:\n   ```bash\n   cd server\n   npm install\n   ```\n\n2. Start the server:\n   ```bash\n   npm start\n   ```\n\n3. Access the web interface:\n   ```\n   http://localhost:3000\n   ```\n\n## 🧑‍💻 Usage\n\n### User Mode\n- Scan your RFID card to request access\n- View your profile and access history\n\n### Admin Mode\n- Manage users (add, edit, deactivate, delete)\n- Monitor access logs in real-time\n- Configure system settings\n\n## 🎓 Academic Purpose\n\nThis project was developed as part of the curriculum at **UNIFRAN** (Universidade de Franca) to demonstrate the integration of hardware and software technologies. It serves as a learning tool for:\n\n- Full-stack web development\n- IoT and hardware integration\n- User interface design\n- Database management\n- Real-time communications\n\n## 📄 License\n\nThis project is licensed under the Creative Commons CC BY-NC-ND License.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eDeveloped with ❤️ as a learning project at UNIFRAN\u003c/p\u003e\n\u003c/div\u003e \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipefma%2Ftcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipefma%2Ftcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipefma%2Ftcard/lists"}