Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New web interface #592

Closed
tananaev opened this issue Sep 25, 2017 · 183 comments
Closed

New web interface #592

tananaev opened this issue Sep 25, 2017 · 183 comments

Comments

@tananaev
Copy link
Member

Apparently Sencha is dying:

https://www.sencha.com/forum/showthread.php?377323-Sencha-sold-to-IDERA

I think we need to start seriously thinking of rewriting the web app.

@tananaev
Copy link
Member Author

One potential library that we can use:

https://dojotoolkit.org/community/roadmap/

@Abyss777
Copy link
Collaborator

Bad news, I was waiting for ExtJS 7.
Any way, It will take much time to implement the same level of functionality. I think we have to develop it in parallel for some time.

@tananaev
Copy link
Member Author

Agree. There is still some chances that they release version 7, but I think we should start working on alternative.

@Abyss777
Copy link
Collaborator

Sure, I'll start to studying this framework.
It would be nice If you create some skeleton, may be branch or subfolder

@tananaev
Copy link
Member Author

We need to decide what to use first. Maybe we should use react with something like this:

http://www.material-ui.com/

@tananaev
Copy link
Member Author

Good thing about react is that we can potentially make native mobile apps later using react native.

@Abyss777
Copy link
Collaborator

We are used to working with stores on ExtJS and dojo also has similar thing https://dojotoolkit.org/reference-guide/1.7/dojo/store.html#dojo-store
I think it is very important benefit.

What if we create list of features waited from framework... like

  • Openlayers support
  • RESTful data stores
  • Tables with filters
  • ...

@tananaev
Copy link
Member Author

OpenLayers is just a map library. You can include it in a simple div.

REST data stores and tables with filters are nice to have, but not really a requirement. We can implement all that ourselves. The benefit would be that we have more control and it will probably be much faster than ExtJS stuff.

I think the main requirement is to have enough UI widgets for everything that we need. Grid, forms with all different field types, various toolbars and menus, resizable panels. Last one needs more research. Possibly we can just use some pure HTML components.

@tananaev
Copy link
Member Author

Another option for nice UI widgets:

https://getmdl.io/

It's not really a JS framework, but it's fast and look nice.

Demo that might be kind of relevant to our use case:

https://getmdl.io/templates/dashboard/index.html

@tananaev
Copy link
Member Author

I have also found this. Might be useful as a reference on how others implement similar functionality:

https://github.com/geoadmin/mf-geoadmin3

@tananaev
Copy link
Member Author

Another thing I want to consider is using Leaflet library for maps. It's much smaller (god for mobile) and simpler than OpenLayers. There is a good plugin for including Google Maps (a lot of people are interested in this). It doesn't have as many features as OpenLayers, but then we don't actually need that many features. We use markers and various geozones and that's about it. What do you think?

@Abyss777
Copy link
Collaborator

Abyss777 commented Sep 26, 2017

Implementing stores, tables and filters might take a time... But agree ExtJS is not fast at all.

I briefly looked at Leaflet, I like it at first sight. It has all we need and what is interesting I found a couple of plugins for SVG marker icons, I believe we could implement native SVG icons, and manipulate them as SVG, without rerendering to <img> on all change.

Also I liked mf-geoadmin3, very nice looking. Good reference.

One important thing to decide is licence. Will we migrate back to Apache 2.0? Are these libraries fit by licence to us?

@tananaev
Copy link
Member Author

Yes, that's one of the most important parts. We want Apache 2.0 again. All of the libraries that I've mentioned should be good.

I want to try React with Material UI to see if it would work for us.

@Abyss777
Copy link
Collaborator

OK. React is popular and used/supported by big companies, do not think it will die soon. Material UI is nice looking.
Hope you finally will like tabs 😃

@Abyss777
Copy link
Collaborator

One more, I'm not good in web programming, but as I understand React is only "V" in MVC, what will we use for states? Redux?

