React Directory: ./app/javascript/packs
💡 This is a Rails-React hybrid repository. For the Front-End of the application, Rails only rendering one empty view(app/views/pages/index.html.erb) with the default layout. In the default layout we have javascript_pack_tag
which is rendering the react scripts. After this initial response from rails, all the interactions are made with API calls(app/javascript/packs/src/API) with Backend via React. There is no other full-page response other than the first one.
☕ Browse through a list of coffee beans.
⭐ You can add new coffee beans and put them in your favorite list.
🔒 Also you can create your own account to secure your favorite list.
- Jump To: How To Use Locally
- Jump To: Tests
- Jump To: Nice To Have Requirements
- Jump To: Future Features
- Jump To: Contributing
- Jump To: Acknowledgements
- Rails
- React
- Redux
- Jest
- RSpec
- A modern browser, up to date.
- Node.js, if you are going to use it in the local environment.
- A text editor.
- Clone the repository:
git clone https://github.com/kubilaycaglayan/coffee.git
- Enter the project directory:
cd coffee
- Checkout to current the working branch
git checkout coffee
- Run npm to install the dependencies
npm install
- Run bundle to install the dependencies
bundle
- Initialize the database with these set of commands
rails db:create && rails db:migrate && rails db:seed
After setup:
- Start the server
rails s
- You can visit the website by typing this to your browser:
http://localhost:3000/
There are two sets of tests for this project. One for Rails and one for React side.
After setup:
- Run tests with
npm test
, and then please pusha
to run all the tests. - Or, as an alternative to the above, you can directly run this command
npx jest
. - All the API methods, reducers and actions are tested. Also, containers and components which does not require login are also tested.
- Run tests with
rspec
- All controller actions are tested with requests. Also model associations tested.
- Implement proper user authentication from the front-end to the server
I wanted to learn more about authentication relationships between rails and react, when we are not allowed to use rails views.
- Create a user table in your database, so that a given user could only access the favourites they selected
I wanted to give my users a better experience. They can have their own isolated area in the website. They customize their favorites list. Also easily scalable to other features like sending text messages.
- Create an admin panel to create /update / delete houses
I wanted to give my users a better experience. They can have create own coffees. This is not as an admin panel. Every logged in user can add a coffee to the system with an image.
- Users can delete the coffees.
- Users update coffees.
- Users can send text messages each other.
👤 Kubilay Caglayan
- Website: kubilay
- Github: @kubilaycaglayan
- Twitter: @kbcaglayan
- Linkedin: linkedin
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Design idea by Alexey Savitskiy on Behance
- Burger Menu
- Carousel
- Open console in test environment
rails c -e test
- Start server in test environment
rails s -e test
- Reset test database
rails RAILS_ENV=test db:reset
- Seed test database
rails RAILS_ENV=test db:seed
- Show current database in rails console
ActiveRecord::Base.connection.current_database