Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulsonnentag/meffis-lock
https://github.com/paulsonnentag/meffis-lock
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/paulsonnentag/meffis-lock
- Owner: paulsonnentag
- Created: 2022-03-31T13:12:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T15:50:28.000Z (4 months ago)
- Last Synced: 2024-10-15T11:35:18.835Z (3 months ago)
- Language: JavaScript
- Size: 626 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# meffi.s lock
## Installation
create `backend/config.mjs` file
```javascript
const config = {
sessionSecret: "foobar",/* bluetoothImplementation = HCI | SERIAL | WEBSOCKET | MOCK |
* MOCK_FAULTY | MOCK_DISCONNECTED
*
* HCI (default): use keyble library with local bluetooth adapter
* SERIAL: use esp32 bluetooth bridge connected to serial port
* WEBSOCKET: use esp8266 wifi bridge connected via websocket
* MOCK: open and close will always work
* MOCK_FAULTY: open and close will fail
* MOCK_DISCONNECTED: lock is always in disconnected state
*
* */
bluetoothImplementation: 'HCI',
httpPort: 3000,
keyble: {
address: 'xx:xx:xx:xx:xx:xx',
user_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
},
serial: {
path : "/dev/ttyUSB0",
baudRate : 115200,
hasPrefix : true,
},
websocket: {
port : 4000,
secret : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
slack: {
disabled: true, // optional
token: `xoxb-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx`,
signingSecret: `xxxxxxxxxx`,
targetChannelId: 'xxxxxxxxxx'
},
pullLatch: true // doors with handle on the outside don't need latch pulling
}export default config;
```build frontend
```bash
cd frontend
npm install
npm run build
```start backend
```bash
cd ../backend
npm install
npm start
```## Development
run backend with
```bash
cd backend
npm run dev
```run frontend build with
```bash
cd frontend
npm run start
```Unfortunately sometimes the frontend build crashed and you need to restart it
## Adding user
run
```bash
node backend/src/add-user.mjs
```or in backend directory
```bash
npm run add-user
```Usernames with hashed passwords are stored in `backend/users.json`.