Skip to content

xcompass/ipeer4-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iPeer v4 Server

Master branch

The links to Travis and CodeClimate should be updated once the repository transfers

Build Status

Dev branch

Build Status

Code Analytics

Code Climate Test Coverage

Development Notes

See the /doc directory for documentation and development notes.

General debug tip: Delete the /app/cache folder if you change routing, database structure, or entity-ORM definitions.

Knowledge of the following topics is needed to work on the server-side iPeer4 code. UBC staff can get access to some nice tutorials on these topics at Lynda.com:

  • Git
  • PHP
  • MySQL (or another relational database)
  • Symfony Framework
  • RESTful Services & HTTP

Resources for Symfony and main bundles/technologies used in this application:

Setup and Usage

You will need composer: https://getcomposer.org/

Before developing or running, execute this command from the root of this repo to install the dependencies:

composer install

Once the database is setup (see below), to start/stop the server:

php app/console server:start
php app/console server:stop

Once running, check out the auto-generated api documentation at: http://localhost:8000/api/doc/. Change the port as needed.

For tinkering, you can use the sandbox at /api/doc, a command line HTTP client, or a browser extension (Postman - REST Client is quite nice).

Database

When running for the first time, copy app/config/parameters.yml.dist to app/config/parameters.yml and setup the database credentials.

Also run the following to create the database and tables for you:

php app/console doctrine:database:create
php app/console doctrine:schema:update --force

The tests make use of some "fixture" sample data. To load this into the regular database, run:

php app/console doctrine:fixtures:load

To reset the database and load the fixtures, use the reset shell script (uses the commands above after running doctrine:database:drop --force):

./app/reset

Tests

Tests are automatically run at Travis CI: https://travis-ci.org/cisdev2/ipeer4-server

Travis can take a while to run, so manually testing the code as you write is recommend.

Tests can be run with phpunit. They run on a different database (local SQLite), so they don't affect the main one. Change src to a more specific path/file if you want to run a specific test. The -c app loads the Symfony test config file from the app folder:

phpunit -c app src

About

iPeer v4 backend based on Symfony REST Edition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published