Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submission-Binary_bosses #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.log
*.pot
*.pyc
__pycache__/

.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
62 changes: 38 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
# NASA Space Apps Noida Hackathon 2023 - Hack2Skill
<h1 style="font-size: 50px"> <img style="width: 4%;margin-bottom:-10px;" src="https://github.com/Decoder2003/Space-Trek/blob/main/staticfiles/img/icon.png"> Space Trek </h1>

Welcome to the official repository for the NASA Space Apps Noida Hackathon 2023 organized by Hack2Skill!
### Team Name - Binary Bosses
### Porblem Statement - Planetary Tourism Office
### Team Leader Email - [email protected]

## Getting Started
### Brief of the Prototype:
<p> Space Trek is a space exploration company that offers space tourism tours to different planets in the solar system. It is one of the companies to offer such tours, and it is currently developing new technologies to make space travel more accessible and affordable. Space Trek tours will take passengers on a journey to some of the most iconic and mysterious places in the solar system.
</p>

To get started with the NASA Space Apps Noida Hackathon 2023 repository, follow these steps:
<img alt="website" src="https://github.com/Decoder2003/Space-Trek/blob/main/staticfiles/img/home.jpeg">

### Submission Instruction:
1. Fork this repository
2. Create a folder with your Team Name
3. Upload all the code and necessary files in the created folder
4. Upload a **README.md** file in your folder with the below mentioned informations.
5. Generate a Pull Request with your Team Name. (Example: submission-XYZ_team)
### Features
1. Users can create their user account.
2. Users can book both one-way as well as round-trip tickets.
3. Webpages are mobile responsive.
4. Users can cancel their booked tickets.
5. Users can view their previously booked tickets (Both confirmed and cancelled tickets).
6. Tickets are downloadable as pdf document.
7. Space travel training service available for the user (tourist).

### README.md must consist of the following information:
Project Demo Link - [https://tinyurl.com/Space-Trek-Demo](https://tinyurl.com/Space-Trek-Demo)

#### Team Name -
#### Problem Statement -
#### Team Leader Email -
<img alt="website" src="https://github.com/Decoder2003/Space-Trek/blob/main/staticfiles/img/web.png">

### Tech Stack:
- Python (Django==3.1.2)
- html to pdf (xhtml2pdf==0.2.5)
- Html
- Css
- JavaScript
- sqLite3 (Database)

### Step-by-Step code Execution Instruction:
- Install Python3.9 from [here](https://www.python.org/downloads/) manually.
- Install project dependencies by running `py -m pip install -r requirements.txt`.
- Run the commands `py manage.py makemigrations` and `py manage.py migrate` in the project directory to make and apply migrations.
- Create superuser with `py manage.py createsuperuser`. This step is optional.
- Run the command `py manage.py runserver` to run the web server.
- Open web browser and goto `127.0.0.1:8000` url to start using the web application.

### A Brief of the Prototype:
This section must include UML Diagrams and prototype description

### Tech Stack:
List Down all technologies used to Build the prototype

### Step-by-Step Code Execution Instructions:
This Section must contain a set of instructions required to clone and run the prototype so that it can be tested and deeply analyzed

### Future Scope:
Write about the scalability and futuristic aspects of the prototype developed
- Trip planner - with help of openAI, we will be integrating the AI to recommend trips on the basis of user interest.
- Moblie App - Looking to launch an andriod version of SpaceTrek to increase the ease-of-acces.

Project Demo Link - [https://tinyurl.com/Space-Trek-Demo](https://tinyurl.com/Space-Trek-Demo)
Binary file added db.sqlite3
Binary file not shown.
Empty file added flight/__init__.py
Empty file.
13 changes: 13 additions & 0 deletions flight/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from django.contrib import admin

from .models import *

# Register your models here.

admin.site.register(Place)
admin.site.register(Week)
admin.site.register(Flight)
admin.site.register(Passenger)
admin.site.register(User)
admin.site.register(Ticket)
admin.site.register(Training)
5 changes: 5 additions & 0 deletions flight/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class FlightConfig(AppConfig):
name = 'flight'
1 change: 1 addition & 0 deletions flight/constant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEE = 100.0
125 changes: 125 additions & 0 deletions flight/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Generated by Django 3.1.2 on 2022-07-08 23:18

import datetime
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

initial = True

dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]

operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Flight',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('depart_time', models.TimeField()),
('duration', models.DurationField(null=True)),
('arrival_time', models.TimeField()),
('plane', models.CharField(max_length=24)),
('airline', models.CharField(max_length=64)),
('economy_fare', models.FloatField(null=True)),
('business_fare', models.FloatField(null=True)),
('first_fare', models.FloatField(null=True)),
],
),
migrations.CreateModel(
name='Passenger',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(blank=True, max_length=64)),
('last_name', models.CharField(blank=True, max_length=64)),
('gender', models.CharField(blank=True, choices=[('male', 'MALE'), ('female', 'FEMALE')], max_length=20)),
],
),
migrations.CreateModel(
name='Place',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('city', models.CharField(max_length=64)),
('airport', models.CharField(max_length=64)),
('code', models.CharField(max_length=3)),
('country', models.CharField(max_length=64)),
],
),
migrations.CreateModel(
name='Week',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('number', models.IntegerField()),
('name', models.CharField(max_length=16)),
],
),
migrations.CreateModel(
name='Ticket',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ref_no', models.CharField(max_length=6, unique=True)),
('flight_ddate', models.DateField(blank=True, null=True)),
('flight_adate', models.DateField(blank=True, null=True)),
('flight_fare', models.FloatField(blank=True, null=True)),
('other_charges', models.FloatField(blank=True, null=True)),
('coupon_used', models.CharField(blank=True, max_length=15)),
('coupon_discount', models.FloatField(default=0.0)),
('total_fare', models.FloatField(blank=True, null=True)),
('seat_class', models.CharField(choices=[('economy', 'Economy'), ('business', 'Business'), ('first', 'First')], max_length=20)),
('booking_date', models.DateTimeField(default=datetime.datetime.now)),
('mobile', models.CharField(blank=True, max_length=20)),
('email', models.EmailField(blank=True, max_length=45)),
('status', models.CharField(choices=[('PENDING', 'Pending'), ('CONFIRMED', 'Confirmed'), ('CANCELLED', 'Cancelled')], max_length=45)),
('flight', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to='flight.flight')),
('passengers', models.ManyToManyField(related_name='flight_tickets', to='flight.Passenger')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='bookings', to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='flight',
name='depart_day',
field=models.ManyToManyField(related_name='flights_of_the_day', to='flight.Week'),
),
migrations.AddField(
model_name='flight',
name='destination',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arrivals', to='flight.place'),
),
migrations.AddField(
model_name='flight',
name='origin',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='departures', to='flight.place'),
),
]
23 changes: 23 additions & 0 deletions flight/migrations/0002_auto_20231007_2258.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.1.2 on 2023-10-07 17:28

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('flight', '0001_initial'),
]

