Tamieem / subway-surfer

A simulation of train-station API endpoints written in Typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Bless this open-source tool that provided a good skeleton with CRUD entry points for this REST API project that I, Tamieem Jaffary, have created myself.

This is my first time ever using TypeScript for a project for the record. I learned everything I've done for this project while I was doing it. So apologies if my instructions are not thorough or incorrect. I tried to make a dockerized container with all of my necessary files and image configurations.

My Task was to model the subway system

Installation

$ npm install

Running the app

# First must build docker volume
$ docker-compose up

# development
$ npm start

Current Endpoints

These endpoints were hosted on localhost:3000 for me. I'm going to make the assumption that it will be the same when it is tested.

POST /train-line -- Creates A train with its listed stations
stations - each station (or stop) on the train line
name - of the train line
fare - The cost of taking this train

POST /train-line
{
"stations": ["Canal", "Houston", "Christopher", "14th"],
"name": "1"
"fare": 2.75
}



GET /ride/[originStation]/[destinationStation]  -- Returns the optimal station list from the origin station to the destination station


POST /card -- Creates/Updates a Debit Card in the database with a balance 
number - The Card number to create/update
balance - the amount to add on to the card
{
"number": "1234",
"balance": 10.0
}

To Simulate a Ride:

POST /ride/[station]/enter
POST /ride/[station]/exit

I have also included my Postman collection, "Subway Surfer.postman_collections.json" which I used to test the required endpoints in the project as a reference if necessary.

If You've Made It This Far

I'd like to take this moment in my Readme to thank you guys for looking into my project. It was challenging but also fun and exciting. It motivated me to build something robust and substantial like this and practice my genuine software engineering skills.

About

A simulation of train-station API endpoints written in Typescript

License:GNU General Public License v3.0


Languages

Language:TypeScript 100.0%