Coder Social home page Coder Social logo

linesmerrill / police-cad Goto Github PK

View Code? Open in Web Editor NEW
64.0 10.0 35.0 135.02 MB

This is a easy to setup and use police server CAD. Includes a signup/login for both Civilians and Police Officers. Also this is mobile friendly. Built for GTA V's Modding framework: FiveM.

Home Page: https://linespolice-cad.com/

License: MIT License

JavaScript 81.84% CSS 2.82% HTML 1.05% SCSS 0.81% Less 0.01% EJS 13.47% Procfile 0.01%
gtav doj roleplay html javascript mongodb heroku hacktoberfest hacktoberfest2021 nodejs

police-cad's Introduction

Lines Police CAD

lines police cad logo

build Repository dependencies Status

This is a easy to setup and use police server CAD. Includes a signup/login for both Civilians and Police Officers. Also this is mobile friendly.

Requirements :

  1. Node.js
  2. MongoDB

Getting Started with Code :

  1. Set Up MongoDB and start mongodb
  2. Clone repo from https://github.com/Linesmerrill/police-cad.git
  3. Run npm install to install dependencies.
  4. Duplicate .env.example and rename the new file to .env. Edit to your configurations.
  5. Run npm start to boot up server.
  6. Go to http://localhost:8080.

Running the backend server via our microservice

We have since began migrating most of our backend code to our police-cad-api. This is now required to be running in order to access certain parts of the app.

Follow along with the instructions on how to start and run that service here.

Once Running, you will need to add two new environment variables, you can an example of those here.

Setting up MongoDB

  1. Install mongodb via brew Step by step instructions
  2. Start mongodb via brew Step by step instructions

Accessing the Database

  1. Locally this will use the knoldus db (or whatever you specify manually)
  2. launch mongo via your command-line: mongo
  3. Use show dbs to see all that are available. You should see knoldus in the list.
  4. Lets use that db: use knoldus.

police-cad's People

Contributors

ayushmishra2005 avatar dependabot[bot] avatar expdev07 avatar linesmerrill avatar sowinskibraeden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

police-cad's Issues

Web?

Is there any way you can convert this for simple web hosting as im an idiot and but it would be preferred on cpanel

Add Pilot license

Describe the solution you'd like
Add a pilot license for civilians.

Implementation Details
This could be pretty simple. Just a basic toggle to show that the civilian has a pilots license.

Possible Side Effects
None

Add an address and occupation when creating/modifying a civilian persona

Describe the solution you'd like

Add an address and occupation when creating/modifying a civilian persona

Implementation Details

  • Ability to add an address for the civilian
  • Ability to add an occupation for the civilian
  • Display this information on civilian dashboard
  • Modify this information on civilian dashboard
  • Display this information on the police records when searching for civilian

Possible Side Effects
N/A

Add FIB department login

Describe the solution you'd like
Add an FIB login with it's own dashboard. Here users could create accounts as FIB officers and then create personas (similar to the EMS login)

Implementation Details

  • New table in the database for FIB officers.
  • New login button for FIB.
  • New dashboard for FIB.
  • New personas under the FIB user that is logged in.
  • Probably want vehicles (similar to EMS)

Possible Side Effects
N/A

Add multiple personas for police officers

Description

Allow users to create multiple personas for police officers, as well as vehicles tied to that police officer.

Implementation Details

This should function similar to how civilians are created and managed.

Possible Side Effects

Could cause some issues with displaying all the info on the police home page. Would need to see how many people want this feature added.

Add Military login and Ranking system

Description

Add the ability to login as Military. This would grant access to creating military personnel. For the personnel options we could have things such as ranking, position (and other military specific details)

Implementation Details

Add new database table for Military (similar to EMS/Fire). This person should be searchable in the police database. Ability to Add/Remove personnel from account. We probably want to add vehicles that can also be added/removed and assigned to personnel.

Possible Side Effects

N/A

Add Written Warnings

Description

Add in the ability for police officers to write written warnings for civilians. This would show up on their record as a warning rather than a ticket.

Implementation Details

Have a new 'Issue Warning' button that would allow officers to issue these. These should be saved in the database in a new table called or possibly the tickets table with a flag as warning. This should have similar details in the warning as a ticket but just saved as a different ticket class.

Possible Side Effects

Needs to display this when searching for civilians as 'Warning' in their record.

Edit civilian details

Description

Add the ability to edit civilian details. Rather than having to delete and re-add a civilian for a spelling mistake.

Implementation Details

Add options to modify:

  • First Name and Last Name
  • Warrant Status
  • Date of Birth
  • License Status

