Backend for simple forum made with FastAPI and Piccolo ORM ecosystem.
Clone repository in fresh virtualenv.
git clone https://github.com/sinisaos/headless-forum-fastapi.git
cd headless-forum-fastapi
pip install -r requirements/requirements.txt
sudo -i -u yourpostgresusername psql
CREATE DATABASE forum;
\q;
Create .env
file in root of the project.
DB_NAME=your db name
DB_USER=your db username
DB_PASSWORD=your db password
DB_HOST=your db host
DB_PORT=your db port
SECRET_KEY=your secret key
ALGORITHM="HS256"
ACCESS_TOKEN_EXPIRE_MINUTES=30
./scripts/migrations.sh
./scripts/user.sh
Install test requirements.
pip install -r requirements/test-requirements.txt
Run tests.
./scripts/test.sh
./scripts/lint.sh
./scripts/start.sh
After site is running log in as admin user on localhost:8000/admin/ and add categories, topics etc.
For non admin user go to API docs localhost:8000/docs/ where you can register.
After that you can login with Authorize button to access protected routes.