Skip to content

Commit

Permalink
Merge pull request #389 from dmsl/develop-mongodb
Browse files Browse the repository at this point in the history
Updating backend with mdb changes
  • Loading branch information
dzeina authored Jul 14, 2021
2 parents 751255b + faf1e65 commit ac4eeca
Show file tree
Hide file tree
Showing 188 changed files with 65,275 additions and 11,966 deletions.
10 changes: 10 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/.bsp/sbt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"sbt","version":"1.5.5","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["C:\\Program Files\\Java\\jdk1.8.0_261\\jre/bin/java","-Xms100m","-Xmx100m","-classpath","C:\\Users\\Nikolas\\AppData\\Roaming\\JetBrains\\IntelliJIdea2020.2\\plugins\\Scala\\launcher\\sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=C:\\Users\\Nikolas\\AppData\\Roaming\\JetBrains\\IntelliJIdea2020.2\\plugins\\Scala\\launcher\\sbt-launch.jar"]}
8 changes: 8 additions & 0 deletions server/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions server/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions server/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions server/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions server/.idea/play2_project_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions server/.idea/play2_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 16 additions & 5 deletions server/.idea/sbt.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions server/.idea/scala_compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions server/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 87 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

# Version 4.20
<details open>
<summary>
Details..
</summary>

<details open>
<summary>
New features
</summary>

- Fingerprint cache-collections:
Instead of recalculating and waste resources we are caching fingerprint groupping. There are in total 3 zoom levels and the possibility to select a date span to see fingerprints, thus there are in total 6 collections. Those are heatmaps1,2,3 and heatmapTimestamp1,2,3.
- on heatmap/Wifi-Coverage request, depends on the zoom level the heatmap cache collections are created for the requested floor.
- on heatmap-timestamp request all zoom levels are created for the requested floor.
- on delete all cached objects that are related to that floor are deleted.
- on update all cached objects that are related to that floor are deleted.
- on fingerprint insertion cache collections are NOT affected.
- on space/floor deletion, cache collections are also deleted.
- Fingerprints groupping:
+ level 1: Approximately 3 meters
+ level 2: 1.11 meters
+ level 3: No groupping
- New login/register feature:
- Register
In the past users could only use the system with Google Accounts. Now they can create Anyplace accounts and interact with the system through them.
- Login
User provides username and password in order to login.
- Changed how API key is generated and authenticates
Since the former way of interacting with Anyplace was with Google we were using Google API-key.
Now we generate our own API-keys and authenticate the endpoints with them.
- Added space type
Buildings are renamed to Spaces. There are two types of spaces:
+ building
+ vessel
- Rebuilding /developers with swagger-ui
New api interface using swagger. Still on develop stage.

</details>

<details>
<summary>
Bug fixes
</summary>

- Crossfilter:
The feature where a user could see fingerprints on a time span was not working.
- Reset button was also fixed.
The feature is now working properly and supports:
- Wi-Fi coverage
- Heatmaps
</details>

<details>
<summary>
Known Bugs
</summary>

- On space deletion directory path/radiomaps_frozen/building/floor remained
- Show access points feature shows wrong location
- Problematic features when logged with local account:
+ Update space
+ Add campus
+ Update campus
+ Search pois

</details>

<details>
<summary>
Endpoints renaming
</summary>

- /admin/accounts_all -> /user/admin/accounts_all
- /anyplace/version -> /api/version
- /anyplace/mapping/building/add -> /anyplace/mapping/space/add
- /anyplace/mapping/building/update -> /anyplace/mapping/space/update
- /anyplace/mapping/building/delete -> /anyplace/mapping/space/delete
- /anyplace/mapping/building/all -> /anyplace/mapping/space/all
- /anyplace/mapping/building/all_owner -> /anyplace/mapping/space/all_owner
- /anyplace/mapping/building/coordinates -> /anyplace/mapping/space/coordinates
- /anyplace/mapping/building/get -> /anyplace/mapping/space/get

</details>