Possible Side Effects

Concurrency issues, if a police officer is looking up that information and they do not refresh the page - the info could be out of date. We may want to implement some sort of soft refresh or alert if they try to proceed with some action on a civ that was modified.

Add drop down everywhere

Describe the solution you'd like
Add drop down everywhere (same logic) to easy the task for looking for people in persone database etc

Implementation Details
At this moment a drop down feature is only available when adding new vehicle (civilian section)
image

Possible Side Effects
none

1 login

A great feature would be to not login each time you switch from civil / police dashboard. Once logged in, you can access both without logging in again. That would spare a lot of time !

Thanks

Add Dispatch Functionality

Description

Add the ability to have a complete different side of this app for dispatch.

Implementation Details

Would require a massive rewrite to structure the code so that police could go "on duty" or "off duty". Allow officers to have different status codes based on their current status. Have call assignments and call notes.

Possible Side Effects

The list is probably endless here..

filter officers

What would be great for the commandand to give money each week to his officers, is to have a report/ list with name filter who did want and gave what.

The commandand will then see who worked well, and who didn't.

Tickets assigned to civs that do not actually exist

Description

When a ticket is written there is no check to see if that civilian exists or if there are duplicate civilians with that name. This causes issues when trying to show tickets for a specific civilian. We should update tickets so that when they are written they are validated against a civilian to make sure they exist and is the correct civ to assign the ticket to.

Implementation Details

Requires updating the ticket table and also the ticket POST action to include more details about the civilian getting the ticket. We should also introduce some sort of duplicate popup so the officer can choose which person they are writing the ticket for.

Possible Side Effects

Requires a bit of work to overhaul how tickets currently work

Voice chat server in website

Describe the solution you'd like
A way to create chat rooms like teamspeak but on the website.

Implementation Details
This could be a massive amount of work, not sure on the details for this. Requires some research and discovery before it can be worked on.

Possible Side Effects
N/A

Add CAPTCHA for sending forgot password email

Description

To limit the amount of bots that could be sending thousands of emails, we should add in a CAPTCHA check before sending the forgot password emails.

Implementation Details

Integrate with possibly Google reCAPTCHA. Then prompt the user to check this box before submitting.

Possible Side Effects

N/A

1 field person database

Describe the solution you'd like
It would be easyer to have 1 field to fill in for looking trough the person database. When typing text, a good thing would be that there is a list in which you can choose the right persone / name

Implementation Details
Now it is like this :
image
better would be :
image

Possible Side Effects
Possible faster research of a suspect

Add more civilian details

Describe the solution you'd like
Add more specific civilian details, like hair color, height, weight, gender, skin color etc. normal things your would find on a drivers license.

Implementation Details
Would require more fields to be stored in the database. Also with tons more things to show on The UI it would be nice to figure out a better way to display those details.

Possible Side Effects
N/a

Grammar mistake on Rules page

Describe the bug
"We want to build a fun Roleplay community where people keep want to come back time and time again." should be "We want to build a fun Roleplay community where people want to come back time and time again."

To Reproduce
Steps to reproduce the behavior:
N/A

Expected behavior
Looks like above

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

Add basic feedback form (or make the one on the home page work)

Description

As the user base has grown so has the feedback. It would be great to streamline this into a single UI element on the site or to use the built in form that already exists on the home page. This would allow users to leave valuable feedback about things that could be better with the site.

Implementation Details

This should send the feedback to the current email associated to the server. I think to start this could very simply be implemented with the built in form on the home page, but if someone wanted to build out a completely new UI for a feedback pop-out that would be fine as well.

Possible side effects

Need to validate that users are not spamming the feedback, probably want to include a captica or similar check. Also will require that the feedback is scanned and prioritized by the Lines Police Server Team. (These could simply turn into issues on this project).

Add ability for police to issue warrants and/or bolos

Description

Allow police officers to issue warrants or bolos on specific civilians.

Implementation Details

Add new button on police dashboard for creating warrant/bolo. Assign this to a specific civilian and then it will update under the details of that civilian that they have a warrant or bolo. This could be also vehicle details such as (Red truck with blue stripes, occupied by 2 people). We may want to make a new table for bolos for a more generic alert to active police officers, whereas the warrant would be issued to a certain individual that exists in the civilian database.

Possible Side Effects

Once this is added then we should also add in the ability to clear warrants: #4

Also it would be nice to have some sort of display of the current warrants or bolos on the police dashboard so at a glance they could be on the lookout for that person or vehicle.

Arrest Reports

Description

Add the ability for police to write up an arrest report for a civilian when they are going to be jailed.

