Focus Community v0.1.0 beta is now available. First sex of the New Year! First time for you! ~
This is the first release of the community, and there are many more features to be discovered. We sincerely invite you to pay attention to the development of GoFrame project and contribute to the ecological development.
Zero, about Focus
Focus Focus community is a GoFrame community project, which uses simple and powerful GoFrame as the back-end WEB framework. As the front-end system needs SEO, GF template engine is used, the database uses MySQL, and the front-end uses jQuery/ Bootstrap framework.
First, the source address
github
:github.com/gogf/focusgitee
:gitee.com/johng/focus
Ii. Demo address
Focus.goframe.org/
Three, installation and deployment
The installation
1, download the source code of the project: git clone [https://github.com/gogf/focus] (https://github.com/gogf/focus)
Create focus database
CREATE DATABASE `focus` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';
Copy the code
3. Run focus. SQL under Document to initialize database SQL.
4. Copy the config.example.toml configuration file from config to config.toml.
# database configuration
[database]
link = "Mysql: root: 123456 @ TCP (127.0.0.1:3306)/focus"
debug = true
Copy the code
5, Run: go run main.go
6. Visit http://127.0.0.1:8199 to see the login page. The default account/password is goframe / 123456
The deployment of
1, install GF-CLI tool chain, see: development tools
2, package command: execute GF build, for detailed configuration, please refer to build cross-compilation
3, packaging results: The default Linux/MacOS/Windows three versions.
Trash ├── trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trash ├─ trashCopy the code
4. Place config.toml and focus in the same directory and start Focus.
release
In the default configuration file configuration, the public and template directories are binary packaged and shipped with the executable. Therefore, you only need to copy config.toml and focus to the target server when publishing. Alternatively, you can consider distributing specific configuration files as packages, so that only the Focus executable needs to be published.
If you want to package the configuration file into the executable, you can also refer to the modification method for reading the default configuration file: Config Management # Default File Modification
Iv. Project structure
├ ─ ─ app │ ├ ─ ─ dao │ ├ ─ ─ model │ ├ ─ ─ Shared │ └ ─ ─ system │ ├ ─ ─ the admin │ │ └ ─ ─ internal │ └ ─ ─ index │ └ ─ ─ internal │ ├ ─ ─ API │ ├─ define │ ├─ Service │ ├─ Config │ ├─ Document │ ├─ Library │ ├─ Public │ Template │ ├─ upload │ ├─ ├─ go. ├─ main.goCopy the code
5. Description of contents
Directory/file name | instructions | describe |
---|---|---|
app |
Business logic layer | Directories where all business logic is stored. |
– dao |
The data access | Database access operations, including only the most basic database CURD method. |
– model |
The data model | Holds data related entity structure definitions. |
– system |
System module | It may contain multiple subsystems, with resources isolated from each other. |
– index |
The front page | Subsystem, front-end page. |
– internal |
Internal module | Internal system modules that are only available for current internal system calls and cannot be shared between systems. |
– api |
Business interface | An entry/interface layer within the system that receives/parses user input parameters |
– define |
Structure definition | System internal input and output data structure definition. |
– service |
Logic encapsulated | Encapsulate the internal business logic of the system to achieve specific business requirements. |
config |
Configuration management | Directory for storing all configuration files. |
docker |
Image file | Docker image dependency files, script files and so on. |
document |
Project documentation | Documentation project Documentation, such as design Documentation, help Documentation, etc. |
library |
The public library package | Common functionality packages often do not include business requirement implementations. |
packed |
Package directory | Package the resource fileGo The files are stored here,boot Automatically called when the package is initialized. |
public |
Static directory | Only files in this directory can be accessed by static services. |
template |
Template file | Directory where MVC template files are stored. |
Dockerfile |
Image description | The cloud native era is used to compile and generate Docker image description file. |
go.mod |
Dependency management | useGo Module Dependency description file for package management. |
main.go |
Entrance to the file | Program entry file. |
Six, frame design
Because of the powerful and easy-to-use GoFrame development framework, you can refer to some of the framework design introduction.
- Code layering
- Object encapsulation design
- The Context Context
- Single-application multi-system design
- More: Frame design
Vii. Project screenshots
Figure 1. Community Home page
Figure 2. Login page
Figure 3. Registration page
Figure 4. Publish/edit page
Figure 5. Content details
Figure 6. Search page
Figure 7. Personal homepage
Figure 8. Edit data