Table of Contents
Who hasn’t wished for a mentor while learning to code? Many turn to online communities to seek help, but sometimes, nothing beats meeting someone face-to-face, sharing knowledge, and growing together over a warm conversation.
That’s where FikaCode comes in. Inspired by the Swedish concept of "Fika"—a delightful tradition of sharing coffee, tea, and sweet treats—this platform is designed to connect coders. It’s a space where mentors and learners can meet, enjoy a fika, and discuss programming.
With such an inviting concept, it’s hard to say no to fika and growth.
FikaCode is a full-stack project built with Ruby on Rails for the backend and Ember.js for the frontend.



Ensure you have the following installed:
- Ruby 3.2.0
- Rails 8.0.1
- Node v18.20.4
- SQLite version 3.45.1
- Clone the repo
git clone https://github.com/Yifan-858/fikacode.git
- Backend Setup (Rails)
# navigate to backend folder cd backend # install dependency bundle install # set up the test database rails db:create db:migrate db:seed # run server rails server
- Frontend Setup (Ember)
# navigate to backend folder cd frontend # install dependency npm install # makesure the apihost URL in your environment.js points to your Rails backend, for exmaple ENV.apihost = 'http://localhost:3000' # run the server ember server
- Configured CORS in the Rails backend to enable the Ember.js frontend to fetch data from the Rails API running on a different port.
- Initially, models were implemented with ActiveModel for lightweight in-memory data storage with Rails cache. However, during the process, it is switched to using Applicationrecord for a persistent database for testing and deploying (SQLite3 & PostgreSQL). After the refactoring, it is easier to validate data with built-in validation methods and error management.
- Implemented controllers to handle API endpoints for managing Fika invitations and User data. Used strong parameters to handle parameter checking.
- Implement the login API endpoint where users can authenticate and receive a JWT to access the protected routes. Added credentials.yml and master_key to secure the API secrets.
- To protect the User and Fika data, centralized authentication logic was added in the application_controller to make sure all controllers inherited it. Using before_action in Fika and User controller to call the authentication before access to protected endpoints.
- Added seeds.rd for the database to generate a batch of test users.
- Avoid hardcoding and to make setup and deployment more flexible. Use ENV to access the URL when making a fetch request to the backend API, for example, in the services.
- Using Ember CLI “ember create” to generate the /signup, /login, and /dashboard routes and their associated controllers. Updated the /index route to /landing to make it more readable.
- Validates the user input to avoid unnecessary API requests. After a successful signup, the page redirects the user to the login page to make a smooth user experience
- Validates user input before invoking the authentication in the session service.
- Handels the user login across the whole project and stores the session token in the local storage to provide access to user-specific data.
- Handles the API requests to retrieve user-specific fika invitation data and the other users’ information in the community. Storing these methods in services makes it more flexible and reusable to fetch the data across the project.
- Displays the user’s profile, user-specific fika invitation data, and the other users’ information on the dashboard. Using an async function is inserted with Promise.all to fetch and render all data at the same time, reduce uncécessray delay, and give a smoother user experience.
- Reusable components like community-list, fika-list, fika-button, status-button, and notification are built to make the templates cleaner and more readable. By breaking the UI into smaller parts, it would be easier to maintain and reuse the components throughout the project, even as it grows.
In summary, the frontend is built with these concepts in mind:
- routes: responsible for loading necessary data for rendering the page.
- controller: manage the user interaction with UI components.
- service: centralize the API request logic and provide reusable methods throughout the whole project.
- template: maintain the HTML structure of the application.
- components: break down reusable UI parts to ensure a maintainable and scalable design.
- Use before_action callbacks in backend controllers
- Use ApplicationRecord/ActiveModel built-in validations
- Use Strong Parameters to handle parameter checking in backend controllers
- Frontend use controllers, routes,services and components to divide different tasks
- Extract backend APIhost URL from environment configration in frontend
- Clean up console.log statement
- Try to explain WHY and HOW in code description
- Didn't get how to use Model with Ember effectively.
- Struggled with getting UI component updated dynamically, for example, can't update the fika status in real time. As a workaround, the page currently refreshes to display updates.
- Managed to build and push the Rails backend to Heroku, but struggled to get the database running with PostgresQl.
- Make another try to deploy the backend on Render
- Make the button UI component reusable