- Create an API that returns a list of Content items with fixed attributes
- Ruby:
2.6.0
- Rails:
6.0.0.beta1
- PostgreSQL
- Angular CLI
7.0.6
- NodeJS
8.10.0
- Clone the repository.
- Goto cloned repository using -
cd cms_api_test/
(or whatever your local project folder name) - Create a
database.yml
andmaster.key
file in config folder. There is adatabase.sample.yml
andmaster.sample.key
file in the same directory. Copy and paste the contents of those files in your newly created YAML file. Then change accordingly. (e.g. change database username/password/db_name) - Install required gems(libraries) -
bundle install
- In your command line run -
rake db:create
(It'll create a new database in mysql) - In your command line run -
rake db:migrate
(It'll add tables to your newly created database) - In your command line run -
rake db:seed
(It'll add data to your newly created database tables) - Run
redis-server
from another terminal. If its not installed in the machine then runsudo apt install redis-server
for ubuntu, in OSX runbrew install redis-server
- Run Sidekiq using
bundle exec sidekiq
- Run
rails server
(It'll run the backend system on port 3000). Be sure to run it on port 3000 - If all dependencies met, then the backend api will run on
localhost:3000
- Goto
cd cms_api_test/frontend/cms-api-frontend
in a different terminal. - install node dependencies using
npm install
- Then run
ng serve
to run the frontend. It'll open a new tab in the default browser with URL:localhost:4200
- The fetched published contents will be shown there.