This is a backend-only project. Consists in an API REST for a car sale service. It allows the client app to offer the following workflow to the end user:
- The user logs in the app, by typing his credentials: email and password. If the credentials are valid A token authorization is returned.
- The user is presented with a list of cars.
- When a user selects a car, detailed information about that car is presented and the possibility add it to favorites
- The user can access a list of favorite cars
- Ruby on Rails
- Postgresql
- Rspec
- Shoulda matchers
- Factory bot
- Database cleaner
- Faker
- Bcrypt
- JSON web token
- Ruby: 2.7.0
- Rails: 5.2.4
- Postgres: >=9.5
- API client like Postman or HTTPie
To get a local copy up and running follow these simple example steps:
-
Under the repository name, click the Clone or download green button.
-
Copy the URL given by clicking the clipboard button
-
Open a terminal window in your local machine and change the current directory to the one you want the clone directory to be made.
-
Type git clone and the paste the URL you previusly copied to the clipboard
-
Change the current directory to the newly created folder
-
Install the ruby gems by running:
bundle install
- Setup database by running this:
sudo -u postgres psql
CREATE ROLE my_api WITH CREATEDB LOGIN PASSWORD 'pass123';
(Exit postgres console with \q)
- Make sure you have your yarn packages up to date. If not:
yarn install --check-files
- Populate the database by running:
rails db:create
rails db:migrate
rails db:seed
An admin user will be created with the following credentials:
email: admin@mail.com
password: pass123
- Start your web server:
rails server
-
Open your API client and go to localhost:3000
-
Read the documentation to know the way to make the requests properly
-
To run the automated unit tests use the following command:
bundle exec rspec
Read the public documentation here
https://find-a-car-api.herokuapp.com
Watch a video with the presentation of the project Here
Give a ⭐️ if you like this project!
This project is MIT Licensed
👤 Carlos Santamaría