code4romania / rvm-api

Project for managing resources and volunteers for DSU (Departamentul pt Situatii de Urgenta)
Mozilla Public License 2.0
4 stars 13 forks source link

Resource & Volunteers Management App - API

GitHub contributors GitHub last commit License: MPL 2.0

API of the resource and volunteers management app of DSU (Dispeceratul pentru Situatii de Urgenta)

See the project live

DSU (Departamentul pentru Situatii de Urgenta) needs a digital tool to manage the resources it has at its disposal, their location, as well as the volunteers and NGOs that are registered to offer help during a crisis situation. The aim of this project is to offer a better management solution so that DSU is better prepared for an emergency situation.

Contributing | Built with | Repos and projects | Deployment | Feedback | License | About Code4Ro

Contributing

This project is built by amazing volunteers and you can be one of them! Here's a list of ways in which you can contribute to this project.

You can also list any pending features and planned improvements for the project here.

Built With

Programming languages

PHP

Platforms

Laravel

Frontend framework

Package managers

Composer

Database technology & provider

CouchDB

Repos and projects

Client of the API: https://github.com/code4romania/rvm-client

Development

To bootstrap the project (Run this only once), run the following commands in your shell:

Install composer dependencies

$ docker run -v ${PWD}/src:/app -w /app composer:latest composer install --ignore-platform-reqs --no-scripts --no-interaction --prefer-dist --optimize-autoloader

Copy environment variables and start the application

$ cp src/.env.example src/.env
$ docker-compose up

Setup CouchDB single-node here: http://localhost:5984/_utils#setup or do it manually by running:

$ docker exec -it rvm-api_app_1 sh -c 'curl -X PUT "http://$DB_USERNAME:$DB_PASSWORD@$DB_HOST:$DB_PORT/_users"'
$ docker exec -it rvm-api_app_1 sh -c 'curl -X PUT "http://$DB_USERNAME:$DB_PASSWORD@$DB_HOST:$DB_PORT/_replicator"'
$ docker exec -it rvm-api_app_1 sh -c 'curl -X PUT "http://$DB_USERNAME:$DB_PASSWORD@$DB_HOST:$DB_PORT/_global_changes"'

Run database migrations

$ docker exec -it rvm-api_app_1 php ./database/migrations/v_1_0_0.php -c migrate

Generate app secret key, and personal access client keys

$ ./scripts/artisan.sh key:generate
$ ./scripts/artisan.sh optimize
$ ./scripts/artisan.sh passport:install

Seed the database

$ docker run -v ${PWD}/src:/app -w /app composer:1.9.0 composer dump-autoload
$ ./scripts/artisan.sh db:seed --class=CourseNamesTableSeeder
$ ./scripts/artisan.sh db:seed --class=InstitutionsTableSeeder
$ ./scripts/artisan.sh db:seed --class=ResourceCategoriesTableSeeder
$ ./scripts/artisan.sh db:seed --class=CountriesTableSeeder
$ ./scripts/artisan.sh db:seed --class=CountiesTableSeeder
$ ./scripts/artisan.sh db:seed --class=CitiesTableSeeder
$ ./scripts/artisan.sh db:seed --class=StaticsViewsSeeder
$ ./scripts/artisan.sh db:seed --class=UsersTableSeeder

Every other time

$ docker-compose up

Swagger

L5-Swagger has been bundled which is a Laravel 5 - Swagger integration that works out of the box.

To parse new API route definitions, you need to publish a new version of Swagger definitions

$ ./scripts/artisan.sh vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"

To see all API definitions, hit the /api/documentation endpoint of the server.

Deployment

TBD

Feedback

License

This project is licensed under the MPL 2.0 License - see the LICENSE file for details

About Code4Ro

Started in 2016, Code for Romania is a civic tech NGO, official member of the Code for All network. We have a community of over 500 volunteers (developers, ux/ui, communications, data scientists, graphic designers, devops, it security and more) who work pro-bono for developing digital solutions to solve social problems. #techforsocialgood. If you want to learn more details about our projects visit our site or if you want to talk to one of our staff members, please e-mail us at contact@code4.ro.

Last, but not least, we rely on donations to ensure the infrastructure, logistics and management of our community that is widely spread across 11 timezones, coding for social change to make Romania and the world a better place. If you want to support us, you can do it here.