Spacha / PoliisiautoServer

A server for an application where users can report bullying to a trusted adult.
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Important notice!

This is a prototype and must not be used in practice under any circumstances! The developers of this application do not take any responsibility, legal or otherwise, of using this application!


Poliisiauto server

Logo of Poliisiauto

A server for an application where users can report bullying to a trusted adult.

See this Google Drive document for initial server specification.

This server offers an API for various clients such as mobile applications (specifically for PoliisiautoApp). The API has a public endpoint for authentication and a large set of protected endpoints for authenticated users.

See the complete API description here.

Getting started

This software is build on Laravel 9 and requires a (PHP) web server capable of running it as well as a MySQL database. See the requirements in more detail in Laravel documentation: https://laravel.com/docs/9.x.

Project initialization

Access your server using ssh or other means. Navigate to the folder where you want to install the project.

Clone the project:

$ git clone https://github.com/Spacha/PoliisiautoServer.git

Install the dependencies using composer.

$ cd PoliisiautoServer
$ composer install

Create a .env file by copying the .env.example (see here for more information)

$ cp .env.example .env

Change necessary values in the .env files. Most important lines are these:

DB_DATABASE=poliisiauto
DB_USERNAME=root
DB_PASSWORD=secret

These should obviously match your database configuration. You need to have a database with that name before it can be initialized.

Generate an application key:

$ php artisan key:generate

Migrate the database (see here for more information):

$ php artisan migrate:fresh

NOTE: You may need to change the permissions of some folders (usually everything under storage).

$ chmod 0777 -R storage

Running tests

The tests can be run by (see here for more information):

$ php artisan test

Database seeding

If you want, you can "seed" the database with sample users and organizations using:

$ php artisan db:seed

License

PoliisiautoSERVER is licensed under a 2-clause BSD license. See LICENSE for more details.