Merge pull request #35 from Casvt/Development

V1.2.0
This commit is contained in:
Casvt
2023-02-11 18:14:37 +01:00
committed by GitHub
12 changed files with 46 additions and 43 deletions

View File

@@ -26,7 +26,7 @@ assignees: ''
**Version info**
- OS: [e.g. iOS]
- Browser: [e.g. chrome, safari]
- Noted Version: [e.g. V1.0.0]
- MIND Version: [e.g. V1.0.0]
- Python Version: [e.g. V3.7]
**Additional context**

View File

@@ -1,8 +1,8 @@
# Contributing to Noted
# Contributing to MIND
## General steps
Contributing to Noted consists of 5 steps, listed hereunder.
Contributing to MIND consists of 5 steps, listed hereunder.
1. Make a [contributing request](https://github.com/Casvt/Noted/issues/new?template=contribute-request.md), where you describe what you plan on doing. This request needs to get approved before you can start, or your pull request won't be accepted. This is to avoid multiple people from doing the same thing and to avoid you wasting your time if we do not wish the changes. This is also where discussions can be held about how something will be implemented.
1. Make a [contributing request](https://github.com/Casvt/MIND/issues/new?template=contribute-request.md), where you describe what you plan on doing. This request needs to get approved before you can start, or your pull request won't be accepted. This is to avoid multiple people from doing the same thing and to avoid you wasting your time if we do not wish the changes. This is also where discussions can be held about how something will be implemented.
2. When the request is accepted, start your local development (more info about this below).
3. When done, create a pull request to the Development branch, where you mention again what you've changed/added and give a link to the original contributing request issue.
4. The PR will be reviewed and if requested, changes will need to be made before it is accepted.
@@ -22,7 +22,7 @@ python3 -m unittest discover -v -s './tests' -p '*_test.py'
6. Test your version thoroughly to catch as many bugs as possible (if any).
## Styling guide
The code of Noted is written in such way that it follows the following rules. Your code should too.
The code of MIND is written in such way that it follows the following rules. Your code should too.
1. Compatible with python 3.7 .
2. Tabs (4 space size) are used for indentation.

View File

@@ -9,4 +9,4 @@ RUN pip3 install -r requirements.txt
COPY . .
CMD [ "python3", "/app/Noted.py" ]
CMD [ "python3", "/app/MIND.py" ]

View File

@@ -2,7 +2,8 @@
#-*- coding: utf-8 -*-
from os import makedirs, urandom
from os.path import abspath, dirname, join
from os.path import abspath, dirname, join, isfile
from shutil import move
from sys import version_info
from flask import Flask, render_template, request
@@ -15,7 +16,7 @@ from frontend.ui import ui
HOST = '0.0.0.0'
PORT = '8080'
THREADS = 10
DB_FILENAME = 'db', 'Noted.db'
DB_FILENAME = 'db', 'MIND.db'
def _folder_path(*folders) -> str:
"""Turn filepaths relative to the project folder into absolute paths
@@ -67,8 +68,8 @@ def _create_app() -> Flask:
return app
def Noted() -> None:
"""The main function of Noted
def MIND() -> None:
"""The main function of MIND
Returns:
None
"""
@@ -79,6 +80,8 @@ def Noted() -> None:
# Register web server
app = _create_app()
with app.app_context():
if isfile(_folder_path('db', 'Noted.db')):
move(_folder_path('db', 'Noted.db'), _folder_path('db', 'MIND.db'))
db_location = _folder_path(*DB_FILENAME)
makedirs(dirname(db_location), exist_ok=True)
DBConnection.file = db_location
@@ -90,9 +93,9 @@ def Noted() -> None:
# Create waitress server and run
server = create_server(app, host=HOST, port=PORT, threads=THREADS)
print(f'Noted running on http://{HOST}:{PORT}/')
print(f'MIND running on http://{HOST}:{PORT}/')
server.run()
print(f'\nShutting down Noted...')
print(f'\nShutting down MIND...')
# Stopping thread
reminder_handler.stop_handling()
@@ -101,4 +104,4 @@ def Noted() -> None:
return
if __name__ == "__main__":
Noted()
MIND()

View File

@@ -1,16 +1,16 @@
# Noted Reminders
# MIND Reminders
A simple self hosted reminder platform that uses push to send notifications to your device. Set the reminder and forget about it! 📢
Noted is a simple self hosted application for creating reminders that get pushed to your device using the [Apprise](https://github.com/caronc/apprise) API. You can send messages to just about every platform, including scheduled emails!
Mind is a simple self hosted application for creating reminders that get pushed to your device using the [Apprise](https://github.com/caronc/apprise) API. You can send messages to just about every platform, including scheduled emails!
## Screenshots
![noted-reminders-home](https://user-images.githubusercontent.com/57927413/213593220-495aeb86-2bf8-4c43-895d-c7cba38c3cee.png)
![mind-reminders-home](https://user-images.githubusercontent.com/57927413/213593220-495aeb86-2bf8-4c43-895d-c7cba38c3cee.png)
![noted-reminders-add-notification-services](https://user-images.githubusercontent.com/57927413/212755314-1104531e-7feb-4e59-af1d-927576e47152.png)
![mind-reminders-add-notification-services](https://user-images.githubusercontent.com/57927413/212755314-1104531e-7feb-4e59-af1d-927576e47152.png)
![noted-reminders-edit](https://user-images.githubusercontent.com/57927413/213594471-ecc99a72-cf0f-4570-8e78-92ffbf37e59d.png)
![mind-reminders-edit](https://user-images.githubusercontent.com/57927413/213594471-ecc99a72-cf0f-4570-8e78-92ffbf37e59d.png)
![noted-reminders-settings](https://user-images.githubusercontent.com/57927413/212755327-b45da53c-72f7-480c-9a77-eaad28803fbb.png)
![mind-reminders-settings](https://user-images.githubusercontent.com/57927413/212755327-b45da53c-72f7-480c-9a77-eaad28803fbb.png)
## Core Features
* Basic auth
@@ -28,19 +28,19 @@ You can see our planned features in our [Project board](https://github.com/users
Replace the timezone value (`TZ=`) to the [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of your timezone!
```bash
docker run -d \
--name noted \
-v noted-db:/app/db \
--name mind \
-v mind-db:/app/db \
-e TZ=Europe/Amsterdam \
-p 8080:8080 \
mrcas/noted:latest
mrcas/mind:latest
```
## Getting Started
- Create a new account
- Click the bell icon on the left side to add an Apprise push option and save it (Here is an example using Pushover)
![noted-reminders-notification-service](https://user-images.githubusercontent.com/57927413/213593832-6c62307c-cf7c-4d11-b6ce-dea33676d477.png)
![mind-reminders-notification-service](https://user-images.githubusercontent.com/57927413/213593832-6c62307c-cf7c-4d11-b6ce-dea33676d477.png)
- Click the home icon and create a reminder!
You can see the [wiki](https://github.com/Casvt/Noted/wiki) for instructions on how to install Noted on other OS'es.
You can see the [wiki](https://github.com/Casvt/MIND/wiki) for instructions on how to install MIND on other OS'es.

View File

@@ -64,8 +64,8 @@ def close_db(e=None) -> None:
def migrate_db(current_db_version: int) -> None:
"""
Migrate a Noted database from it's current version
to the newest version supported by the Noted version installed.
Migrate a MIND database from it's current version
to the newest version supported by the MIND version installed.
"""
print('Migrating database to newer version...')
cursor = get_db()

View File

@@ -1,11 +1,11 @@
version: '3.3'
services:
noted:
container_name: noted
mind:
container_name: mind
volumes:
- 'noted-db:/app/db'
- 'mind-db:/app/db'
environment:
- TZ=Europe/Amsterdam
ports:
- '8080:8080'
image: 'mrcas/noted:latest'
image: 'mrcas/mind:latest'

View File

@@ -9,17 +9,17 @@
<link rel="stylesheet" href="/static/css/login.css">
<script src="/static/js/login.js" defer></script>
<title>Login - Noted</title>
<title>Login - MIND</title>
</head>
<body>
<header>
<h1>Noted Reminders</h1>
<h1>MIND Reminders</h1>
</header>
<main>
<div class="form-container">
<form id="login-form">
<h2>Login</h2>
<noscript>Javascript is disabled. The web-ui of Noted does not work with JavaScript disabled.</noscript>
<noscript>Javascript is disabled. The web-ui of MIND does not work with JavaScript disabled.</noscript>
<input type="text" id="username-input" autocomplete="username" placeholder="Username" required autofocus>
<p class="error hidden" id="username-error">*Username not found</p>
<input type="password" id="password-input" autocomplete="current-password" placeholder="Password" required>

View File

@@ -8,14 +8,14 @@
<link rel="stylesheet" href="/static/css/general.css">
<link rel="stylesheet" href="/static/css/page_not_found.css">
<title>Page Not Found - Noted</title>
<title>Page Not Found - MIND</title>
</head>
<body>
<header>
<h1>Noted Reminders</h1>
<h1>MIND Reminders</h1>
</header>
<main>
<h2>Noted</h1>
<h2>MIND</h1>
<p>404 - Page not found :(</p>
<a href="/">Go to home page</a>
</main>

View File

@@ -18,7 +18,7 @@
<script src="/static/js/settings.js" defer></script>
<script src="/static/js/templates.js" defer></script>
<title>Reminders - Noted</title>
<title>Reminders - MIND</title>
</head>
<body>
<header>
@@ -32,7 +32,7 @@
</g>
</svg>
</button>
<h1>Noted Reminders</h1>
<h1>MIND Reminders</h1>
</div>
</header>
<div class="nav-divider">
@@ -63,7 +63,7 @@
</button>
</div>
<div>
<button id="logout-button" aria-label="Log out of Noted" tilte="Logout">
<button id="logout-button" aria-label="Log out of MIND" tilte="Logout">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" width="256" height="256" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
<g>
<path d="M11.476,15a1,1,0,0,0-1,1v3a3,3,0,0,1-3,3H5a3,3,0,0,1-3-3V5A3,3,0,0,1,5,2H7.476a3,3,0,0,1,3,3V8a1,1,0,0,0,2,0V5a5.006,5.006,0,0,0-5-5H5A5.006,5.006,0,0,0,0,5V19a5.006,5.006,0,0,0,5,5H7.476a5.006,5.006,0,0,0,5-5V16A1,1,0,0,0,11.476,15Z"></path>
@@ -81,7 +81,7 @@
</div>
<div id="reminder-tab">
<div class="search-container">
<noscript>Javascript is disabled. The web-ui of Noted does not work with JavaScript disabled.</noscript>
<noscript>Javascript is disabled. The web-ui of MIND does not work with JavaScript disabled.</noscript>
<form id="search-form">
<div class="search-bar">
<button type="submit">

View File

@@ -4,9 +4,9 @@ from flask import Flask
from frontend.api import api
from frontend.ui import ui
from Noted import _create_app
from MIND import _create_app
class Test_Noted(unittest.TestCase):
class Test_MIND(unittest.TestCase):
def test_create_app(self):
result = _create_app()
self.assertIsInstance(result, Flask)

View File

@@ -1,7 +1,7 @@
import unittest
from backend.db import DBConnection
from Noted import DB_FILENAME, _folder_path
from MIND import DB_FILENAME, _folder_path
class Test_DB(unittest.TestCase):
def test_foreign_key(self):