Giter Club home page Giter Club logo

car-stolen-report-app's Introduction

Stolen Cars Complain App

Note: Authentication is not added, only API Endpoints are there

Since Authentication is not there i'm displaying as two different page one for complains and other for police login

Run the project --> npm run dev

Workflow:

  1. On Login of the Officer we are assigning the un-assigned complains to his bucket in the backend.
  2. On Creating complains we are checking the officers that are online and not having a complain assined already, then we are assigning the complain to that officer.
  3. When we change the complain status to completed, we are un-assigning that complain from the officer making his bucket empty for other cases.

Proposed Solution

We can create lambda in AWS that will trigger after some interval by the cron, that will take care of this assigning and unassigning of the complains.

API Endpoints

/api/signin
/api/register
/api/logout/api/:id
/api/complains
/api/complain
/api/complains/:id
/police/assign/:id

Database Schema

CREATE extension "uuid-ossp";

CREATE TABLE IF NOT EXISTS complains (
	id uuid NOT NULL DEFAULT uuid_generate_v4(),
	car_model text NOT NULL,
	customer_name VARCHAR(100) NOT NULL,
	customer_phone_number text NOT NULL,
	notes jsonb,
	is_completed BOOLEAN DEFAULT FALSE NOT NULL,
	created_at TIMESTAMP without time zone NOT NULL,
	CONSTRAINT complains_pkey PRIMARY KEY ( id )
);

CREATE TABLE IF NOT EXISTS users (
	id uuid NOT NULL DEFAULT uuid_generate_v4(),
	name VARCHAR(100),
	email text UNIQUE NOT NULL,
	hash VARCHAR(100) NOT NULL,
	created_at TIMESTAMP without time zone DEFAULT now() NOT NULL,
	CONSTRAINT users_pkey PRIMARY KEY ( id ),
	fk_complains_id uuid references complains (id)
);

DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS complains;

alt txt alt text

  • To change the complain status we have to click on yellow button
  • To Assign and Unassign complains, we have to click on Pickup/Unassign button alt txt

alt txt

Card CSS - https://codepen.io/alvaromontoro/pen/ebPEWb Profile Card CSS - https://codepen.io/msichterman/pen/zVmEpG Barebones - https://github.com/covalence-io/barebones-react-typescript-express

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.