https://github.com/sinisaos/headless-forum-fastapi
Backend for simple forum made with FastAPI and Piccolo ORM ecosystem.
https://github.com/sinisaos/headless-forum-fastapi
fastapi orm piccolo
Last synced: 12 months ago
JSON representation
Backend for simple forum made with FastAPI and Piccolo ORM ecosystem.
- Host: GitHub
- URL: https://github.com/sinisaos/headless-forum-fastapi
- Owner: sinisaos
- License: mit
- Created: 2020-12-11T05:11:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T17:16:32.000Z (about 2 years ago)
- Last Synced: 2025-06-22T06:06:12.187Z (12 months ago)
- Topics: fastapi, orm, piccolo
- Language: Python
- Homepage:
- Size: 286 KB
- Stars: 29
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Backend for simple forum made with [FastAPI](https://fastapi.tiangolo.com/) and [Piccolo ORM](https://www.piccolo-orm.com/) ecosystem.
-------------------------------------------------------
### Instalation
Clone repository in fresh virtualenv.
```bash
git clone https://github.com/sinisaos/headless-forum-fastapi.git
```
### Install requirements
```bash
cd headless-forum-fastapi
pip install -r requirements/requirements.txt
```
### Create database
```bash
sudo -i -u yourpostgresusername psql
CREATE DATABASE forum;
\q;
```
### Setup
-------------------------------------------------------
Create ``.env`` file in root of the project.
```bash
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
```
### Migrations
```bash
./scripts/migrations.sh
```
### Create admin user
```bash
./scripts/user.sh
```
### Testing
Install test requirements.
```bash
pip install -r requirements/test-requirements.txt
```
Run tests.
```bash
./scripts/test.sh
```
### Linting
```bash
./scripts/lint.sh
```
### Getting started
```bash
./scripts/start.sh
```
After site is running log in as admin user on [localhost:8000/admin/](http://localhost:8000/admin/) and add categories, topics etc.
For non admin user go to API docs [localhost:8000/docs/](http://localhost:8000/docs/) where you can register.
After that you can login with Authorize button to access protected routes.