Git Product home page Git Product logo

week-8-sherinolivia's Introduction

Week 8 Assignment Overview

For Week 8's Assignment, we are to create a simple REST API Server using Express.js, Typescript, and Node.js, and then deployed through Railway or Render or any other back-end deployment platform.

  • Start the project by creating necessary folders: mkdir controllers src data assets
  • And or files with: touch app.ts .gitignore, etc.
  • Create a package.json file that will be used to describe your app: npm init -y
  • Install all the needed dependencies (general): npm i dotenv body-parser express
  • Install all the needed dependencies for development side (DevDependencies): npm i -D @types/dotenv @types/express @types/nodes concurrently nodemon typescript
  • Include necessary steps in your script, such as: "dev": "concurrently \"npx tsc --watch\" \"nodemon dist/app.js\" (this particular script will allows you to run 2 commands simultaneously.To run the command, use: npm run dev)

API Endpoints

roofinancetracker-prod.up.railway.app/

Name HTTP Method Endpoint
Homepage GET /
List All Transaction Data GET /transactions
Get Transaction Data by ID GET /transactions/:id
Create New Transaction Data POST /transactions
Update Whole Transaction Data by ID PUT /transactions/:id
Update Transaction Type by ID PATCH /transactions/ttype/:id
Update Transaction Name by ID PATCH /transactions/tname/:id
Update Transaction Detail by ID PATCH /transactions/tdetail/:id
Update Transaction Amount by ID PATCH /transactions/tamount/:id
Delete Transaction Data by ID DELETE /transactions/:id

Postman & Thunder Client

Through Postman or Thunder Client, we will be able to test our API's routing and codes to ensure functionalities.

Postman : an API platform for building and using APIs

postman-download

  1. To download postman, head to postman.com

postman-overview

Although we don't have to create an account for Postman, creating one will allow us to access workspace, a sidebar space where we can create and store our API requests for easier and faster testing.

postman-createaccount

  1. An example of neat workspace

postman-workspace

Thunder Client : a lightweight GUI based Rest API Client Extension for Visual Studio Code

An alternative to Postman, Thunder Client can be easily installed by going to `extensions` in VSCode.

Deployement through Railway

Railway : a Platform as a Service (PaaS) that offers a complete platform for building and delivering programs to the backend of the cloud. Which means Railway is one of the many options where we can deploy our back-end codes.

  1. First, head to railway.app, and click login with github account.
  • railway-web
  • railway-login
  1. Click New Project and the github repository that houses your backend sourcecode railway-newproject railway-projectrepo

  2. Railway will proceed to start building and deploying your project, when completed, you may set the website name and or custom domain railway-domainname

  3. Your project is ready for use.

Contact Me:

[email protected] [Personal]

[email protected] [Work]

Roo-DiscordRoo-InstagramRoo-LinkedIn

week-8-sherinolivia's People

Contributors

sherinolivia avatar andarpratama avatar github-classroom[bot] avatar

Watchers

Alvian Zachry Faturrahman avatar

Forkers

sherinolivia

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.