Implementation Details

Add new form on the police dashboard to enter details for an arrest report. Save this to the database in the civilian table with their police record.

Possible Side Effects

N/A

Ability to clear warrants once civ is arrested

Description

Once a civilian has been arrested, assuming they already have a warrant, this should be cleared once they have been processed. It would be great for police officers to clear warrants on civilians.

Implementation Details

Possibly have a button on the police name search popup that would allow only officers to clear warrants for civilians.

Possible side effects

Could allow officers to accidentally clear a warrant on a person by miss-clicking. Could be solved by allowing civilians to edit their currently created personas 🤷‍♂

Add functionality for EMS

Description

Add the ability to login as EMS and create personas for that account.

Example Flow

  • EMS logs into the site
    • They can create any number of persona's
      • Can create a new persona: e.x. First Name, Last Name
      • Can assign that persona to a specific department: e.x. Fire
      • Can assign that persona to a specific area: e.x. Blaine County
      • (Optional) Can assign to a specific station: e.x. Station 4
      • Can assign a call-sign to that persona: e.x. 1F-25
    • They can also add a new vehicle (so it is registered)
      • Will follow a similar setup as creating vehicles with Civilians: e.x. Plate, Model, and Vehicle Operator

Open Questions

  • Can police officers look up these in their database?
  • Can users modify the details for an ems persona?
  • What are the specific departments? (Fire, Medical, etc)
  • What are the specific Areas that can be assigned? (Blaine County, Los Santos, etc)
  • What are the specific stations that can be assigned? (Station 1-4, etc)
  • What constitutes a valid call-sign. Currently this is just a text field, should some characters be restricted? (1K-24, etc)
  • Are there any other vehicle details that would be pertinent when adding a new EMS vehicle? (Plate, Model, Vehicle Operator, etc)

Allow users to modify details associated to their account

Description

It would be nice to modify user details once they are logged in. For example being able to modify the username or email address, or even the password (without having to click on forgot password to change this).

Implementation Details

Once a user is logged in to the site they would be able to click on their name in the top right and it would bring them to a 'user edit' page. Here they would be able to modify the necessary items corresponding to their account.

Possible side effects

Need to make sure that if they change these details, it continues to link that account with all of the previously created personas tied to that account. Not sure how this linking is happening currently.. i.e. are the personas tied to the Username & Email combo?

BadRequestError: request aborted

i don't know when this happens, but when i came back to my server i saw this error (multiple times). i don't know how to fix it. Maybe you do ?

BadRequestError: request aborted
at IncomingMessage.onAborted (C:\Users\Administrator\Desktop\police-cad-mast
er\node_modules\raw-body\index.js:231:10)
at IncomingMessage.emit (events.js:189:13)
at abortIncoming (_http_server.js:449:9)
at socketOnClose (_http_server.js:442:3)
at Socket.emit (events.js:194:15)
at TCP._handle.close (net.js:597:12)

security issue / feature

Describe the solution you'd like
When registering on the cad, you should create an account with a generated code from the head of the officer (or maybe developer) to make an account

Implementation Details
Adding a security code to make an account on the cad, this is to prevent other users accessing th cad without authorisation. this prevents bandits to remove / add warrannts to oher users / themselves

Possible Side Effects
more secure cad

Display multiple users for a name search

Description

Display multiple users for a name search. Since names are not unique in the database, there can be many users with the same name. We should make a way to display this on the page when searching in the police dashboard.

Implementation Details

Display possibly as a list and then allow the user to click on the record they want and get more info. Research a good way to display this info.

Possible Side Effects

N/A

add another button to police cad named “penal code”

Describe the solution you'd like
A clear and concise description of what you want to happen.

Implementation Details
Add any and all specific things you would like to see implemented. These can include things such as limiting the input for a input box to only include specific characters. (This can be as technical as you would like to make it, including code examples)

Possible Side Effects
What are some of the adverse reactions that adding this could bring to the website?

Remove recently typed names drop down

Describe the solution you'd like
When typing a name, google chrome will store whatever you typed before into the form. This can cause results to show up even when that name does not exist.

Implementation Details
I think there is a way to tell google not to auto fill or remember the values.

Possible Side Effects
Some people might use this as an auto fill feature, so it could effect different users.

name database dropdown

When searching for a civil in the name database section, it would be cool to have a dropdown to immediatly select the correct person. Here when you type wrongly or only types first name or last name the cad won't accept.

Automated warrant approval process

Description

Add the ability to issue a warrant to search a specific property. This would then wait a random about of time (maybe like 3-7 minutes) and then send an approval notification to the officer who created the warrant.

