https://github.com/zeroniki/movie-database
This is a web application on Fastapi that displays movies
https://github.com/zeroniki/movie-database
alembic fastapi fastapi-sqlalchemy fastapi-users postgresql python python3 sqlalchemy
Last synced: 10 days ago
JSON representation
This is a web application on Fastapi that displays movies
- Host: GitHub
- URL: https://github.com/zeroniki/movie-database
- Owner: ZeroNiki
- Created: 2024-08-28T12:19:15.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-11T08:35:26.000Z (9 months ago)
- Last Synced: 2025-03-21T23:43:42.921Z (3 months ago)
- Topics: alembic, fastapi, fastapi-sqlalchemy, fastapi-users, postgresql, python, python3, sqlalchemy
- Language: Python
- Homepage:
- Size: 1.87 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Movie Database
## Navigation
[RU README.md](https://github.com/ZeroNiki/Movie-Database/blob/main/RU_README.md)
- [About](#About)
- [Install](#Install)
- [About the database](#About-the-database)
- [Alembic migrations](#Alembic-migrations)
- [Where did I get the data from?](#Where-did-I-get-the-data-from?)
- [Architecture of the project](#Architecture-of-the-project)
- [Routes](#Routes)
- [TODO](#TODO)## About
lib:
- fastapi
- fastapi_users
- sqlalchemy (for postgresql)
- alembicThis is a web application for displaying movies. It is possible to register and authorize the user
## Install
```bash
git clone https://github.com/ZeroNiki/Movie-Database.git
cd git
```
configure [.env](https://github.com/ZeroNiki/Movie-Database/blob/main/.env) file:
```
DATABASE=xxxx
USER=xxxx
HOST=xxxx
PASSWORD=xxxx
PORT=xxxxAUTH_TOKEN=xxxx
````Database` - Name of your database
`User` - User of your database
`HOST` - Host of your database (by default `localhost`)
`PASSWORD` - Password of your database (by default `postgres`)
`PORT` - Port of your database (by default `5432`)`AUTH_TOKEN` - Here you can use the token generator
Create virtual environment:
```bash
python3 -m venv venvpip install -r requirements.txt
source venv/bin/activate
```If you use Windows 10:
```bash
python -m venv venvpip install -r requirements.txt
venv\Scripts\activate
```Once you have configured the [.env](https://github.com/ZeroNiki/Movie-Database/blob/main/.env) file and create venv you can start running the application:
```bash
uvicorn src.main:app --reload
```
go to http://127.0.0.1:8000
## About the database
**PostgreSQL** is used as a database
The bd template is found in [Database example](https://github.com/ZeroNiki/Movie-Database/tree/main/Database%20example) dir### Alembic migrations
**first create a directory `versions` in `migrations/`**
```bash
mkdir migrations/versionsalembic revision --autogenerate -m "First init"
alembic upgrade head
```### Where did I get the data from?
Taken from the API of this [resource](https://developer.themoviedb.org/docs/getting-started)
## Architecture of the project
```
src
├── auth
│ └── ...
├── operations
│ └── ...
├── pages
│ └── ...
├── static
│ ├── css
│ │ └── ...
│ └── Favicon
│ └── ...
└── templates
└── ...
````src/auth` - Everything in this folder is intended for user authorization
`src/operations` - Designed for interaction with the database
`src/pages` - For pages
`src/static` - For static files (css, js, media content)
`src/templates` - For html### Routes
`/pages/home/` - home page
`/pages/search?q={keyword}` - search page
`/pages/movie/{movie_id}` - movie page
`/pages/register` - Signup page
`/pages/login` - Login page## TODO
- [ ] 5 September 2024 `Finalize role for users`
- [x] 4 September 2024 `Fix minor bugs in nav`
- [x] 2 September 2024 `link auth to front-end`
- [x] 2 September 2024 `Add auth`
- [x] 1 September 2024 `Finalize the /pages/movie/{id}`
- [x] 30 August 2024 `Fix the display text in /pages/search?q={query}`