Finnjamboree 2016 mobile application backend. All content types support unlimited amount of different language versions.
Node.JS and PostgreSQL
Clone this repository.
Make sure your postgreSQL instance is running and make sure that you have a postgreSQL user and database for that user.
Set database settings as environment variable:
For running the app normally
`export DATABASE_URL=postgres://username:password@host:port/databasename`
For running tests for the app
`export TEST_DATABASE_URL=postgres://username:password@host:port/databasename`
Install all dependencies: npm install
Create tables: npm run seed-database
Create sample data: npm run create-fixtures
. Sample data is based on real data at Roihu2016 finnjamboree.
Define your email send settings in mailsettings.js
file. Set APP_URL
environment variable to application url, so that link in email is correct.
Start server with npm start
You can enable dev settings and api explorer with NODE_ENV=dev npm start
All GET requests should use lang parameter like LocationCategories/translations?lang=FI
- User completed achievements -> GET api/ApiUsers/{id}/completedAchievements
- Mark achievement completed -> PUT api/ApiUsers/{id}/achievements/rel/{fk}
- Mark achievement un-completed -> DELETE api/ApiUsers/{id}/achievements/rel/{fk}
- All achievements -> GET api/AchievementCategories/translations
- All Locations -> GET api/LocationCategories/translations
- use param
afterDate
with javascript ISO formatted date to get articles after that date. There is five minute "safezone" before that. (Date format:2016-05-23T13:10:08.553Z
)
- use param
- All instructions -> GET api/InstructionCategories/translations
- use param
afterDate
with javascript ISO formatted date to get articles after that date. There is five minute "safezone" before that. (Date format:2016-05-23T13:10:08.553Z
)
- use param
- Events search -> GET api/CalendarEvents/translations
- to filter results use loopback filters https://docs.strongloop.com/display/public/LB/Querying+data
include
filter may result in unwanted behaviorfields
filter will be overwritten- use
textfilter
param to search text from name and description
- Users calendar -> GET api/ApiUsers/{id}/calendar
- Add event to calendar -> PUT api/ApiUsers/{id}/calendarEvents/rel/{fk}
- remove event from calendar -> DELETE api/ApiUsers/{id}/calendarEvents/rel/{fk}
- Submit new event -> POST api/CalendarEvents
- Login -> POST api/ApiUsers/login
- Logout -> POST api/ApiUsers/logout
- Email login -> POST api/ApiUsers/emailLogin
- Saml login -> POST saml/login