omar25ahmed / bevatel-backend-task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bevatel backend task

Bevatel backend task

In this task you should create an app that have two essential models (school / students) each school should have many students and when you delete it should be soft deleted and the record will persist in the database also it should have user model and an api for the students this api should have authentication system to be able to do the crud action for the students.

Built With

  • Ruby on Rails

Getting Started

Prerequisites

  • Ruby
  • Postgres server

Setup

Clone this repo and enter the directory.

git@github.com:omar25ahmed/bevatel-backend-task.git && cd bevatel-backend-task

Install

Run the following command to install all the dependencies.

bundler install

Usage

Run the following command to start the server, then go to http://localhost:3000

rails db:create # create database
rails db:migrate # migrate tables
rails db:seed # load all data in database from seed.rb

bin/dev # necessary to start the app for the first time
---- or ----
rails s # can be used after starting the app at least once

Usage via Docker

Run the following command to start the server by Docker, then go to http://localhost:3000

docker-compose down # to drop any existing container
docker-compose up --build # to start a new container
docker-compose run web rails db:create # create database
docker-compose run web rails db:migrate # migrate tables
docker-compose run web rails db:seed # load all data in database from seed.rb

Run tests

bundle exec rspec spec

Author

👤 Omar Ragheb

Show your support

Give a ⭐️ if you like this project!

About

License:MIT License


Languages

Language:Ruby 75.9%Language:HTML 21.0%Language:JavaScript 1.5%Language:CSS 0.8%Language:Dockerfile 0.6%Language:Shell 0.2%