Geocaching portal allows you to create new safes and discover existing. Application alows also to edit end removeing existing safes by author.
All safes are described by title, author, localization description and map with its position.
git clone https://github.com/wojkot/GeoCaching.git
npm install
Application uses MongoDB and it is necessary first to install it.
Start mongod Processes using default settings, by typing the following command at the system shell:
mongod
npm start
This will start server on localhost:3000.
Method | URL | Description |
---|---|---|
GET | /load | Load all safes from database with name and description. For first safe read detailed data to display it. |
POST | /safe/add | Save data of added safe. |
PUT | /safe/save | Save data of edited safe. |
POST | /safe/markdiscovered | Mark safe as discovered by actually logged user. |
GET | /safe/edit | Get data of edited safe from database. |
GET | /safe/select | Get all data of actually selected safe. |
DELETE | /safe/remove | Remove selected safe. |
Method | URL | Description |
---|---|---|
POST | /login | Login user according do username and password |
GET | /login | Redirect to login page. |
POST | /register | Register user |
GET | /register | Redirect to register page. |
GET | /logout | Log off user. |
Main page allows to browse all safes with its description and localization. Unlogged user has no permission to create new safes and mark existing as discovered. To log in, click button "Login" on top right corner, it redirect you to login page. If you have no account, go to registration page and then log in. As logged user you can add new safes, editing and removing it. You can also mark any safe as discovered, which will write you to the list of discovers (you can also remove yourself from this list, by unchecking 'Discovered' checkbox).
- Log in
- Click button Add safe
- Fill all fields
- Click button Add
- If everything is ok, you should see message with information of result of operation. New safe should appear on list.
To test some features mainly connected with situations when user must be logged in (adding, removing, editing safes), there is a special patch, which create test user with id and name. This user phisically not exists in database. To test all features please activate patch, by adding/uncommenting these lines in main app.js file:
43.//Patches - uncomment only for testing purposes
44.const addTestUser = require('./patches/patch_add_user');
45.app.use(addTestUser.addUser)
Run test using command:
npm test
After running tests, patch should be removed/commented in code (patch file is localized in directory 'patches').