The project is split into several distinct modules.
symbiotic-shared
- Shared code and traits required by all libraries.symbiotic-core
- Provides the core document mangement .functionality.symbiotic-fs
- Provides peristent storage of files to the filesystemsymbiotic-json
- Provides JSON conversions for the data types in thesymbiotic-shared
lib.symbiotic-mongodb
- Provides persistent storage of files and metadata using MongoDB (with GridFS)symbiotic-postgres
- Provides persistent storage of metadata using postgres, and files using thesymbiotic-fs
library.symbiotic-play
- Provides Play! Framework JSON formatters and a Guice module to use in a Play! Framework application.symbotic-testkit
- Test specs to verify different persistence implementations, etc.
In addition there's an example implementation using the core libraries:
- examples/
symbiotic-server
- Play! Framework reference implementation. - examples/
symbiotic-client
- Sample client application in Scala-JS.
To see an example of how the symbiotic core libraries can be used, please refer
to the modules symbiotic-client
and symbiotic-server
. Here you'll find an
implementation of a simple document management system using the available features
in Symbiotic.
The client started off as an experiment in using scala-js with a large'ish codebase. To which the conclusion is a big thumbs up.
- A computer (!) preferrably *nix based.
- JDK 1.8 or higher
- SBT
- Docker
- Latest version of Nginx or some other proxy that supports streaming uploads.
The project provides a convenience script to bootstrap the necessary databases. For this to work, please ensure docker is installed on the machine. Then run the following script:
./backends.sh start
To stop the database containers:
./backends.sh stop
To clean the databases (in case a fresh start is desired):
./backends.sh clean
To restart with clean databases (does stop, clean and start):
./backends.sh reset
Ensure that the database instances are running before executing the tests. Otherwise tests will fail miserably.
By default the sample application is configured to use MongoDB. But, by changing
the file examples/symbiotic-server/conf/application.conf
you can run using a
Postgres database instead:
# This is the main configuration file for the application.
# ~~~~~
include "play.conf"
include "silhouette.conf"
//include "symbiotic-mongo.conf"
include "symbiotic-postgres.conf"
The social authentication config is located in the file symbiotic-server/conf/silhouette.conf
.
If you want to use any of these (e.g. Google), ensure you follow the instructions
for the appropriate API on how to get the necessary clientId and secret. Do not
commit your keys to the source repository. Instead you should export them as
environment variables. An example for google would be:
export GOOGLE_CLIENT_ID="theclientid"
export GOOGLE_CLIENT_SECRET="thesecret"
To start the server, execute the following sbt command:
sbt "project symbiotic-server" run
or
project symbiotic-server
run
Before loading the client in a browser, you will need to compile the code first:
sbt "project symbiotic-client" fastOptJs
or
project symbiotic-client
fastOptJs
See the wiki for more information about the nginx setup.
To load some test data into the database, you can run the following command from sbt
:
test:runMain util.testdata.TestDataLoader
All contributions should be made as pull requests to the master branch.
-- Copyright (c) Knut Petter Meen, All rights reserved. scalytica.net