uAdmin the Golang Web Framework =============================== uAdmin is easy to use, blazing fast and secure. It is a simple yet powerful web framework for building web applications. Before you proceed to the installation, go over to the `Getting Started`_ to see the prerequisite requirements. .. _Getting Started: https://uadmin-docs.readthedocs.io/en/latest/getting_started.html Installation ^^^^^^^^^^^^ .. code-block:: bash $ go get -u -v github.com/uadmin/uadmin/... To test if your installation is fine, run the **uadmin** command line: .. code-block:: bash $ uadmin Usage: uadmin COMMAND [--src] This tools helps you prepare a folder for a new project or update static files and templates Commands: prepare Generates folders and prepares static and templates version Shows the version of uAdmin Get full documentation online: https://uadmin-docs.readthedocs.io/en/latest/ Your First App ^^^^^^^^^^^^^^ Let's build your first app which is a Todo list. First, we will create a folder for your project and prepare it. .. code-block:: bash $ mkdir -p ~/go/src/github.com/your_name/todo $ cd ~/go/src/github.com/your_name/todo $ uadmin prepare [ OK ] Created: /home/pc_name/go/src/github.com/your_name/todo/models [ OK ] Created: /home/pc_name/go/src/github.com/your_name/todo/api [ OK ] Created: /home/pc_name/go/src/github.com/your_name/todo/views [ OK ] Created: /home/pc_name/go/src/github.com/your_name/todo/media [ OK ] Created: /home/pc_name/go/src/github.com/your_name/todo/static [ OK ] Created: /home/pc_name/go/src/github.com/your_name/todo/templates Now use your code editor to create `main.go` and put this code inside it. .. code-block:: go package main import ( "github.com/uadmin/uadmin" ) func main() { uadmin.StartServer() } Prepare modules .. code-block:: bash go mod init go mod tidy Now to run your code (Linux and Apple macOS): .. code-block:: bash go build; ./todo In Windows: .. code-block:: bash go build & todo Result: .. code-block:: bash [ OK ] Initializing DB: [13/13] [ OK ] Initializing Languages: [185/185] [ INFO ] Auto generated admin user. Username: admin, Password: admin. [ OK ] Synching System Settings: [51/51] [ OK ] Server Started: http://0.0.0.0:8080 ___ __ _ __ __/ | ____/ /___ ___ (_)___ / / / / /| |/ __ / __ __ \/ / __ \ / /_/ / ___ / /_/ / / / / / / / / / / \__,_/_/ |_\__,_/_/ /_/ /_/_/_/ /_/ .. IMPORTANT:: In Windows, you need to use localhost in order to run your application (e.g. http://localhost:8080). If you go to the explorer, you will notice that there are automatically generated **.key** and **.salt** files hidden in your computer. **.key** is used for authentication process to assure that the key of the user ("person A" for instance) held by "person B" belongs to the authenticated user which is "person A". **.salt** is extra salt added to password hashing. They add an extra security to your application. Once they have been deleted, no one can login to your application unless you use the recovery admin account that is automatically generated by your terminal. .. image:: assets/keysalt.png :align: center | Open your browser and go to http://localhost:8080. Then login using "admin” as username and password. .. image:: tutorial/assets/loginform.png :align: center | Well done! You have created your first application with the following `system models`_ in the uAdmin dashboard. .. image:: assets/uadmindashboard.png | Go to `uAdmin Tutorials`_ section for the continuation. .. _uAdmin Tutorials: https://uadmin-docs.readthedocs.io/en/latest/coverage.html .. _system models: https://uadmin-docs.readthedocs.io/en/latest/system_reference.html Update uAdmin to latest version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Open your terminal and apply the following commands: .. code-block:: bash $ cd ~/go/src/github.com/uadmin/uadmin $ go install $ uadmin version [ INFO ] 0.7.4 .. toctree:: :maxdepth: 1 getting_started coverage application quiz api dapi quick_reference system_reference tags bestpractices about license roadmap