The easiest way to do this is to check out the Git repository:
git clone https://github.com/engineersftw/website.git
The git repository will be checked out into a local folder named website
.
(If you are keen on contributing to this project, do fork this repository and check out from your own fork of the Git repository.)
Install Homebrew.
Install rbenv:
brew update
brew install rbenv ruby-build
Add rbenv
support to your local profile:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
If you are using zsh
:
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
Install the current Ruby version:
rbenv install -l
rbenv install 2.6.5
You will need PostgreSQL installed and started.
For newbies, I'd suggest that you download and install Postgres Mac App. You may need to edit
config/database.yml
to connect via TCP socket.
Ensure that the PostgreSQL binaries are on your path. If you are using Postgres Mac App, you can do that like this:
echo 'export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
This will provide access to pg_restore
and pg_config
(which is needed later to compile the pg
gem).
Node.js is required for some of the Ruby gems. (There are alternatives.)
Install Node.js:
brew install node
Install Bundler:
gem install bundler
Install the rest of the Ruby Gems needed for the app (including Ruby on Rails):
bundle install
Create the database:
bundle exec rake db:create
Create the database tables:
bundle exec rake db:migrate
Prepare sample data:
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d website_development db/snapshot.dump
Prepare the environment file (one time exercise):
cp env.sample .env
You can start the local development web server with the following command:
foreman start
You can now visit the local development site at http://localhost:3000.
The Admin panel is accessible at http://localhost:3000/admin. The admin login email is admin@engineers.sg
and the default password is password1234
.
To stop the dev server, just press ctrl
+ c
on your keyboard to stop the foreman process.
Please fork this repository and send us pull requests to the develop
branch.
We use the RSpec testing framework for this app.
To run the test locally, use this command: bundle exec rspec spec
We use the Materialize CSS framework for all the design and layout of the site. Please refer to their documentation for more details on how to work with their markup.
Stylesheets are written in SASS.
All the views are written in Slim - a lightweight templating engine. Please refer to their documentation for more details.
All template files should end with the .html.slim
extension.
This software is released under the MIT License.
Copyright (C) 2017 Code Craft Pte Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.