operations = [
migrations.RenameField(
model_name='place',
old_name='airport',
new_name='landingSite',
),
migrations.RenameField(
model_name='place',
old_name='country',
new_name='planet',
),
]
17 changes: 17 additions & 0 deletions flight/migrations/0003_remove_place_city.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.1.2 on 2023-10-07 23:06

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('flight', '0002_auto_20231007_2258'),
]

operations = [
migrations.RemoveField(
model_name='place',
name='city',
),
]
35 changes: 35 additions & 0 deletions flight/migrations/0004_training.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 3.1.2 on 2023-10-07 23:15

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('flight', '0003_remove_place_city'),
]

operations = [
migrations.CreateModel(
name='Training',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ref_no', models.CharField(max_length=6, unique=True)),
('course_sdate', models.DateField(blank=True, null=True)),
('course_edate_adate', models.DateField(blank=True, null=True)),
('course_fare', models.FloatField(blank=True, null=True)),
('other_charges', models.FloatField(blank=True, null=True)),
('coupon_used', models.CharField(blank=True, max_length=15)),
('coupon_discount', models.FloatField(default=0.0)),
('total_fare', models.FloatField(blank=True, null=True)),
('booking_date', models.DateTimeField(default=datetime.datetime.now)),
('mobile', models.CharField(blank=True, max_length=20)),
('email', models.EmailField(blank=True, max_length=45)),
('status', models.CharField(choices=[('PENDING', 'Pending'), ('CONFIRMED', 'Confirmed'), ('CANCELLED', 'Cancelled')], max_length=45)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='trainings', to=settings.AUTH_USER_MODEL)),
],
),
]
18 changes: 18 additions & 0 deletions flight/migrations/0005_place_city.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.2 on 2023-10-07 23:17

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('flight', '0004_training'),
]

operations = [
migrations.AddField(
model_name='place',
name='city',
field=models.CharField(max_length=64, null=True),
),
]
18 changes: 18 additions & 0 deletions flight/migrations/0006_training_desc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.2 on 2023-10-07 23:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('flight', '0005_place_city'),
]

operations = [
migrations.AddField(
model_name='training',
name='desc',
field=models.TextField(default=''),
),
]
17 changes: 17 additions & 0 deletions flight/migrations/0007_remove_ticket_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.1.2 on 2023-10-07 23:46

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('flight', '0006_training_desc'),
]

operations = [
migrations.RemoveField(
model_name='ticket',
name='user',
),
]
24 changes: 24 additions & 0 deletions flight/migrations/0008_auto_20231008_0516.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.1.2 on 2023-10-07 23:46

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('flight', '0007_remove_ticket_user'),
]

operations = [
migrations.RemoveField(
model_name='training',
name='user',
),
migrations.AddField(
model_name='ticket',
name='user',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='bookings', to=settings.AUTH_USER_MODEL),
),
]
Loading