Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
FireFading committed Apr 21, 2023
1 parent 1480fde commit bf651ee
Showing 1 changed file with 36 additions and 17 deletions.
53 changes: 36 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## features
## Features
- JWT-authentication
- update profile with phone or name/ new email/phone/name, in registration user has only email and password, then can extend profile
- activate profile with email verification
Expand All @@ -11,37 +11,56 @@
- get all ratings from users for product
- get average rating for product
- all features tested with pytest
> ***

[Screencast from 2023-04-13 17-40-30.webm](https://user-images.githubusercontent.com/91421235/231795625-8d372fca-0d53-4d7a-b111-e41dfe8e8395.webm)

## setup
## Installation
- in env.example all variables used in project, change it to .env, several variables that are common, already define as example, secret variables is empty

## run project
- `docker compose up --build` OR `make build` - first time
- `docker compose up` OR `make up` - run without building, also you can prove -d flag to run as daemon
```bash
docker compose up --build
```
OR `make build` - first time
```bash
docker compose up
```
OR `make up` - run without building, also you can prove -d flag to run as daemon

## down docker
- `docker compose down && docker network prune --force` OR `make down`
## Down docker
```bash
docker compose down && docker network prune --force
```
OR `make down`

## database
- connect to postgres: `docker exec -it postgres psql -U postgres`
## Database
- connect to postgres
```bash
docker exec -it postgres psql -U postgres
```

## migrations
- run docker containers by commands in "run project" section
- connect to docker container: `docker exec -it fastapi bash`
- apply migrations: `alembic upgrade head` in fastapi container
- create new migrations: `alembic revision --autogenerate -m "<migration name>"` in fastapi container
> ***
## Migrations
- run docker containers
- connect to docker container
```bash
docker exec -it fastapi bash
```
- apply migrations in fastapi container
```bash
alembic upgrade head
```
- create new migrations in fastapi container
```bash
alembic revision --autogenerate -m "<migration name>"
```

## formatting and linting
## Formatting and linting
- run ufmt: `ufmt format .`
- run black: `black --config=configs/.black.toml app`
- run ruff: `ruff check --config=configs/.ruff.toml --fix app`
- run flake8: `flake8 --config=configs/.flake8 app`

- OR `nox` in root

## run tests
## Testing
- `pytest .` OR `pytest ./tests` OR run `nox`

0 comments on commit bf651ee

Please sign in to comment.