SimpleAdmin — simple way to create an administrative panel
Hi guys! Perhaps you already had time to read my recent article about creating an open source project and know the tips I gave to beginners at the stage of planning and getting started working on the project.
It’s been more than half a year since I wrote the article and the original idea has transformed into something new. Initially, the basic concept was to create a gem for creating admin panels (there are already quite a lot of them), but eventually, after proceeding to work on the project, I radically changed its concept.
How does it work on the application side?
SimpleAdmin is a service to visually create admin panels without resorting to a programmer’s help; you are not tied to a specific programming language because all data is transferred through the API, and the admin panel structure is being built on the fly depending on the entities and fields you created using the visual component of the service.
Suppose we have a “Blog” application having a “Posts” model with title and description fields. For integration, you need a small library that connects to your project and creates the following API endpoints:
- simple_admin/entities — two actions (index, show) to get a list of all models and fields, to get a list of fields for a particular model
- simple_admin/resources — performs standard CRUD operations, requests a list of entries (resources)
- simple_admin/versions — transfers the current gem version in the project for synchronization with the service
In order for the data not to fall into the hands of intruders, on the application side creating a special environment variable with a secret key:
ENV['SIMPLE_ADMIN_SECRET_KEY'] = 'SECRET_KEY'
On the project creation page, you shall specify a secret key, your website URL, project name and description. There are two conditional abstractions on the service side: Entity and EntityFields, which are a reflection of your model and fields therein.
How does it work on the service side?
After the project creation, click on the project name and you will see the admin part.
When editing the model, you can create fields in two ways:
- Create a field by separately selecting its type and page where it will be displayed
- Check the required fields (or vice versa remove)
You can select the following attributes when creating the field:
- Field shortcut (how the field will look like in the admin panel)
- Field type (number, line, text, etc.)
- Display on page (page of all entries and page of a particular entry)
- Sorting by field — you can sort entries in descending/ascending order
- Search by field — you can check only the fields engaged in search
On the collection page, you can see a list of your most recent entries, sort them by id and title, find the desired entry and perform standard creation, editing and deletion operations.
Advantages of the service
The main advantage of SimpleAdmin is the feature of editing the admin panel without any programming skills, and flexible architecture that does not bind you to a single programming language.
The library installation takes 5 minutes of programmer time and in the future, any task related to the addition of new fields or features can be performed by a person without special technical skills, which of course is beneficial to the business.
We will help you install SimpleAdmin in your project for free and help with the configuration for Ruby on Rails to work further on improving the project quality and adding a new features that would simplify your work. Concerning all issues, you can write firstname.lastname@example.org.
What is planned for the next release?
* At the moment, SimpleAdmin is at the alpha version stage.
All project tasks are stored in open source. The main tasks planned to be implemented in the next release:
- Add new field types (image, wysiwyg editor, tags, prices, etc.)
- Add the option to embed your logic in the service side controllers.
- Caching for a list of models and frequently used data
- Add a Dashboard page and a statistics widget (the total number of entries)
Tips for beginners
Getting started working with the concept requires collecting as much feedback from the potential target audience, friends, as possible. If the concept captured you and you did not lose interest in it after some time and it is unique in the territory of your (or another) region, it is worth entering a list of tasks (trello, pivotal tracker).
Ask what features the project target audience would like to see in your service (* if it is not target, then feedback can be negative). Openly publish reports on what was done and what kind of features you plan to add in the future (blog and social networks).