Skip to content

This is an example of user management system server application.

Notifications You must be signed in to change notification settings

andrejrs/symfony-user-management-example

Repository files navigation

symfony-user-management-example

This is an example of user management system server application.

The system is designed to create new user in a simpler and faster way. In addition to creating users, it is also possible to create user groups.

The following packages were used to create the application:

Getting Started

In order to run the we application, it is necessary to execute a few commands from the terminal.

Application tested on Docker with:

  • PHP 7.3.3
  • Nginx 1.15.10
  • Mysql 5.7.22
  • Symfony 4.2

Prerequisites

To start this project, you need to have the following components installed:

  • PHP 7+ - PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
  • Composer - Composer is a dependency manager for PHP. Composer will manage the dependencies that require on a project by project basis. This means that Composer will pull in all the required libraries, dependencies and manage them all in one place.

Installing

  • First of all, it is necessary to update the vendor files. You can do this by invoking the following command:
$ composer install
$ php bin/console server:run
  • Open your browser and point to http://localhost:8000/. You'll see a welcome page. To stop the server just press Ctrl+C from your terminal.
  • Another way is it using the Docker. Docker is a tool created to make it easier to run web applications.
$ cd docker
$ docker-compose up

Now you can point your browser to http://localhost and see the application. If you want a port other than default, just specify it in docker/docker-compose.yml.

  • Now it's time to fill the database. To create entity query tables run make:migration. To run generated SQL migration, execute doctrine:migrations:migrate:
php bin/console make:migration
php bin/console doctrine:migrations:migrate
  • Tables are now created in the database. To insert "fake" data in database run next command:
php bin/console doctrine:fixtures:load 

With this command we filled the tables in the database with fale test data.

  • Use the following login params to login as test account:
Username: test@nesto.com
Password: test
  • Login parameters for MySQL server are located in .env file on line 27.

Structure

  • Routing logic for the web application are located in src/Controller.
  • Routing logic for REST api application are located in src/Rest/Controller.
  • Business logic are located in src/Repository.
  • Working logic for entities from the DB are in src/Service.
  • A "fake" data generator used to load test data into a database are located in src/DataFixtures

Versioning

Version 1.0.1

  • Added the ExceptionController that handles exception in relation to the end point of app (Web and REST API).
  • Added two new actions in API UserController (Add and remove user from a group).
  • The button for removing the UserGroup is disabled if the users are in the group, otherwise the button is active.
  • Added a list of users that are in group on UserGroup edit page (The administrator can remove users from the group).

Version 1.0.0

  • The first commit of application

Screenshots

alt tag alt tag alt tag alt tag alt tag

Authors