This is my implementation of system, that allow controll access for different persons to admin/user info and actions.
This system is using 3 databases that it reaching through API. Bases can be whatever you want, for the project it is a psql.
- fastapi
- uvicorn
- sqlalchemy
- asyncio
- asyncpg
- loguru
- httpx
-
create databases in local psql (persons_first, persons_second, persons_third -> empty)
-
If you will run services on localhost - you will need to change your hosts file (google please about it) to redirect requests from 'dohako.com' to your localhost. Also you can create it by your desired name, but you will need to change adresses on front side and inside code (Will think of method to easy change it)
-
git clone url
-> cd to it -
fill .env.dev and rename to .env inside each *_data folder
-
python -m venv venv
-
venv\Scripts\activate.bat
-
pip install -r requirements.txt
-
main process
-
cd backend
-
python main.py
-
-
database 1
-
cd first_data
-
python main.py
-
-
database 2
-
cd second_data
-
python main.py
-
-
database 3
-
cd third_data
-
python main.py
-
-
go to dohako.com:8000/home or .../login (doesn't matter, cause you will get redirected to /login)
-
type your username and pass (don't forget it or you will need to erase bases, it's also TBD)
-
press register button and if username is not taken - you will create user
-
next press on login button
-
first one to register in databases will become Admin, others firstly become users
-
If you are an admin you will see list of users and you can delete anyone (even yourself, but be careful with it)
-
You can create new users/persons in top of page
-
You can Edit anyone by Global ID (even yourself, but don't forget to manage status to admin)
-
All users/persons (admins or not) that you will create here CAN login to service through pass "123" (yes, it's not best, change pass is tbd)
-
there is also a logout button
-
If you are a user you will just see list of other users, nothing else
-
there is a logout button
-
change pass
-
pass check
-
...
формаajaxапилогинодна базатокенразные формы для админа/пользователяодна база -> три базы