Giter Site home page Giter Site logo

planetarium-api's Introduction

Planetarium API Service

Planetarium API Service is a Django-based RESTful API for managing planetarium shows, themes, reservations and more. It provides endpoints for creating, updating, and retrieving show-related data, as well as user registration and order useful things.

Table of Contents

Features:

  • CRUD operations for planetarium shows, domes, themes and reservations.
  • Add images for shows
  • Ticket validation based on seat availability.

Prerequisites

Before you begin, ensure you have the following installed:

Getting Started

Follow these steps to set up and run the Planetarium API project using local project and Docker:

  1. Clone this repository to your local machine:

    https://github.com/mariiahorbova/planetarium-api-mate.git

  2. Navigate to the project directory: cd planetarium-api-mate

  3. Create .env file and define environmental variables by following .env_example:

SECRET_KEY = your_secret_key  
DEBUG = your_debug_value  
POSTGRES_NAME=your_db_name  
POSTGRES_USER=your_db_user  
POSTGRES_PASSWORD=your_db_password  
POSTGRES_HOST=your_db_host
  1. Build the Docker container using Docker Compose:

    docker-compose build

  2. Access list of containers:

    docker ps -a

  3. Create a superuser for accessing the Django admin panel and API:

    docker exec -it <container_id here> python manage.py createsuperuser

  4. Start the Docker container:

    docker-compose up

  5. To stop the container, use:

    docker-compose down

API right away

If you would like to test API right away, these are the steps:

  1. Go to cmd on Windows or terminal on Linux/Mac and pull docker image of the project:

    docker pull mariiahorbova/planetarium-api

  2. Access list of containers:

    docker ps -a

  3. Create a superuser for accessing the Django admin panel and API:

    docker exec -it <container_id here> python manage.py createsuperuser

  4. Start the Docker container:

    docker-compose up

  5. To stop the containers, use:

    docker-compose down

Endpoints

	"themes":	 "http://127.0.0.1:8000/api/planetarium/themes/"
	"planetariums":  "http://127.0.0.1:8000/api/planetarium/planetariums/"
	"shows":	 "http://127.0.0.1:8000/api/planetarium/shows/"
	"show_sessions": "http://127.0.0.1:8000/api/planetarium/show_sessions/",  
	"reservations":  "http://127.0.0.1:8000/api/planetarium/reservations/" 

	"registration"	 "http://127.0.0.1:8000/api/user/register/"
	"access token"	 "http://127.0.0.1:8000/api/user/token/"
	"regain token"	 "http://127.0.0.1:8000/api/user/token/refresh/"
	"verify token"	 "http://127.0.0.1:8000/api/user/token/verify/"

	"documentatoin": "http://127.0.0.1:8000/api/schema/" 
			 "http://127.0.0.1:8000/api/schema/swagger-ui/" 
			 "http://127.0.0.1:8000/api/schema/redoc/ "

Customization

You can customize this setup to fit your project's needs:

  • Modify the Dockerfile to include additional dependencies or configurations.
  • Adjust the docker-compose.yml file to change container names, ports, or other settings.
  • Extend the Django application by adding new models, views, and serializers in the planetarium/ or user/ directory.
  • Implement your own API endpoints and business logic in the Django views.

Contributing

Contributions are welcome! If you find any issues or want to add enhancements, feel free to open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Schema

schema

Screenshots

image_2023-08-10_21-28-04 image_2023-08-10_21-28-18 image_2023-08-10_21-28-55 image_2023-08-10_21-30-54 image_2023-08-10_21-31-47 image_2023-08-10_21-32-47

planetarium-api's People

Contributors

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