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.
- Features
- Prerequisites
- Getting Started
- API right away
- Endpoints
- Customization
- Contributing
- Licence
- Schema
- Screenshots
- CRUD operations for planetarium shows, domes, themes and reservations.
- Add images for shows
- Ticket validation based on seat availability.
Before you begin, ensure you have the following installed:
- Docker: Install Docker
- PostgreSQL: Install PostgreSQL (Optional - if you want to make changes in db before accessing API)
Follow these steps to set up and run the Planetarium API project using local project and Docker:
-
Clone this repository to your local machine:
https://github.com/mariiahorbova/planetarium-api-mate.git
-
Navigate to the project directory:
cd planetarium-api-mate
-
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
-
Build the Docker container using Docker Compose:
docker-compose build
-
Access list of containers:
docker ps -a
-
Create a superuser for accessing the Django admin panel and API:
docker exec -it <container_id here> python manage.py createsuperuser
-
Start the Docker container:
docker-compose up
-
To stop the container, use:
docker-compose down
If you would like to test API right away, these are the steps:
-
Go to cmd on Windows or terminal on Linux/Mac and pull docker image of the project:
docker pull mariiahorbova/planetarium-api
-
Access list of containers:
docker ps -a
-
Create a superuser for accessing the Django admin panel and API:
docker exec -it <container_id here> python manage.py createsuperuser
-
Start the Docker container:
docker-compose up
-
To stop the containers, use:
docker-compose down
"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/ "
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/
oruser/
directory. - Implement your own API endpoints and business logic in the Django views.
Contributions are welcome! If you find any issues or want to add enhancements, feel free to open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.