@tananaev
Copy link
Member Author

I'm not an expert myself, so I guess we'll have to learn.

@Abyss777
Copy link
Collaborator

One more thing also would be nice to have is unit tests.

@tananaev
Copy link
Member Author

Agree, it would be nice to have some tests for web app.

@ovnicraft
Copy link
Contributor

IMO project can move: react + material-ui + Leaflet; best options its has compatible licenses.
Said that, you will start a plan for ?

@tananaev
Copy link
Member Author

I don't get the question.

@tananaev
Copy link
Member Author

I have done some more investigation and it seems like React is not a very good match for our project. Neither Leaflet nor OpenLayers have a good integration with it. There are only some very basic wrappers. I'm sure it's possible to somehow make React and map libraries work together, but it's not going to be easy or nice.

@Abyss777
Copy link
Collaborator

Abyss777 commented Sep 28, 2017

Agree, wrappers (I have found) are very basic. I believe they do not support all we need.

@tananaev
Copy link
Member Author

What do you think about following stack:

  • Material Components for UI
  • Leaflet library for map
  • Pure modern JavaScript for most other stuff
  • Some smaller third party libraries as required

@Abyss777
Copy link
Collaborator

I like it, a lot of work, but we could do it smaller and faster without frameworks.
Only thing, I could not find tables (grids in terms of ExtJS) in Material Components.

@tananaev
Copy link
Member Author

I have noticed it as well. Apparently it's in development. Maybe we can use some third party component until they develop official one.

material-components/material-components-web#57

@Abyss777
Copy link
Collaborator

Agree, also we may rethink interface and implement most things without tables. They are necessary only for reports.

@tananaev
Copy link
Member Author

I was also thinking about it. We can use lists, especially if we want to make it more mobile-friendly.

@ovnicraft
Copy link
Contributor

Did you check vueJS ?
I am not JS expert btw let something here: https://github.com/PaulLeCam/react-leaflet

@tananaev
Copy link
Member Author

@ovnicraft, we can consider vue.js if you can explain the benefits.

I have already researched react-leaflet. It is very basic integration as I mentioned above.

Please don't just throw in some names that you heard unless you know what you are talking about.

@allenhwkim
Copy link

allenhwkim commented Oct 7, 2017

Hi, I am an outsider.

I just saw your conversation linked from Material Design Component data table issue and makes me interested into the discussion. I think the choice you are making is very considerate and admirable. I want to leave some of my experience if you don't mind.

  • Material Components for UI

I have been researching for 3 days about good web components.
Material Components is my best choice compared to bootstrap, Material UI(React), MDL, or Materialize. It's designed to work as component itself regardless of any web framework.

  • Leaflet library for map

