Skip to content

wijayadavin/acceloop-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

377 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acceleroop-web

Tech Stack:

  • Rails with HATEOAS architecture as the backend
  • Vue.JS as the frontend
  • Heroku as the deployment server + devops tool

Table of Contents

💎 Dependencies

  • Ruby version 2.7.6 for the backend (recommended installation via RBENV)
  • NVM for the Node version manager
  • Recommended Operation System is UNIX, e.g. WSL2, MacOS, or Linux
  • Any PostgreSql version as the Database
  • Any Redis-server version for caching

Setting Up Dev Environments

This application requires PostgreSQL and Node JS + Yarn to be installed. Automatic setup

chmod +x setup
./setup

Or Using Manual Setup

To install PostgreSQL:

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib libpq-dev

To install NodeJS and Yarn:

sudo apt-get install npm
npm install -g yarn

🔧 Installing package dependencies

To install the required Ruby gems and JavaScript packages, run:

bundle install
yarn install

Troubleshoot

Error related to Rmagick, e.g. : Rails: Error installing rmagick - ERROR: Failed to build gem native extension To solve it, try to run this:

sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev

Peer authentication problem with user 'postgres' It happens because by default the DB username is 'postgres'. Make a .env file on your root project folder and put: "DATABASE_USERNAME"=$USER Or if you want to customize your username, you can change the peer configuration into md5 inside the pg_hba (read more)

Database creation

  1. Install PostgreSql, read more at https://www.postgresql.org/download/linux/ubuntu/

  2. Create a new PostgreSql user (default is username: postgres and password: postgres), read more at https://www.postgresql.org/docs/7.3/sql-createuser.html

  • Note: Sometimes there might be a peer problem error when trying to login, if that is your problem, please refer to this StackOverflow solution: https://stackoverflow.com/a/18664239
  1. Create the development and test databases for this application, run:
rake db:create
rake db:migrate
rake db:fixtures:load

(This is only for the first time, and make sure to run it after installing the PostgreSQL and set the username and password correctly for your PostgreSQL system. See the Environment section below for more info about Database ENV customization)


🚀 Usage

(Optional) To start the PostgreSQL and Redis services using docker, run:

./bootstrap

To run the app, run:

rake start

On your web browser, go to http://localhost:3000.

To login as an admin user: Username: super@admin.com Password: password

By default all dummy users have password: 'password'. (See more other dummy usernames).


(Optional) To access the UI garage, go to this URL:

localhost:3000/glib/json_ui_garage

(Only when needed) This application uses Sidekiq as the background job processor. To start Sidekiq, run:

sidekiq

⚙️ Others

Acceloop Search Engine Submodule

This directory contains the submodule for the Acceloop Search Engine. It's a separate repository that's integrated into the main project as a submodule.

Setting up the Submodule

When you clone this repository, the submodule won't be initialized and updated by default. The ./setup will init the submodule but if you still want to initialize, fetch, and checkout the submodule manually, run:

git submodule update --init --recursive

To pull the latest changes from the submodule's remote repository:

git submodule update --remote

To commit:

git add submodules/acceloop-search-engine
git commit -m "Update the acceloop-search-engine submodule"
git push origin [branch_name]

Opening in Visual Studio Code

If you want to work on the submodule in a separate Visual Studio Code window, navigate to the submodule's directory and use the code command:

code submodules/acceloop-search-engine

This will open the submodule in a new VS Code window, allowing you to work on it separately from the main project.

Console for debugging

Rails application's models and data in real-time.

rails console

Ruby Linter

This application uses Rubocop as the ruby linter. To automatically attempt to fix using Rubocop, run:

rubocop -A

To run Rubocop without automatically fixing it, run:

rubocop

Note: You can also integrate Rubocop into your text editor or IDE to get real-time feedback on your code as you write it. For example, if you use Visual Studio Code, you can install the vscode-ruby extension to get Rubocop support directly in your editor.

Testing development email

  1. Install Mailcatcher using RubyGems:
gem install mailcatcher
  1. Start Mailcatcher in the terminal:
mailcatcher
  1. Open your browser and go to http://localhost:1080/ to access Mailcatcher's web interface. This is where you can view any emails sent to Mailcatcher.

Environment variables

You can use .bashrc or add .env file on the root of this project to define the Environments. Some basic ENV for development you can use to get started:

DATABASE_PORT=5432
DATABASE_USERNAME=your_postgres_username
DATABASE_PASSWORD=your_postgres_password

(optional) You can also customize some ENV variables like the db config, e.g.:

DATABASE_USERNAME=admin
DATABASE_PASSWORD=admin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors