Giter Site home page Giter Site logo

shoaib749 / irctc-backened Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 88 KB

This application is developed in Spring Boot and provides APIs for train booking. It utilizes MySQL as the database for storing data. The application receives requests from the frontend and responds with JSON data.

Java 100.00%
api-rest irctc-website-replica java mysql-database spring spring-boot

irctc-backened's Introduction

-----------------------------------------------------

➤ IRCTC-Backened

-----------------------------------------------------

➤ Spring Boot Application - Train Booking API

This application is developed in Spring Boot and provides APIs for train booking. It utilizes MySQL as the database for storing data. The application receives requests from the frontend and responds with JSON data.

-----------------------------------------------------

➤ API Endpoints

  1. Endpoint: /

    • Method: GET
    • Description: Retrieves the booking started date.
    • Response: JSON containing the booking started date (startDate).
  2. Endpoint: /adminLogin

    • Method: POST
    • Description: Authenticates the admin user.
    • Request Body:
      • username (string): Admin username.
      • password (string): Admin password.
  3. Endpoint: /addTrain

    • Method: POST
    • Description: Adds a new train.
    • Request Body:
      • trainNo (int): Train number.
      • trainName (string): Train name.
      • startStation (Station): Starting station.
      • stopStation (Station): Destination station.
      • numberOfSeats (int): Total number of seats.
      • fare (int): Fare for the train.
  4. Endpoint: /addStation

    • Method: POST
    • Description: Adds a new station.
    • Request Body:
      • stationCode (int): Station code.
      • stationName (string): Station name.
  5. Endpoint: /showTrain

    • Method: GET
    • Description: Retrieves all trains.
    • Response: JSON array containing all train details (trainList).
  6. Endpoint: /userRegister

    • Method: POST
    • Description: Registers a new user.
    • Request Body:
      • userFullName (string): Full name of the user.
      • userName (string): User's username.
      • password (string): User's password.
  7. Endpoint: /userLogin

    • Method: POST
    • Description: Authenticates the user.
    • Request Body:
      • username (string): User's username.
      • password (string): User's password.
  8. Endpoint: /book/showTrain

    • Method: POST
    • Description: Retrieves available trains based on start and stop stations and date.
    • Request Body:
      • startStation (string): Start station name.
      • stopStation (string): Stop station name.
      • date (Date): Date of travel.
    • Response: JSON array containing available train details (trainList).
  9. Endpoint: /book/ticketBooking

    • Method: POST
    • Description: Books a ticket for a user.
    • Request Body:
      • userId (int): User ID.
      • logId (long): Login ID.
      • noOfPassengers (int): Number of passengers.
    • Response: JSON containing the booking details (bookingDetails).
  10. Endpoint: /user/showMyTickets

    • Method: POST
    • Description: Retrieves tickets booked by a user.
    • Request Body:
      • userId (int): User ID.
    • Response: JSON array containing the booked ticket details (ticketList).

-----------------------------------------------------

➤ Getting Started

To run this application locally, follow these steps:

  1. Clone the repository:
git clone https://github.com/shoaib749/IRCTC-Backened.git
  1. Navigate to

the project directory:

cd train-booking-api
  1. Build the project:
./mvnw clean package
  1. Run the application:
./mvnw spring-boot:run

The application will start running on http://localhost:8080.

Remember to configure the MySQL database connection details in the application.properties file.

-----------------------------------------------------

➤ Dependencies

The following dependencies are used in this Spring Boot application:

  • Spring Web
  • Spring Data JPA
  • MySQL Driver

These dependencies are managed through Maven. The required dependencies will be automatically downloaded when building the project.

irctc-backened's People

Contributors

shoaib749 avatar

Stargazers

 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.