</details>
22 changes: 10 additions & 12 deletions server/DEVELOP.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
# Deploy a development instance
# Remote Deploy during develop:

Idea:
1. code for the backend locally
2. sync sources to remote, compile them, and view from browser.
Workflow:
1. Write code locally
2. Sync code to remote for compilation, and view the result from the browser

# Run on different port:
sbt "run 9001"
See [deploy](./deploy)

## Run on different port:
`sbt "run 9001"`

# Troubleshooting:
## Troubleshooting:
- `Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.`

Try:
Try:
`unset DISPLAY`


# keystore

## keystore
```
keytool -genkey -alias MyKey -keyalg RSA -keysize 2048 -keystore keystore.jks
play -Dhttps.port=9443 -Dhttps.keyStore=keystore.jks -Dhttps.keyStorePassword=password run
```

add dummy value to this
4 changes: 2 additions & 2 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Anyplace v4.x Installation Notes
# Installation:
This is a latest version of the Anyplace backend, which has been ported to tha scala language and
that also supports all the latest versions of its underlying software layers
(i.e., it has been tested with couchbase 4.5 and play framework 2.8).

In case you want a precompiled release of the latest Anyplace, please check the docker folder (anyplace/docker)

# Anyplace v4.x for administrators
# For administrators

## Setup/Configuration

Expand Down
11 changes: 5 additions & 6 deletions server/TODO.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# TODO Release mechanism
The private Jenkins server should build a version and put it in the APFS.
Then, server should have an endpoint to fetch the versions, and maybe also a file viewer
(for all the compiled versions).
# TODO:PM remove ACCES map
Either Deprecation and removal, or update it's sources.

# TODO update Scala, sbt, Play

# TODO MongoDB
* MongoDB driver
* Edit parts in code for Mongo
* Update docker for that

# TODO ACCES map
Either Deprecation and removal, or update it's sources.


# Cleanup
if no issues arise then delete public/javascript/ flurry and jquery
33 changes: 33 additions & 0 deletions server/app/Anyplace.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import com.dmurph.tracking.JGoogleAnalyticsTracker.GoogleAnalyticsVersion
import com.dmurph.tracking.{AnalyticsConfigData, JGoogleAnalyticsTracker}
import datasources.{CouchbaseDatasource, MongodbDatasource}
import javax.inject.{Inject, Singleton}
import play.api.Configuration
import play.api.inject.ApplicationLifecycle
import utils.LPLogger

import scala.concurrent.Future

@Singleton
class Anyplace @Inject() (conf: Configuration) (appLifecycle: ApplicationLifecycle) {
// ON APPLICATION START (ctor):
//ifxDB.getStaticInstance(conf)
CouchbaseDatasource.initialize(conf)
MongodbDatasource.initialize(conf)
logAnalyticsInstallation()

appLifecycle.addStopHook({ () =>
Future.successful {
LPLogger.D2("onStart")
}
})

def logAnalyticsInstallation(): Unit = {
// Log the entry point from server installation
JGoogleAnalyticsTracker.setProxy(System.getenv("http_proxy"))
val config = new AnalyticsConfigData("UA-61313158-2")
val tracker = new JGoogleAnalyticsTracker(config, GoogleAnalyticsVersion.V_4_7_2)
tracker.trackEvent("Anyplace Installation", "Anyplace Server start", "Anyplace logging")
}

}
6 changes: 3 additions & 3 deletions server/app/ErrorHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ import utils.{LPLogger, LPUtils}
class ErrorHandler extends HttpErrorHandler {

def infoGithub(eid: String) : String = {
"\n\n\nIf you think this is an error, open a new issue at:" +
"\nhttps://github.com/dmsl/anyplace/issues" +
"\n\nReference ErrorID:" + eid
//"\n\n\nIf you think this is an error, open a new issue at:" +
//"\nhttps://github.com/dmsl/anyplace/issues" +
"ErrorID:" + eid
}

def errorMsg(request: RequestHeader): String = {
Expand Down
Loading

0 comments on commit ac4eeca

Please sign in to comment.