The purpose of this project is to allow users to create an account, then, drop a comment or more for the developer. I like to call them thoughts.
This project is developed using Symfony (4).
- Install dependencies
composer install-
Database configuration
- Configure your .env:
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name - Create the database:
php bin/console doctrine:database:create - Create the database schema:
php bin/console doctrine:schema:create
- Configure your .env:
-
Generate the SSH keys (for JWT Token Configuration):
$ mkdir -p config/jwt
$ openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096
$ openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -puboutIn my case, I used PuttyGen to generate a key and saved the private key as private.pem. Then, ran the second command:
openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout.
- Start your server
symfony serve:start --no-tls`- Create an account (
first_name,last_name,email,password,created_at,updated_at) - Login (
email,password)
Thought::entity - id, user_id, comment, created_at, updated_at
- List all your thoughts (GET
/thoughts) - Store a thought (POST
/thoughts) - Show a thought (GET
/thoughts/{thought}) - Edit a thought (PUT
/thoughts/{thought}) - Delete a thought (DELETE
/thoughts/{thought})
Okay, so testing has been stressful and quite annoying to be frank 🙄
But we'll pull through 🚀
- Edit your
.env.localfile (duplicate.envinto.env.localif you haven't done so already)
APP_ENV=test - Duplicate
.env.testinto.env.test.local - Set up your test database
php bin/console doctrine:database:create - Load up the fixtures
php bin/console doctrine:fixtures:load - Run the tests
php bin/phpunit
For now, only functional tests are available. Codebase is still a bit buggy, but one step at a time.
Please set up your TEST_USER_EMAIL and TEST_USER_PASSWORD in your .env.test.local.
- Registration
Testing for both successful and failed requests. - Login
Testing for both successful and failed requests. - Profile Access
- Main CRUD [Thoughts]