HKG cache
HKG is too slow. This is a cache backend + frontend written in Scala Play! and AngularJs
How to start dev?
- Backend: Install Scala(2.11.x), sbt(0.13.x), MongoDB(v3.x), Redis(v3.x).
brew install scala sbt mongodb redis
.
- Frontend: Install node, npm, bower, grunt.
brew install npm
.npm install -g bower grunt-cli
.
cd ./ui
andnpm install
andbower install
.- Run MongoDB which is used to save post.
- Run
mongod
. It defaults to read/data/db
and needsrwx
permission.
- Run
- Run Redis which is used to save history.
- Run
redis-server
.
- Run
- In project root,
sbt run
to start the server.- If it feels stuck, run
sbt run -v
for more details.
- If it feels stuck, run
http://localhost:9000/
should work.
How to deploy?
make clean
thenmake
to package- uplaod
target/universal/golden-cache-{version}.zip
to your production machine - install
docker
anddocker-compose
in your production machine - unzip the pacakge, make sure
bin/golden-cache
is executable - run
sh golden-app.sh start
, it may need sudo since it need to bind to port 80
How to test?
Test in Scala (Backend)
sbt test
Test in AngularJS (Frontend)
The Angualr JS uses Jasmine for testing. The testing codes are written in test/spec/*.js
If you encounter any problems related to karma in running grunt test
, please install the following package:
npm install karma phantomjs jasmine-core
cd ui
grunt test
TODO
- UI enhance
- FAQ
- backend write test
- front end write test
- parse [img], [url]... tag