Coder Social home page Coder Social logo

uber's Introduction

Notes: https://drive.google.com/file/d/1WsrfjzPwtE1d-z94SeVRdOscReeliPQN/view?usp=sharing

Project Setup

  • Create project here Spring Boot Starter
  • Dependencies
    • all dev (lombok, dev, config)
    • web mvc
    • data-rest
    • jpa (lombok)
    • postgresql driver
    • spring security
    • spring sessions
  • download the zip, open in your editor
  • setup DB config in uber/src/main/resources/application.properties

DB Setup for Local Dev

Enter the postgres shell: sudo -u postgres psql List users (in psql) \l List databases (in psql) \du Quit the psql shell \q

Create a new DB (in psql) CREATE DATABASE uber; Delete a new DB (in psql) DROP DATABASE uber;

Create a new user with password and db create-write and superuser permissions (shell): sudo -u postgres createuser -d -l -s -P uberadmin Delete user (shell) sudo -u postgres dropuser username

Other Notes

class Driver:
    @OneToOne
	account: Account   # in the driver table, create a col account_id

    @OneToMany
	bookings: [Booking]  # bookings table, driver_id
    # Rohan.bookings()
    # GET * from Booking
    # where user_id = RohanId

class Passenger:
    account: Account
    bookings: [Booking]

class Account:
	# can be for a driver
    # can be for a passenger

class Booking:
    @ManyToOne
    driver: Driver
    passenger: Passenger

Driver 1 - * Booking Passenger 1 - * Booking Driver 1 - 1 Account Passenger 1 - 1 Account

Python - SQLAlchemy ORM - forces you to define relations both ways Django ORM - allows you to define one way relations

ORM is just an abstractions DBs are truth tables with constraints

every row in a table denotes a truth

uber's People

Contributors

agarwalpragy avatar

Watchers

James Cloos 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.