1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00
Framadate v2 API backend en symfony. dépot miroir
Go to file
2021-06-07 12:13:00 +02:00
assets/styles upgrade all, add migration from framadate v1 2021-04-20 16:14:34 +02:00
bin upgrade all, add migration from framadate v1 2021-04-20 16:14:34 +02:00
config send modifier token after submitting a vote stack 2021-06-07 12:13:00 +02:00
doc dev conf nginx 2021-04-30 22:32:58 +02:00
migrations add migration for first info on zero knowledge 2021-05-18 23:27:04 +02:00
public save new stack and return updated poll 2021-04-29 11:41:36 +02:00
src send modifier token after submitting a vote stack 2021-06-07 12:13:00 +02:00
templates remove content in header, upgrade deps 2021-05-21 10:52:34 +02:00
tests Fix client request on POST poll (new poll). 2020-05-23 18:37:09 +02:00
translations head and foot 2020-10-26 11:39:04 +01:00
.env var env for mailer 2021-05-21 10:15:48 +02:00
.env.test Add test for admin, fix issue on admin token parameter. 2020-05-23 16:31:59 +02:00
.gitignore upgrade all, add migration from framadate v1 2021-04-20 16:14:34 +02:00
.gitmodules add submodule for frontend 2021-02-12 14:19:41 +01:00
.htaccess hop 2020-01-23 15:19:07 +00:00
composer-setup.php add graphql bundle 2020-10-28 15:46:39 +01:00
composer.json add symfony profiling, and spool for emails 2021-05-21 10:09:51 +02:00
composer.lock remove content in header, upgrade deps 2021-05-21 10:52:34 +02:00
composer.phar add graphql bundle 2020-10-28 15:46:39 +01:00
LICENSE Mettre à jour LICENSE 2020-12-14 12:12:28 +01:00
phpunit.xml.dist Add first functional tests for Poll. 2020-05-08 23:00:57 +02:00
README.md cleanup poll reports, compare expiration date and list soon to be deleted, disable vote on expired 2021-05-03 14:38:08 +02:00
symfony.lock add symfony profiling, and spool for emails 2021-05-21 10:09:51 +02:00
update.sh up script up 2021-04-29 10:20:12 +02:00
yarn.lock head and foot 2020-10-26 11:39:04 +01:00

#Funky Framadate API REST backend in symfony 5 for Funky framadate frontend. https://framagit.org/framasoft/framadate/funky-framadate-front


Name Method Scheme Host Path


_preview_error ANY ANY ANY /_error/{code}.{_format}
admin_homepage_get_default GET ANY ANY /admin/
admin_homepage_clean_expired_polls GET ANY ANY /admin/polls/clean/{token}
admin_homepage_migrate_framadate GET ANY ANY /admin/polls/migrate
home_sweet_home GET ANY ANY /
admin_homepage_migrate_from_v1 GET ANY ANY /migration-from-v1/{unique_key}
user_homepageget_default GET ANY ANY /user/
user_homepage_polls_send_by_email GET ANY ANY /user/{email}/polls/send-by-email
poll_index GET ANY ANY /poll/
poll_new GET|POST ANY ANY /poll/new
poll_show GET ANY ANY /poll/{id}
poll_edit GET|POST ANY ANY /poll/{id}/edit
poll_delete DELETE ANY ANY /poll/{id}
api_get_poll_comment GET ANY ANY /api/v1/comment/poll/{id}/comments
api_new_comment POST ANY ANY /api/v1/comment/poll/{id}/comment
api_poll_comments_delete DELETE ANY ANY /api/v1/comment/poll/{id}/comments
api_get_all_polls GET ANY ANY /api/v1/poll/
api_get_poll GET ANY ANY /api/v1/poll/{customUrl}
api_get_protected_poll GET ANY ANY /api/v1/poll/{customUrl}/pass/{md5}
api_get_admin_poll GET ANY ANY /api/v1/polladmin/{admin_key}
api_update_poll PUT ANY ANY /api/v1/poll/{customUrl}/{token}
api_new_poll POST ANY ANY /api/v1/poll/
api_test-mail-poll GET ANY ANY /api/v1/poll/mail/test-mail-poll/{emailChoice}
api_poll_delete DELETE ANY ANY /api/v1/poll/{customUrl}
api_check_slug_is_unique GET ANY ANY /api/v1/poll/slug/{customUrl}
api_get_admin_config GET ANY ANY /api/v1/poll/admin/{token}
api_new_vote_stack POST|OPTIONS ANY ANY /api/v1/vote/poll/{custom_url}/answer
api_update_vote_stack PATCH ANY ANY /api/v1/vote/vote-stack/{id}/token/{modifierToken}
api_poll_votes_delete DELETE ANY ANY /api/v1/vote/poll/{id}/votes/{accessToken}


TODO:

  • coordinate properties and paths to be more restful.

return stack of votes when we want to get the configuration of one poll (see doc/examples.md)


Requirements

You MUST have php version 8+ (see installation doc) and Composer, 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:

php bin/console doctrine:schema:validate

Getting started

Follow this guide to setup.

Development

install dependencies with Composer

configure env by creating local env file

cp .env .env.local

and edit the file variables to give access to database.

Launch dev server with the "symfony" cli tool:

symfony serve

there are examples of request to make it all work in the doc/examples.md.

Check prerequisites

composer check-platform-reqs

install the vendors

composer install

#Funky Framadate API Experimental REST backend in symfony 5 for Funky framadate frontend. https://framagit.org/framasoft/framadate/funky-framadate-front

Follow this guide to setup.

  • run composer install configure env by creating local env file cp .env .env.local and edit the file variables to give access to database.

TODO:

return stack of votes when we want to get the configuration of one poll (see doc/examples.md)


Requirements

You MUST have php version 8+ and Composer, 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:

php bin/console doctrine:schema:validate

Getting started

Development

install dependencies with Composer

there are examples of request to make it all work in the doc/examples.md.

Check prerequisites

composer check-platform-reqs

install the vendors

composer install

configure database access in .env.local file

This project can use any database system, we provide config for mysql.

If you need to setup mysql, a database and a user, read the database_creation doc. Before customizing your local environment config. the .env.local file will not be versionned by git, so no risk to set the mysql credentials in here as long as file access are well done.

You can copy the model env file and customize it last line to access mysql.

cp doc/env-example .env.local

look for the line like this

DATABASE_URL=mysql://framadate-admin:framadate-admin-password@127.0.0.1:5432/framadate-api

and change its values for framadate-admin , framadate-admin-password, framadate-api.

initiate the database with fixtures

php bin/console doctrine:schema:drop --force
php bin/console doctrine:schema:create
php bin/console doctrine:fixtures:load --no-interaction --purge-with-truncate

launch local server with

php bin/console server:run

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 this file is not versionned and should stay like this.

cronjob to delete expired polls

add this line in your crontab to run the clearance of expired polls everyday at 0h00.

0 0 * * * wget http://MYWEBSITE/api/v1/poll/clean-polls 

you can open your crontabl in command line with :

crontab -e

About

made by B. Lemoine, aka Tykayn, for the framadate funky front end project, a polling libre software.

contacts