/Railway-Database-Management-Project

Railway Ticketing Management System | Database: Oracle-19c | BackEnd: Django Framework | Query Language: ORM | Front-End: Javascript,CSS,HTML5

Primary LanguageCSSMozilla Public License 2.0MPL-2.0

GitHub Org's stars GitHub forks GitHub issues GitHub pull requests GitHub watchers GitHub Sponsors GitHub GitHub last commit GitHub language count Lines of code GitHub repo size


How to install this project to run in localhost from your pc

!! important reminder

Django Only supports Oracle Database version 12c or above & we have performed this project in oracle 19c version
So download oracle 19c from this official site

After installing oracle database, need to create a user & grant some previlieges to handle this database. I have created a script for your convinence, run this script in any online python ide & copy the output & paste in your SQL PLUS
x = '''
CREATE USER <user_name> IDENTIFIED BY <password>;
GRANT CONNECT,RESOURCE,DBA TO <user_name>; 
GRANT CREATE SESSION TO <user_name> WITH ADMIN OPTION;
GRANT UNLIMITED TABLESPACE TO <user_name>;
GRANT "IMP_FULL_DATABASE" TO <user_name> ;
GRANT "EXP_FULL_DATABASE" TO <user_name> ;
GRANT "CONNECT" TO <user_name> ;
GRANT "RESOURCE" TO <user_name> ;
GRANT "DATAPUMP_EXP_FULL_DATABASE" TO <user_name> ;
GRANT "DATAPUMP_IMP_FULL_DATABASE" TO <user_name> ;
GRANT "AUTHENTICATEDUSER" TO <user_name> ;
'''
y = x.replace("<user_name>","c##SuperMan")
print(y.replace("<password>","Masum")) 
Here in replace section, Give your desired name of database user & password otherwise left it as it is.
One thing to be noted,user name must start with c## in oracle database to be common user

Now make a connection via SQL Developer/DataGrip (btw jetbrains DataGrip is used by me) where SID will be orcl and port 1521 and username & password will be newly created user & password. Here i have attached a DEMO of Database Connection

All set,now download our project from this gihub link
After opening this project in vs-code or pycharm. Open Railway > settings.py you will see something like this:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.oracle',
        'NAME': 'orcl',
        'USER': 'c##SuperMan',
        'PASSWORD': 'MasumBhai',
        'HOST': 'localhost',
        'PORT': '1521',
    }
}
Make sure that this database username and password are matched with your newly created user, password chekout my stackoverflow answer

Now few things need to install in your project terminal Or you can do it in command-prompt. Type these:
pip install Django
pip install django-debug-toolbar
pip install django-phone-field
pip install cx-oracle
if you see this error: ‘pip’ is not recognized as an internal or external command, then first you need to install pip help link to install pip

Now open project terminal & make sure all these below commands are running from where manage.py file is located. In our project it's inside Railway foldeer. Here is a helping image. Here django project is Railway and we used one app named train
py manage.py makemigrations 
py manage.py migrate
py manage.py runserver

All right. All setUp. Explore the site !! But when you will click the DashBoard For Admin You will see a LogIn Page For Admin. To Be an Admin , you have to create superuser from terminal.
Again in terminal, type:

ctrl+pause/break or ctrl+C to stop the runserver

To create superuser, follow my stackoverflow answer or just simply type in project terminal:

py manage.py createsuperuser

After successfully creating superuser run the server via

py manage.py runserver

and then click the 'DashBoard for admin' in header. Now give the username & password of newly created superuser.
Bhaiola!! You are now admin!! You can control this fully responsive webapp

At the begining no data is inserted, so you have to insert data manually in two table. Route & Train_info
The reason is: visitor will not control/monitor the route & train infos data, it's admin's work. here i have attached a demo data sheet of route & train infos. And when deleting users records, you have to follow this sequence (according to schema diagram):
First need to delete transections -> ticket -> passenger -> user

If any problem arises, just create an issue in this repository, I will try to figure that out.

After Payment Confirmation, End Product of this web-app

End Product as QR Code


admin_panel


Bill_details


Bill_details2


coming_soon


Footer


Index-Page


payment_info


payment_information


schedule


special_offer


traveller_info