Git Product home page Git Product logo

ticket-booking-platform---udaan-dev-challenge's Introduction

Ticket-Booking-Platform - Udaan-dev-challenge

This project is made for Udaan Developer Challenge.

About the project

This project contains the API of the Ticket Booking Platform 🎫.

Technology Stack

NodeJS with Express is used as framework for the development of the application.

Database: MySql

ORM used: Sequelize

Installation

  1. In the console, download a copy of the repo by running git clone https://github.com/gauravano/Ticket-Booking-Platform---Udaan-dev-challenge.git.

  2. Enter the new Ticket-Booking-Platform---Udaan-dev-challenge directory with cd Ticket-Booking-Platform---Udaan-dev-challenge.

3.[Optional] For syncing the MySql database locally:

  1. Uncomment these lines https://github.com/gauravano/Ticket-Booking-Platform---Udaan-dev- challenge/blob/e408e6f8dec13bdc16885d4b85c41bc558a08e33/db.js#L14-L22
  2. Comment these lines https://github.com/gauravano/Ticket-Booking-Platform---Udaan-dev- challenge/blob/e408e6f8dec13bdc16885d4b85c41bc558a08e33/db.js#L2-L11
  3. Copy the below lines in terminal after running sudo mysql in terminal:
 create database ticketing;
 create user gaurav_ticketing identified by 'Ticketing 1';
 use ticketing;
 grant all privileges on ticketing to gaurav_ticketing;
 grant all privileges on ticketing.* to gaurav_ticketing;
  1. Run npm start or node server for a running development server. Navigate to http://localhost:9090/.

Development server

Run npm start or node server for a running development server. Navigate to http://localhost:9090/.

Screenshots

The Booking platform API is live at https://ticketing-udaan.herokuapp.com/ .

api for posting screen details API for posting screen(movie) details

api for reserving tickets API for reserving movie tickets

api for getting data API for fetching reserved/unreserved seats

If you have any question regarding this project feel free to open a new issue. Thanks!

ticket-booking-platform---udaan-dev-challenge's People

Contributors

grvsachdeva avatar

Stargazers

 avatar  avatar  avatar  avatar

ticket-booking-platform---udaan-dev-challenge's Issues

Getting error in the POST request http://localhost:9090/screens/

I followed the steps as per the Readme and got the db synced. But on running this POST request " http://localhost:9090/screens/" in postman and giving the same input in body as in the screenshot, I am getting back this error.

Input given :

{ "name":"inox", "seatInfo": { "A": { "numberOfSeats": 10, "aisleSeats": [0, 5 ,6, 9] }, "B": { "numberOfSeats": 15, "aisleSeats": [0, 5 ,6, 9] }, "D": { "numberOfSeats": 20, "aisleSeats": [0, 5 ,6, 9] } } }

Error:

`

<title>Error</title>
TypeError: Cannot read property 'A' of undefined
            
   at C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\routes\api\**screens.js:7:40**
   at Layer.handle [as handle_request] (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\layer.js:95:5)
   at next (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\route.js:137:13)
   at Route.dispatch (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\route.js:112:3)
   at Layer.handle [as handle_request] (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\layer.js:95:5)
   at C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:281:22
   at Function.process_params (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:335:12)
   at next (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:275:10)
   at Function.handle (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:174:3)
   at router (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:47:12)
   at Layer.handle [as handle_request] (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\layer.js:95:5)
   at trim_prefix (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:317:13)
   at C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:284:7
   at Function.process_params (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:335:12)
   at next (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:275:10)
   at Function.handle (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:174:3)
   at router (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:47:12)
   at Layer.handle [as handle_request] (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\layer.js:95:5)
   at trim_prefix (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:317:13)
   at C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:284:7
   at Function.process_params (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:335:12)
   at next (C:\Users\Deepesh\Environments\Ticket-Booking-Platform---Udaan-dev-challenge\node_modules\express\lib\router\index.js:275:10)
`

It says "Cannot read property 'A' of undefined", though I can't figure out what is wrong in the code as I provided the correct input in the body in postman. Please help.

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.