I have been using Google map for long time and it has very good API, even with streetview etc. I am also the owner of https://ngmap.github.io/ and https://github.com/ng2-ui/map. However you need to pay for it when it becomes commercial. Also it does not provide a very customized requirements, e.g. setting North to any side.
I used Openlayer. It's powerful, but not developer-friendly IMO.
Not experienced with Leaflet though. :(

  • Pure modern JavaScript for most other stuff

ES6/ES7 ways makes the code a lot to easy to read IMO. Also using classes makes documentation a lot easier.

  • Some smaller third party libraries as required

You may need a framework, which handles routing, storage, http call handling, server-side-rendering, performance. Experience with angular1, angular2, and react was ok, but not satisfactory. Recently I learned VueJs, and it seems very easy and promising.

@tananaev
Copy link
Member Author

Start implementing features and send pull requests.

@josuelmm
Copy link

josuelmm commented May 12, 2019

They have already started with something or everything from scratch. What scripts, plugins, complements, have weighed, as you already analyzed more than me, I would like to know that.??

@tgroshon
Copy link
Contributor

I started doing some simple work on the React + Redux + Material UI rewrite that @tananaev started. To be a loose guideline, I made a public trello board with some obvious user stories that need tackled:

https://trello.com/b/kPlpdZD4/traccar-web-modern

The list of tasks is not comprehensive nor detailed, but it is something. Anyone can view the board and cards, but editing requires you to be added to the team. I am willing to add anyone to the Trello team who wants to be actively involved in the development. You can contact me at [email protected]

@tgroshon
Copy link
Contributor

FYI @tananaev is also a Trello team and board admin with ability to add anyone and change anything.

@pycc34
Copy link

pycc34 commented May 23, 2019

how to do geofence with react app??

@ilstarno
Copy link

there is an leaflet module for geofencing.
in the specific i think it should be ported on react

@ilstarno
Copy link

https://github.com/dev-labs-bg/geofencing/blob/master/README.md

it is already an port of it on react it seems.

not tested it but i guess it should work

@jinzo
Copy link
Contributor

jinzo commented Jul 5, 2019

So a month ago I finally had some time to play with React and React Native for a new/modern web interface. So if I understand it right noone else is working on it right now?
I usually avoid doing many big changes in one go and prefer incremental changes - but in this instance I think it would be beneficial if the API and Socket interface (I'll just refer to both of them as API from now on) of Traccar change with the new paradigm. I think there are some pain points in the API that would make developing and maintaining a React "app" easier. As already mentioned in traccar/traccar#4336 a newer way of logging in is probably a good idea, especially with the 2FA/U2F in mind. But that's not that critical. A bit of a bigger pain point was the fact that the Socket api sends an array of all the devices on every new position reported, but doesen't send a new array when for example, the device name changes. So I think a better design would be that the Socket API emits a message for the specific device when any (at least user facing) field changes (so no array of all devices for one device change and a message for every change not only last location update). This would make state management in React app a lot easier, as we would only have one source of changes for the devices/positions. I don't know if @tananaev is ok with substantial changes to the API?
Note - I did most of my work on 4.3 but I don't think anything regarding the API changed in the newer versions.

Regarding the app/functionality. I think I found quite a nice solution for the React Native/Mobile app layout (at least the most commonly used device list/map/reports). I'll whip out some wireframes over the weekend and post them here for feedback. The progress will probably be slow, but I think I'll finally be able to do at least a consistent amount of work towards a new interface the following weeks/months.

@tananaev
Copy link
Member Author

tananaev commented Jul 5, 2019

I don't think what you are proposing is relevant to the new web app.

@jinzo
Copy link
Contributor

jinzo commented Jul 5, 2019

Yeah it's not entirely connected with the new web app, but it's something I noticed when doing a React Native prototype. I'm far from an experienced React developer, but I think that changes like that would make it a lot easier to develop a React app. But I guess they're not required, at least for now. I'll post the wireframes for the mobile app and so we can discuss the general layout and I can continue with the prototype in the right direction.

@GoZippy
Copy link

GoZippy commented Aug 1, 2019

@jinzo make any progress? I want to help on this badly but am so taken of time with work and family it's driving me nuts. Know anyone I can offer up some cash to for help on this project and maybe helping me build what I am thinking this would be a great base for? I checked out the Trello board - not seeing anything in there - but I don't use Trello - ever - so willing to learn... looked over at the github rep for modern and do not see any activity there either.. Guys/gals - what can I do to help or offer up as a rewards base to attract some talent to this project? I dont have much time to work on this directly - I will help as I can though. I figure my best offer is to identify approved direction plans and milestones and offer up a bounty to anyone willing to put in the time to make the pull requests and commits... any thoughts?

@tananaev
Copy link
Member Author

tananaev commented Aug 1, 2019

The plan is simple - implement same functionality that we have in the original app.

@nilocoelhojunior
Copy link

nilocoelhojunior commented Sep 14, 2019

Hi, how can I help?

@GoZippy
Copy link

GoZippy commented Feb 10, 2020

Any decisions made on where to go with the web interface yet? I have not seen any trello updates or notices here for a while... Let me know what to work on and I can definitely put some time in for this project.

@dt-ap
Copy link
Contributor

dt-ap commented Mar 9, 2020

I built a little example using react and typescript:
https://github.com/dt-ap/traccar-react

Currently, the app could do a simple login, getting devices, receive position from websocket, and generate trips' reports.

I would love to help in my spare time for the modernisation of traccar web.

@tananaev
Copy link
Member Author

Here's a build of the new web app: modern.zip. Replace "web" folder with the content of the archive to try it on your server. The functionality is very basic at the moment, but I think it's a good starting point.

The "modern" branch is now merged into master and I plan to include the new web interface as an option in the next official release.

@spacecabbie
Copy link

Here's a build of the new web app: modern.zip. Replace "web" folder with the content of the archive to try it on your server. The functionality is very basic at the moment, but I think it's a good starting point.

The "modern" branch is now merged into master and I plan to include the new web interface as an option in the next official release.

Anything you want tested or done ? Installed and worked straight out of ta box. Looks very nice kudo's for all that made it possible.

@tananaev
Copy link
Member Author

Testing is good. If there are any issues, please report. If anyone has time, it would be nice to start adding more functionality to eventually replace the old web app with this one.

@spacecabbie
Copy link

Testing is good. If there are any issues, please report. If anyone has time, it would be nice to start adding more functionality to eventually replace the old web app with this one.

Sure atm it runs fine but there is also very little to break :P. Love to give it a go to help but i have no access to a java compiler (I presume its still needed.) I could play around with the source and commit uncompiled i suppose the source is and will remain at: https://github.com/dt-ap/traccar-react ?

@tananaev
Copy link
Member Author

No need for Java compiler. It's a standard React application. The source code is here in this repo.

https://github.com/traccar/traccar-web

@spacecabbie
Copy link

No need for Java compiler. It's a standard React application. The source code is here in this repo.

https://github.com/traccar/traccar-web

Yep was looking in the wrong place cloned it and am running it this seems doable for a novice like me. I could make some base layouts menu etc i guess. I'll have to find a visual tool for it.

@Alexander090191
Copy link

Hello, I am a full stack software developer, I am interested in this project, I think it is paused and I would like to contribute to the development of the new application.

@tananaev
Copy link
Member Author

tananaev commented Jun 1, 2020

It's not really paused. Feel free to contribute.

@tananaev
Copy link
Member Author

tananaev commented Oct 1, 2020

If anyone is interested in contributing to the new Traccar web app, there's now an opportunity to get a free t-shirt for it. Feel free to contact me if you need some pointers on what things you can work ok. It can be as small or big as you want.

@dt-ap
Copy link
Contributor

dt-ap commented Oct 2, 2020

Sounds good, really interesting. It would be nice if you have some list of small or big features/pointers/bugs that we could maybe worked on

@tananaev
Copy link
Member Author

tananaev commented Oct 2, 2020

Smaller more straightforward work:

  • Migrate drivers
  • Migrate computed attributes
  • Migrate saved commands
  • Migrate maintenance
  • Implement report exports

For the above features you can just follow existing patterns.

A bit more complicated:

  • Migrate calendars
  • Implement other reports (require refactoring to avoid code duplication)
  • Migrate geofences (this is probably hardest)
  • Add support for category icons

@dt-ap
Copy link
Contributor

dt-ap commented Oct 2, 2020

Is there a running traccar server with some data for staging/testing? Because I don't have a running traccar server, but would love to work on the web interface.

@tananaev
Copy link
Member Author

tananaev commented Oct 2, 2020

You can use demo servers if you want. You don't need any data to implement most of the features that I mentioned.

@tananaev
Copy link
Member Author

tananaev commented Jul 2, 2022

Modern app is officially out.

@tananaev tananaev closed this as completed Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests