Skip to content

Commit ac4eeca

Browse files
authored
Merge pull request #389 from dmsl/develop-mongodb
Updating backend with mdb changes
2 parents 751255b + faf1e65 commit ac4eeca

File tree

188 files changed

+65275
-11966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+65275
-11966
lines changed

.idea/workspace.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.bsp/sbt.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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"]}

server/.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/codeStyles/codeStyleConfig.xml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/play2_project_settings.xml

+47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/play2_settings.xml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/sbt.xml

+16-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/scala_compiler.xml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.idea/vcs.xml

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/CHANGELOG.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
# Version 4.20
3+
<details open>
4+
<summary>
5+
Details..
6+
</summary>
7+
8+
<details open>
9+
<summary>
10+
New features
11+
</summary>
12+
13+
- Fingerprint cache-collections:
14+
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.
15+
- on heatmap/Wifi-Coverage request, depends on the zoom level the heatmap cache collections are created for the requested floor.
16+
- on heatmap-timestamp request all zoom levels are created for the requested floor.
17+
- on delete all cached objects that are related to that floor are deleted.
18+
- on update all cached objects that are related to that floor are deleted.
19+
- on fingerprint insertion cache collections are NOT affected.
20+
- on space/floor deletion, cache collections are also deleted.
21+
- Fingerprints groupping:
22+
+ level 1: Approximately 3 meters
23+
+ level 2: 1.11 meters
24+
+ level 3: No groupping
25+
- New login/register feature:
26+
- Register
27+
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.
28+
- Login
29+
User provides username and password in order to login.
30+
- Changed how API key is generated and authenticates
31+
Since the former way of interacting with Anyplace was with Google we were using Google API-key.
32+
Now we generate our own API-keys and authenticate the endpoints with them.
33+
- Added space type
34+
Buildings are renamed to Spaces. There are two types of spaces:
35+
+ building
36+
+ vessel
37+
- Rebuilding /developers with swagger-ui
38+
New api interface using swagger. Still on develop stage.
39+
40+
</details>
41+
42+
<details>
43+
<summary>
44+
Bug fixes
45+
</summary>
46+
47+
- Crossfilter:
48+
The feature where a user could see fingerprints on a time span was not working.
49+
- Reset button was also fixed.
50+
The feature is now working properly and supports:
51+
- Wi-Fi coverage
52+
- Heatmaps
53+
</details>
54+
55+
<details>
56+
<summary>
57+
Known Bugs
58+
</summary>
59+
60+
- On space deletion directory path/radiomaps_frozen/building/floor remained
61+
- Show access points feature shows wrong location
62+
- Problematic features when logged with local account:
63+
+ Update space
64+
+ Add campus
65+
+ Update campus
66+
+ Search pois
67+
68+
</details>
69+
70+
<details>
71+
<summary>
72+
Endpoints renaming
73+
</summary>
74+
75+
- /admin/accounts_all -> /user/admin/accounts_all
76+
- /anyplace/version -> /api/version
77+
- /anyplace/mapping/building/add -> /anyplace/mapping/space/add
78+
- /anyplace/mapping/building/update -> /anyplace/mapping/space/update
79+
- /anyplace/mapping/building/delete -> /anyplace/mapping/space/delete
80+
- /anyplace/mapping/building/all -> /anyplace/mapping/space/all
81+
- /anyplace/mapping/building/all_owner -> /anyplace/mapping/space/all_owner
82+
- /anyplace/mapping/building/coordinates -> /anyplace/mapping/space/coordinates
83+
- /anyplace/mapping/building/get -> /anyplace/mapping/space/get
84+
85+
</details>
86+
87+
</details>

server/DEVELOP.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
# Deploy a development instance
1+
# Remote Deploy during develop:
22

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

7-
# Run on different port:
8-
sbt "run 9001"
7+
See [deploy](./deploy)
98

9+
## Run on different port:
10+
`sbt "run 9001"`
1011

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

14-
Try:
15+
Try:
1516
`unset DISPLAY`
1617

17-
18-
# keystore
19-
18+
## keystore
2019
```
2120
keytool -genkey -alias MyKey -keyalg RSA -keysize 2048 -keystore keystore.jks
2221
play -Dhttps.port=9443 -Dhttps.keyStore=keystore.jks -Dhttps.keyStorePassword=password run
2322
```
24-
2523
add dummy value to this

server/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Anyplace v4.x Installation Notes
1+
# Installation:
22
This is a latest version of the Anyplace backend, which has been ported to tha scala language and
33
that also supports all the latest versions of its underlying software layers
44
(i.e., it has been tested with couchbase 4.5 and play framework 2.8).
55

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

8-
# Anyplace v4.x for administrators
8+
# For administrators
99

1010
## Setup/Configuration
1111

server/TODO.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# TODO Release mechanism
2-
The private Jenkins server should build a version and put it in the APFS.
3-
Then, server should have an endpoint to fetch the versions, and maybe also a file viewer
4-
(for all the compiled versions).
1+
# TODO:PM remove ACCES map
2+
Either Deprecation and removal, or update it's sources.
3+
4+
# TODO update Scala, sbt, Play
55

66
# TODO MongoDB
77
* MongoDB driver
88
* Edit parts in code for Mongo
99
* Update docker for that
1010

11-
# TODO ACCES map
12-
Either Deprecation and removal, or update it's sources.
11+
1312

1413
# Cleanup
1514
if no issues arise then delete public/javascript/ flurry and jquery

server/app/Anyplace.scala

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import com.dmurph.tracking.JGoogleAnalyticsTracker.GoogleAnalyticsVersion
2+
import com.dmurph.tracking.{AnalyticsConfigData, JGoogleAnalyticsTracker}
3+
import datasources.{CouchbaseDatasource, MongodbDatasource}
4+
import javax.inject.{Inject, Singleton}
5+
import play.api.Configuration
6+
import play.api.inject.ApplicationLifecycle
7+
import utils.LPLogger
8+
9+
import scala.concurrent.Future
10+
11+
@Singleton
12+
class Anyplace @Inject() (conf: Configuration) (appLifecycle: ApplicationLifecycle) {
13+
// ON APPLICATION START (ctor):
14+
//ifxDB.getStaticInstance(conf)
15+
CouchbaseDatasource.initialize(conf)
16+
MongodbDatasource.initialize(conf)
17+
logAnalyticsInstallation()
18+
19+
appLifecycle.addStopHook({ () =>
20+
Future.successful {
21+
LPLogger.D2("onStart")
22+
}
23+
})
24+
25+
def logAnalyticsInstallation(): Unit = {
26+
// Log the entry point from server installation
27+
JGoogleAnalyticsTracker.setProxy(System.getenv("http_proxy"))
28+
val config = new AnalyticsConfigData("UA-61313158-2")
29+
val tracker = new JGoogleAnalyticsTracker(config, GoogleAnalyticsVersion.V_4_7_2)
30+
tracker.trackEvent("Anyplace Installation", "Anyplace Server start", "Anyplace logging")
31+
}
32+
33+
}

server/app/ErrorHandler.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ import utils.{LPLogger, LPUtils}
4848
class ErrorHandler extends HttpErrorHandler {
4949

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

5656
def errorMsg(request: RequestHeader): String = {

0 commit comments

Comments
 (0)