https://github.com/tvziet/market_place_api
This project for practicing API on Rails 7
https://github.com/tvziet/market_place_api
api aws-s3 postgresql rails7 ruby swagger unit-test
Last synced: 9 months ago
JSON representation
This project for practicing API on Rails 7
- Host: GitHub
- URL: https://github.com/tvziet/market_place_api
- Owner: tvziet
- Created: 2023-01-09T15:23:17.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-30T10:46:12.000Z (over 1 year ago)
- Last Synced: 2025-01-16T00:17:00.037Z (over 1 year ago)
- Topics: api, aws-s3, postgresql, rails7, ruby, swagger, unit-test
- Language: Ruby
- Homepage:
- Size: 2.53 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# This project for practicing API on Rails 7







## API documents
Start server, then access path: `/api-docs`.
## How to setup
- Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
- Create the database:
```bash
rails db:create
```
- Run migration:
```bash
rails db:migrate
```
- Run tests:
```bash
rails test
```
- Run linters:
```bash
bundle exec rubocop
```
## Description
### Models
- `User`
- `Order`
- `Product`
- `Image`
- `Comment`
### Associations
The `user` will be able to place many `orders`, upload multiple `products` which can have many `images` or `comments` from another `users`.
## Notes
### `fast_jsonapi` gem
When we use this gem, we generate serializer, it will generate the folder `serializers`. We neet to load this folder in `application.rb` file:
```ruby
config.eager_load_paths << Rails.root.join("serializers")
```
### How to write custom validator methods
Read more here: [Understanding Rails Custom Validations](https://abhinavgarg1218.medium.com/rails-custom-validations-109e3e42b6fd)