Clodra.com Core Services(核心微服务 SNS),This application is single code based on Go. before your deployment you need read this document over lines to make sure your application is running on healthy environment.
NOT FULL MAINTAINED
This project is under construction. do not use this project on production mode before pre release.
这个项目还未建成,直到预发布前都不要用于生产,玩玩就可以了后续变化和功能增加还会很多。关于代码质量,我会在release前进行测试和code review.
PR: https://github.com/virskor/clodra-api/projects
Found all API descriptions on https://api.clodra.com .
Find Swagger file at https://api.clodra.com/api/v1/doc/index.html
代码质量查阅:https://goreportcard.com/report/github.com/virskor/clodra-api
并行的项目或者依赖开发
我们的项目中会存在一些在其他仓库同步开发的类库,或者拓展,当需要时我们会在下面列出。
Required
You should install Redis, Mysql, Nginx before running. You can use SQL server if you like. but notice that we would never know any problems on other DB engine. so Mysql is fully recommend.
You can use any configuration files for Nginx stored on root path of this project.
Your redis storage spaces should > 250m, and an 1core &250GB server or better.
Configurations
Modify your project configuration files by coping one on ./configs path. comments already given on those files. notice that your project will use different *.yml files on production and development env.
Run
Before running this project you should run go get to get all packages installed. and we are using Go-Air to refresh code on development mode. just run this command
bash server
# or
go run main.go --env development
Build
Build a release binary is easy but do not forget copy config files and swagger docs folder for realease binary.
Release for Linux:
swag init # generate swagger files
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o clodra-api # build
Then you need edit your production.yaml files at the ./config folder. now, you can boot it.
./clodra-api --env production --host api.clodra.com:80
Use nginx proxy to use SSL support is recommend. you can find nginx config file at root path.
and you need add some fileds into your hosts file.
127.0.0.1 www.clodra.cc
127.0.0.1 clodra.cc
127.0.0.1 api.clodra.cc
then you can visit it.