2019-10-25 14:59:20 +02:00
#Funky Framadate API
2019-11-27 20:55:59 +01:00
Experimental REST backend in symfony 4 for Funky framadate frontend.
https://framagit.org/framasoft/framadate/funky-framadate-front
2020-01-22 14:09:01 +01:00
Follow this guide to setup.
2019-11-28 17:12:38 +01:00
## TODO:
2019-11-27 20:55:59 +01:00
2019-11-28 17:12:38 +01:00
return stack of votes when we want to get the configuration of one poll (see [doc/examples.md ](doc/examples.md ))
2019-11-06 11:12:16 +01:00
***
2019-12-30 12:22:04 +01:00
### Requirements
You MUST have php version 7+ and [Composer ](https://getcomposer.org/download/ ), and a database like Mysql, or postgresql, or mongodb, or any database that Doctrine can handle.
Setup access to database by creating a .env.local file, and fill the database user and password data.
you can check that the database connection works with the command:
```bash
php bin/console doctrine:schema:validate
```
2019-12-30 19:12:47 +01:00
## Getting started
2019-12-30 12:22:04 +01:00
2019-11-27 20:55:59 +01:00
# Development
2019-11-06 11:12:16 +01:00
install dependencies with Composer
2019-11-27 20:55:59 +01:00
2019-12-30 19:12:47 +01:00
there are examples of request to make it all work in the [doc/examples.md ](doc/examples.md ).
2019-12-30 12:22:04 +01:00
2019-11-27 20:55:59 +01:00
### install the vendors
```bash
composer install
```
2019-11-28 14:16:56 +01:00
### initiate the database with fixtures
```bash
php bin/console doctrine:schema:drop --force
2019-11-27 20:55:59 +01:00
php bin/console doctrine:schema:create
2020-01-20 17:27:59 +01:00
php bin/console doctrine:fixtures:load --no-interaction --purge-with-truncate
2019-11-27 20:55:59 +01:00
```
### launch local server with
2019-11-06 11:12:16 +01:00
```bash
php bin/console server:run
```
2019-11-27 20:55:59 +01:00
2019-11-06 11:12:16 +01:00
# Production
set a virtual host on your server, configure CORS access to have the API to work.
configure database access in a .env.local file , replace variables
DATABASE_URL=mysql://database_user:db_user_password@127.0.0.1:3306/database_name
2019-12-30 19:12:47 +01:00
this file is not versionned and should stay like this.
2019-11-06 11:12:16 +01:00
2019-11-20 11:32:38 +01:00
## cronjob to delete expired polls
add this line in your crontab to run the clearance of expired polls everyday at 0h00.
```
2020-01-30 11:28:24 +01:00
0 0 * * * wget http://MYWEBSITE/api/v1/poll/clean-polls
2019-11-20 11:32:38 +01:00
```
2019-11-27 20:55:59 +01:00
you can open your crontabl in command line with :
```
2019-11-20 11:32:38 +01:00
crontab -e
2019-11-27 20:55:59 +01:00
```
2019-11-06 11:12:16 +01:00
# About
made by B. Lemoine, aka Tykayn, for the framadate funky front end project, a polling libre software.
## contacts
2019-11-27 20:55:59 +01:00
* contact@cipherbliss.com
* https://mastodon.cipherbliss.com/@tykayn
* https://keybase.io/tykayn
* https://twitter.com/tykayn
* https://cipherbliss.com