This is the Unlight server maintenance by Open Unlight and based the CPA's Unlight server.
More information please reference ours developer document.
- Ruby 2.6.8
- MySQL 8.0
- Memcached
- SQLite (for development)
- Refactor
- Unit Test (In progress)
- Feature Test
- Convert to Framework
- Dawn Core
- Dawn CLI
- ...
This project is under a Unix-like environment and suggests using macOS as the development environment and Linux as the production environment.
Below is for macOS to set up the development environment.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After the script is executed, you can use brew doctor
to ensure the configuration is correct.
There are two options for the virtual environment, you can choose rbenv
or rvm
to manage it.
# Use rbenv
brew install rbenv
brew install ruby-build
# Use rvm
brew install rvm
Please follow the terminal message to update .bashrc
or your shell configuration.
# Use rbenv
rbenv install 2.6.7
# Use rvm
rvm install 2.6.7
You may need to install the bundler for the newly installed Ruby.
gem install bundler -v 2.1.4
The MySQL isn't the latest version, please notice don't use mysql
instead of mysql
for install.
# Install
brew install mysql
# Start Server
brew services start mysql
# Install
brew install memcached
# Start Server
brew services start memcached
brew install sqlite3
You can use the bundler
to install the necessary RubyGems.
bundler install
If you got the error message for mysql2
gem, you need extra configure it to install it.
export LIBRARY_PATH=$(brew --prefix openssl@1.1)/lib:$LIBRARY_PATH
gem install mysql2 -v 0.5.3 -- --with-mysql-config=/usr/local/opt/mysql/bin/mysql_config
We attach importance to the code quality, all codes should pass our static analysis and tests eg. Rubocop, RSpec, etc.
According to our coding guideline, each function should be tested with RSpec to ensure each unit are stable and safe to be changed.
Please run the RSpec test to ensure your change isn't break anythings.
bundle exec rspec
To keep we have a stable codebase, the coverage should be above 80%. Please add tests if you add something new.
Currently, we are focus on the unit-test we will start working on the feature test after our refactor.
If you are interested to contribute to this project, we are welcome to see you pull request and discuss with you about improving it.
This server is available as open source under the terms of the Apache 2.0 License.