- π About the Project
- π₯ Live Demo
- π» Getting Started
- π₯ Authors
- π Future Features
- π€ Contributing
- βοΈ Show your support
- π Acknowledgements
- β FAQ (OPTIONAL)
- π License
budget-app-ror The Ruby on Rails capstone project (Budget app) is about building a mobile web application where you can manage your budget: you have a list of transactions associated with a category, so that you can see how much money you spent and on what.
- Use ruby gems as software packages system.
- Install Ruby on Rails framework.
- Understand Rails RESTful design and router.
- Use controllers to handle requests and render empty views.
- Use params from browser request in a safe way.
- Use preprocessed html file with embedded Ruby code.
- Use layouts and templates for shared content.
- Use database migration files to maintain database schema.
- Use validations for models.
- Secure app from n+1 problems.
- Understand what ORM is.
- Write SQL queries with ActiveRecord.
- Set up associations between models.
- Build a webapp that requires the user to log in.
- Use devise gem for authentication.
- Limit access to webapp resources based on authorization rules.
- Analyze in writing why you have made a coding choice using one structure over another.
Client
Database
- Register
- Login
- Make new transactions.
- Create Category
- Edit Category
- Create Transaction for the category
- See the total expense spent on each category
To get a local copy up and running, follow these steps.
- But before you install Rails, you should check to make sure that your system has the proper prerequisites installed. These include:
- Ruby
- SQLite3
- MacOS
- Ubuntu
- Windows
There are several tools that can be used to install Ruby on your local machine. The most popular are:
rbenv
RVM
asdf
We will go with rbenv because it does not override any of the system shell scripts like RVM and it allows us to compile older Ruby versions that will fail with RVM.
Run the following commands in your terminal:
brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 3.0.1
rbenv global 3.0.1
ruby -v
Note: If you are using a shell other than bash, for example zsh, you should change the first line to use zshrc like this:
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
or any other config file of your shell.
You can install Ruby on Ubuntu in several ways. The easiest way is to run the following command (source):
sudo apt-get install ruby-full
If that doesn't work, you can try installing Ruby using rbenv. This is a version manager tool for the Ruby programming language on Unix-like systems.
Run the following commands in your terminal:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 3.0.1
rbenv global 3.0.1
ruby -v
consider checking Install ruby on Ubuntu 20.04 with rbenv.
Installing Ruby on Windows is a little more difficult than installing it on another OS. We would recommend using WSL, but you can also try to install Ruby directly on your OS with rubyinstaller.
WSL only works on 64-bit installations of Windows.
If you are using a 64-bit version of Windows 10, we recommend following this article to install Ruby.
If you can not use WSL then you should follow these steps:
Download the last version of RubyInstaller. Run RubyInstaller and follow the steps described here.
ruby --version
ruby 2.7.0
To install Rails on Windows, you'll first need to install Ruby Installer.
To install PostgreSQL, first refresh your serverβs local package index: follows this link for detail explanation
sudo apt update
Then, install the Postgres package along with a -contrib package that adds some additional utilities and functionality:
sudo apt install postgresql postgresql-contrib
Ensure that the service is started:
sudo systemctl start postgresql.service
To install Rails, use the gem install
command provided by RubyGems:
gem install rails
Clone this repository to your desired folder:
cd my-folder
git clone git@github.com:belaymit/budget-app-ror.git
Install this project with:
cd budget-app-ror
bundle install
To run the project, execute the following command:
rails server
To run tests, run the following command:
rspec spec/models // to test models
rspec spec/requests/controller_name_spec.rb // to test controllers
rspec spec/views // to test views
π€ Belay Birhanu G
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
- Sidebar
- Add More Relations
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project please consider starring it
- I would like to thank Microverse Community
- I would like to thank Gregoire Vella, the original designer of the project
-
Why ruby on rails?
- There are several reasons why developers choose Ruby on Rails as their web application framework of choice:
-
Productivity: Rails provides a lot of built-in features and conventions that make it easy to create a functional web application quickly. For example, it comes with its own ORM (Object Relational Mapping) system, which simplifies database interactions, and provides a lot of helper methods and templates to quickly build out common functionality.
-
Convention over configuration: Rails has a set of conventions that help developers to structure their code in a consistent and maintainable way. This means that developers can spend less time configuring their application and more time writing code.
-
Ruby programming language: Ruby is a very flexible and expressive programming language that is easy to read and write. It allows developers to focus on the business logic of their application rather than getting bogged down in boilerplate code.
-
Active community: Ruby on Rails has a very active and supportive community of developers who contribute to the framework and share their knowledge and expertise through various online resources and forums.
-
Scaling: Rails is designed to scale well, and there are many tools and techniques available to help developers scale their applications as their user base grows.
-
- There are several reasons why developers choose Ruby on Rails as their web application framework of choice:
This project is MIT licensed.