Code Monkey home page Code Monkey logo

cinema-api's Introduction

Cinema Service API

Installation using GitHub

Before you begin, make sure you have Python and PostgreSQL installed on your computer. To do this, run the following commands:

python3 --version
psql --version 

The command output should be Python and PostgreSQL versions, respectively. If it is not, you need to install Python and PostgreSQL on your computer. If everything is ok, follow these steps:

  1. Clone the project repository to your computer using the following command:

    git clone https://github.com/bihunva/cinema-api.git
  2. Create and activate a virtual environment (venv) by running the following commands:

    python3 -m venv venv
    source venv/bin/activate # for Unix-based systems
    venv\Scripts\activate # for Windows
  3. Install the necessary dependencies by running the following command:

    pip install -r requirements.txt
  4. Set the following environment variables in your shell or IDE to run the project:

    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 SECRET_KEY=YOUR_SECRET_KEY
  5. Apply all required migrations by running the following command:

    python manage.py migrate
  6. Start the local server by running the following command:

    python manage.py runserver

Installation using Docker

Before you begin, make sure you have Docker installed on your computer. To do this, run the following command:

docker --version

The result of the execution should be the docker version. If it is not, install docker on your computer, if everything is ok, follow these steps:

  1. Clone the project repository to your computer using the following command:

    git clone https://github.com/bihunva/cinema-api.git
  2. Add the .env file to the root of the project. In this file you must specify the values of the environment variables, an example is in the file .env.sample.

  3. Build Docker images by running the following command:

    docker-compose build
  4. Run Docker containers by running the following command:

    docker-compose up

Getting Access

To get access to Cinema Service API, you need to create a user account and obtain an access token.

User creating - send a POST request to /api/user/register/
Obtain token - send a POST request to /api/user/token/

Features

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

cinema-api's People

Contributors

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