This is a learning project, so any contributors are welcome
It would be great if you share some knowledge and experience. Feel free to expose your ideas. If you are experienced dev please show the right direction for our efforts, roast our mistakes.
Here is kanban for this project. You can pick up something or make a review. Also you can add something via issues using templates.
We work with the app via issues (tickets). Any feature, bug, refactor, rebuilding, docs editing requires to be exposed in a new issue with good explanation. There are templates for issues and PR (pull request). It is ok to communicate via issues by creating and editing or using internal chat. For vast majority of issues (tickets) we create a branch. All PR are merging into dev branch, after testing dev branch merges into main branch. So main is the last working version before release. When really big changes are made we create a new branch from main for previous version. In my mind dev is beta, and main is a release candidate. Any other branch is OLD VERSION or alfa. There is no such thing as testing in this project yet.
Python should be installed, virtual environment created and activated.
requirements.txt contains info about modules and extensions to be installed for this app. Install modules.
Configure .env for setting environment variables. File .env
is in .gitignore
so it should be created manually:
FLASK_APP=studio_app.webapp
FLASK_ENV=development
FLASK_DEBUG=1
MAIL_USERNAME=*
MAIL_PASSWORD==*
MAIL_DEFAULT_SENDER=*
SECRET_KEY=*
SECRET_RECAPTCHA=*
KEY_CHANGE_ROLE_LIST=*
KEY_CHANGE_ROLE=*
Create data base file in the root directory, name it "db.db". Or you can copy and rename file _db.db where all tables exist, also there are two users:
- admin: login
[email protected]
passwordNewuser12345
- user: login
[email protected]
passwordNewuser12345
It is SQLite. Python has a module for this already. Odds aer we will use SQL Alchemy in the future. To read database file you can use VScode extension SQLite Viewer.
integrating Flask-security-too is in progress, for that purpose new database created. File of db is created automatically. NEW DATABASE SCHEMA
CREATE TABLE users (
id INTEGER PRIMARY KEY,
is_admin INT,
is_editor INT,
name TEXT, email TEXT,
lang TEXT, instagram TEXT,
tel TEXT,
is_subscribed_promo INT,
is_instagram_notification INT,
is_email_notification INT,
is_text_notification INT,
avatar TEXT);
CREATE TABLE login (
user_id INTEGER PRIMARY KEY,
hash TEXT,
stay_logedin INT,
date_registered TEXT,
last_login TEXT,
count_atempts INT,
FOREIGN KEY(user_id) REFERENCES users(id));
CREATE TABLE calendar (
slot_id INTEGER PRIMARY KEY,
year INT,
month INT,
day INT,
hour INT,
minute INT,
is_open INT,
is_occupaied INT);
CREATE TABLE appointments (
id INTEGER PRIMARY KEY,
user_id INT,
pedicure INT,
manicure INT,
message TEXT,
slot_id INT,
amount_time_min INT,
is_seen INT,
is_aproved INT,
is_canceled INT,
FOREIGN KEY (slot_id) REFERENCES calendar(slot_id),
FOREIGN KEY (user_id) REFERENCES users(id));
CREATE TABLE sessions (
rowid INTEGER PRIMARY KEY,
user_id INT,
from_route TEXT,
to_route TEXT,
year INT,
month INT,
day INT,
hour INT,
minute INT,
second INT,
type TEXT,
data TEXT,
FOREIGN KEY (user_id) REFERENCES users(id));
To change role of any user go to route "/change_role?key=KEY_CHANGE_ROLE_LIST
". Than hit the button, enter KEY_CHANGE_ROLE
, pass reCAPTCHA.
When you are switching branches ignored by git files can be lost. So keep a copy of them somewhere. If you know how to automate this proses or to do it other way share please.
Do NOT share your private info via .env or db.db Do not use your real existing passwords and telephone numbers for testing.
- Please follow commit guide and pull request template
- When creating or changing make sure to write some explanation in helpers or route handlers
- If your actions are about database schema or installing new extensions/modules do not forget to update Contributing