Code Monkey home page Code Monkey logo

cinema-api's Introduction

Cinema API

DRF project where implemented basic api logic for creating movies with genres and actors, movie sessions, and orders with tickets for this movie sessions.
PosgtreSQL used as DB and Docker with docker-compose for DB and API

Prerequisites

๐Ÿ‘‰ You should have Docker installed on your local machine link

Installing instructions

๐Ÿ‘‰ Clone this repository

$ git clone [email protected]:kuznetsb/cinema-api.git

๐Ÿ‘‰ Configure environmental variables

$ create .env file in project directory
$ Use .env.sample as template and copy all those DB variables to .env
$ fill DB variables with your values in .env file (exmaple: POSTGRES_DB=app)

Now your Postgres database will be configured properly


๐Ÿ‘‰ Run docker-compose

$ docker-compose up

That will run application with all installed dependencies, database and so on. Now you can use API!

Usage instructions

๐Ÿ‘‰ At this point, the app runs at http://127.0.0.1:8000/


๐Ÿ‘‰ Go to /api/doc/swagger/ to see documentation with endpoints ```bash $ /api/user/register/ to create new user $ /api/user/token/ to authorize after creating and get token $ /api/user/token/reftesh/ to refresh access token when it goes out of time ```

๐Ÿ‘‰ Note: API has ReadOnly restrictions for non-staff users
If you want to try all functionality follow next steps:

$ run docker exec -it <container_id> sh in terminal
$ run python manage.py createsuperuser and follow next steps

Now you can use staff user, just do 2 and 3 steps from instruction for non-staff user

Features

  • JWT authenticated
  • Admin panel /admin/
  • Documentation is located at /api/doc/swagger/
  • Managing orders and tickets
  • Creating movies with genres, actors
  • Creating cinema halls
  • Adding movie sessions
  • Filtering movies and movie sessions

DEMO api endpoints

Image Image

cinema-api's People

Contributors

kuznetsb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.