Implementation Details

  • Add ability to send notifications on warrants once they have been created/updated
  • Requires #27 to be completed

Possible Side Effects

N/A

Add medical records for civilians

Describe the solution you'd like
As an EMS person I could look up a civilian's medical record. I could also update the medical chart to include new information. This information should be originally edited by a civilian.

Implementation Details

  • Add new input box for medical charts/conditions
  • Add search box in EMS dashboard to look up civilians
  • Add input box or button to add additional medical information

Possible Side Effects
N/A

locales for translations

Describe the solution you'd like
Folder where we can add locales, to be able to put more then one language for most of the pages

Implementation Details
A good thing would be having a config file where you can choose between languages and aother details. With that you even add your own transaltions in the locales folder and so contribute to the cad.

Possible Side Effects
a lot of work in the beginning

Build Mobile App for Android and iOS

Description

To make this easier on mobile devices it would be great to have an Android app for people to download and use this CAD.

Implementation Details

Would require an entirely new project and also uploaded to the Android store for downloading. We could leverage the existing database.

Possible Side Effects

N/A

last name can contain spaces

Describe the bug
Just add a space to look last name

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Persone database'
  2. Fill in somethin with spaces
  3. See error
    image

Expected behavior
When you have roleplay, some people are italian and have a long lastname ... :p

Screenshots
see above

Desktop (please complete the following information):

  • OS: Win 2012 server
  • Browser chrome

/

Additional context
/

Display multiple vehicles for a plate search

Description

It would be nice to display multiple vehicles when doing a plate search. Since these are not unique values there can be many plates with the same values. Currently it just finds one and returns that.

Implementation Details

Make the display on the screen accommodate multiple vehicles being returned when searching. Experiment with possibly using some sort of table with the details...

Possible Side Effects

N/A

Add Banking tab

Describe the solution you'd like
A clear and concise description of what you want to happen.

Implementation Details
Add any and all specific things you would like to see implemented. These can include things such as limiting the input for a input box to only include specific characters. (This can be as technical as you would like to make it, including code examples)

Possible Side Effects
What are some of the adverse reactions that adding this could bring to the website?

Show success when finished writing ticket

Description

After I complete writing a ticket in the police dashboard I am not 100% sure that the ticket was successfully submitted. It would be great to get a little banner saying that it was processed in the system successfully.

Implementation Details

Once the ticket has been saved in the system display a notification on the screen saying that it was successful. Allow this to be dismissed or auto dismiss after maybe 5 seconds.

Possible Side Effects

Could be nice to have like a notification bell will previous notifications. They could also go here for alerts or warnings.. 🤷‍♂️

Edit Civilian vehicles details

Description

Add the ability to update civilian vehicle details

Implementation Details

Should be similar to #33

Possible Side Effects

N/A

Email address is case sensitive on login

Describe the bug
When logging into the website and entering an email, it uses case sensitive details to store this email. So L[email protected] is currently a different account than l[email protected].

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to create an account as [email protected]
  2. See that it already exists
  3. Attempt to create an account as [email protected]
  4. It gets created (which it should not get created)

Expected behavior
A warning pops up saying that email address has already been registered.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: N/A

Smartphone (please complete the following information):
N/A

Additional context
This could create some issues with accounts that are already created, since they could be created with a specific casing. We should just check to see if any casing matches in the database and in the future just lowercase all new account email addresses.

Generate police report

Description

Add the ability for a police chief to view a report with statistics from their officers. This could include:

  • number of tickets issued
  • number of arrests
  • number of warnings issued
  • etc

Implementation Details

This would require that each user is assigned to a specific department. These should be separate from other users servers so each department can be unique. Requires a massive rewrite of how the site is currently structured and changes to the current single database.

Possible Side Effects

Probably a lot of side effects due to this requiring things that the website does not currently support.

add ability to full view tickets and written warnings

Describe the solution you'd like
View full tickets and warnings and arrest reports.

Implementation Details
Display these maybe as a collapsible list for each ticket or arrest. This way at a glance you could see the information, but if you wanted to click in and see more details you could.

Possible Side Effects
N/A

Display GTA V map on civilian page

Description

  • Add GTA V map to civilian page (possibly with address codes)

Implementation Details

Need to find a high res and scalable map that will work for desktop and mobile.

Possible Side Effects

What if different servers use different address codes? Should this be uploaded by users?

Add more ticket options

Describe the solution you'd like
To provide users with more ticket options we should probably revisit the current options.

Implementation Details
We need some ideas on more ticket options, let us ask on twitter.

Possible Side Effects
None

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.