Giter Site home page Giter Site logo

cinema-api's Introduction

cinema-API

Cinema API is an API service for cinema management, written using the Django Rest Framework (DRF). It allows you to manage various aspects of a cinema, including creating and managing movies, cinema halls, movie sessions, orders, and tickets.

Installation

To install Cinema API using GitHub, follow these steps:

  • Install PostgreSQL and create a database.
  • Clone the repository by running the following command:
    git clone https://github.com/ZabFTFT/cinema-API.git
  • Change to the cloned repository directory by running:
    cd cinema-api
  • Create a new virtual environment by running:
    python -m venv venv
  • Activate the virtual environment by running:
    Windows: venv\Scripts\activate
    
    Linux/MacOs: source venv/bin/activate
  • Install the required packages by running:
    pip install -r requirements.txt
  • Set the required environment variables in .env file(use .env.sample) OR
  • Set the required environment variables by running the following commands:
    For Windows: use <set> <env_variable>
    
    set DB_HOST=YOUR_DB_HOSTNAME
    set DB_NAME=YOUR_DB_NAME
    set DB_USER=YOUR_DB_USER
    set DB_PASSWORD=YOUR_DB_PASSWORD
    set DB_SECRET_KEY=YOUR_SECRET_KEY
    set DJANGO_SECRET_KEY=DJANGO_SECRET_KEY
    set ALLOWED_HOSTS=ALLOWED_HOSTS
    set DEBUG=DEBUG
    For Linux/MacOS: use <export> <env_variable>
    
    export DB_HOST=YOUR_DB_HOSTNAME
    export DB_NAME=YOUR_DB_NAME
    export DB_USER=YOUR_DB_USER
    export DB_PASSWORD=YOUR_DB_PASSWORD
    export DB_SECRET_KEY=YOUR_SECRET_KEY
    export DJANGO_SECRET_KEY=DJANGO_SECRET_KEY
    export ALLOWED_HOSTS=ALLOWED_HOSTS
    export DEBUG=DEBUG
  • Apply the database migrations by running:
    python manage.py migrate
  • Start the development server by running:
    python manage.py runserver

Alternatively, you can run Cinema API using Docker:

  • Install Docker.
  • Clone the repository and change to the cloned repository directory.
  • Build the Docker image by running:
    docker-compose build
    
    docker-compose up

Getting Access

  • To get access to Cinema API, you need to create a user account and
    obtain an access token.
  • Create a new user by sending a POST request to /api/user/register/
    with the required user details in the request body.
  • Obtain an access token by sending a POST request to /api/user/token/
    with the user's email and password in the request body.

Features

  • JWT authentication
  • Admin panel at /admin/
  • API documentation at /api/doc/swagger/
  • Management of orders and tickets
  • Creation of movies with genres and actors
  • Creation of cinema halls
  • Addition of movie sessions
  • Filtering of movies and movie sessions

Demo

cinema.png user.png detail.png

cinema-api's People

Contributors

zabftft 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.