Skip to content

Commit

Permalink
Merge branch 'development' into fix-missing-deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
geekelo committed Dec 14, 2023
2 parents 5c60508 + 8200763 commit 57c099f
Show file tree
Hide file tree
Showing 19 changed files with 1,004 additions and 22 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ AllCops:
- "Guardfile"
- "Rakefile"
- "node_modules/**/*"
- "spec/requests/api/*"

DisplayCopNames: true

Expand Down
8 changes: 7 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

ruby '3.0.2'
ruby '3.2.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.1.2'
Expand Down Expand Up @@ -35,10 +35,16 @@ gem 'bootsnap', require: false
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin Ajax possible
gem 'rack-cors'

gem 'rswag'
gem 'rswag-api'
gem 'rswag-ui'

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[mri mswin mswin64 mingw x64_mingw]
gem 'dotenv-rails'
gem 'rspec-rails'
gem 'rswag-specs'
end

group :development do
Expand Down
46 changes: 46 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ GEM
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.4)
Expand All @@ -95,6 +97,7 @@ GEM
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
diff-lcs (1.5.0)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
Expand All @@ -110,6 +113,8 @@ GEM
irb (1.10.1)
rdoc
reline (>= 0.3.8)
json-schema (4.1.1)
addressable (>= 2.8)
jsonapi-renderer (0.2.2)
jwt (2.7.1)
loofah (2.22.0)
Expand Down Expand Up @@ -137,12 +142,15 @@ GEM
nio4r (2.7.0)
nokogiri (1.15.5-x64-mingw-ucrt)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
pg (1.5.4)
pg (1.5.4-x64-mingw-ucrt)
psych (5.1.1.1)
stringio
public_suffix (5.0.4)
puma (6.4.0)
nio4r (~> 2.0)
racc (1.7.3)
Expand Down Expand Up @@ -190,6 +198,38 @@ GEM
psych (>= 4.0.0)
reline (0.4.1)
io-console (~> 0.5)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.1.0)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-core (~> 3.12)
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
rswag (2.13.0)
rswag-api (= 2.13.0)
rswag-specs (= 2.13.0)
rswag-ui (= 2.13.0)
rswag-api (2.13.0)
activesupport (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rswag-specs (2.13.0)
activesupport (>= 3.1, < 7.2)
json-schema (>= 2.2, < 5.0)
railties (>= 3.1, < 7.2)
rspec-core (>= 2.14)
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
ruby2_keywords (0.0.5)
stringio (3.1.0)
thor (1.3.0)
Expand All @@ -206,6 +246,7 @@ GEM

PLATFORMS
x64-mingw-ucrt
x86_64-darwin-22
x86_64-linux

DEPENDENCIES
Expand All @@ -219,6 +260,11 @@ DEPENDENCIES
puma (>= 5.0)
rack-cors
rails (~> 7.1.2)
rspec-rails
rswag
rswag-api
rswag-specs
rswag-ui
tzinfo-data

RUBY VERSION
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 NASIR KHAN, ELOGHENE OTIEDE, FATIMA NAJAFI, JOYCE CRUZ, ADEYEMI DADA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
169 changes: 152 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,163 @@
# README
////
<a name="readme-top"></a>
# 🏥 Fenaj Schedula API <a name="about-project"></a>

"token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOjd9.0bmab5NU1eMqNe0qvivl16GL9244EUnrIPs5ukIe0kc"

/////
This README would normally document whatever steps are necessary to get the
application up and running.
> The Fenaj Schedula API allows users to create an account, book a new session and can reserve the session.
Things you may want to cover:

* Ruby version
### Database Schema <a name="ER-diagram"></a>

* System dependencies
<div align="center">
<img src="./fenaj-schedula.jpg" alt="schema" width="600" height="auto" />
<br/>
</div>

* Configuration
### Frontend Repository
[Fenaj Schedula Front End](https://github.com/geekelo/fenaj-schedula)

* Database creation
### Api Documentation
API DOCUMENTATION - domain/api-docs

* Database initialization
## Project Kanban board:
[Kanban-board](https://github.com/users/geekelo/projects/3)

* How to run the test suite
## 🛠 Built With <a name="built-with"></a>

* Services (job queues, cache servers, search engines, etc.)
<ul>
<li>Ruby</li>
<li>Ruby on Rails</li>
<li>Postgres SQL</li>
</ul>

* Deployment instructions
### Key Features <a name="key-features"></a>

* ...
- [x] Create a user based on the role
- [x] Create a session and view all sessions
- [x] Create reservations and view all reservations

## 💻 Getting Started <a name="getting-started"></a>

To get a local copy up and running, follow these steps.

### Prerequisites

In order to run this project you need:

- Command line or terminal
- IDE such as VsCode.
- Rails needs to be installed on your system.

### Setup

Clone this repository to your desired folder:
Example command:

```sh
git clone git@github.com:geekelo/fenaj-schedula_API.git
```

### Install

Example command:

```sh
cd fenaj-schedula_API
bundle install (install all dependencies)
rails db:create (to create database)
rails db:migrate (to migrate tables)

```

### Usage

To run the project, run the following command:

```sh
rails s -p 30001

```

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- AUTHORS -->

## 👥 Authors <a name="authors"></a>

👤 **Nasir Mahmood**

- GitHub: [Nasirkhan294](https://github.com/Nasirkhan294)
- LinkedIn: [nasirmahd](https://www.linkedin.com/in/nasirmahd/)

👤 **Eloghene Otiede**

- GitHub: [@geekelo](https://github.com/geekelo)
- LinkedIn: [eloghene-otiede](https://www.linkedin.com/in/eloghene-otiede-b146a3232/)

👤 **Fatima Najafi**

- GitHub: [@fatima-najafi](https://github.com/fatima-najafi)
- LinkedIn: [fatima-najafi](https://www.linkedin.com/in/fatima-najafi/)

👤 **Joyce Cruz**

- GitHub: [@balastar](https://github.com/balatstar)
- LinkedIn: [joyce-ann-cruz](https://www.linkedin.com/in/joyce-ann-cruz-668a41a7/)

👤 **Adeyemi Dada**

- GitHub: [@yemidada](https://github.com/yemidada)
- LinkedIn: [yemidada](https://www.linkedin.com/in/yemidada/)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## 🔭 Future Features <a name="future-features"></a>

- [ ] add comments
- [ ] add likes
- [ ] error deduction for sessions

<!-- CONTRIBUTING -->

## 🤝 Contributing <a name="contributing"></a>

Contributions, issues, and feature requests are welcome!

Feel free to check the [issues page](../../issues/).

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- SUPPORT -->

## ⭐️ Show your support <a name="support"></a>

Please support this project and be a part of something meaningful and impactful. Your contribution can make a significant difference and help us achieve our goals faster.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- ACKNOWLEDGEMENTS -->

## 🙏 Acknowledgments <a name="acknowledgements"></a>

I would like to express my sincere gratitude to [Murat Korkmaz](https://www.behance.net/gallery/26425031/Vespa-Responsive-Redesign) for this design and to all my Microverse partners who contributed to this project.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## :question: FAQ <a name="faq"></a>

- **Can I fork and reuse this repository?**

Absolutely! Please feel free to fork and reuse this repository for your own projects.

- **Is it okay to improve this repository? Will my changes be accepted?**

Definitely! We welcome any improvements or new ideas you may have. If your changes are good and align with the project's goals, we would be happy to accept them.


<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- LICENSE -->

## 📝 License <a name="license"></a>

This project is [MIT](./LICENSE) licensed.

<p align="right">(<a href="#readme-top">back to top</a>)</p>
1 change: 1 addition & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
8 changes: 4 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
default: &default
adapter: postgresql
encoding: unicode
username: geekelo
password: geekelo
username: postgres
password: nasirkhan@21
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
<<: *default
database: fenaj_schedula_api_development
username: geekelo
password: geekelo
username: postgres
password: nasirkhan@21

# The specified database role being used to connect to PostgreSQL.
# To create additional roles in PostgreSQL see `$ createuser --help`.
Expand Down
14 changes: 14 additions & 0 deletions config/initializers/rswag_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Rswag::Api.configure do |c|

# Specify a root folder where Swagger JSON files are located
# This is used by the Swagger middleware to serve requests for API descriptions
# NOTE: If you're using rswag-specs to generate Swagger, you'll need to ensure
# that it's configured to generate files in the same folder
c.openapi_root = Rails.root.to_s + '/swagger'

# Inject a lambda function to alter the returned Swagger prior to serialization
# The function will have access to the rack env for the current request
# For example, you could leverage this to dynamically assign the "host" property
#
#c.swagger_filter = lambda { |swagger, env| swagger['host'] = env['HTTP_HOST'] }
end
16 changes: 16 additions & 0 deletions config/initializers/rswag_ui.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Rswag::Ui.configure do |c|

# List the Swagger endpoints that you want to be documented through the
# swagger-ui. The first parameter is the path (absolute or relative to the UI
# host) to the corresponding endpoint and the second is a title that will be
# displayed in the document selector.
# NOTE: If you're using rspec-api to expose Swagger files
# (under openapi_root) as JSON or YAML endpoints, then the list below should
# correspond to the relative paths for those endpoints.

c.swagger_endpoint '/api-docs/v1/swagger.yaml', 'API V1 Docs'

# Add Basic Auth in case your API is private
# c.basic_auth_enabled = true
# c.basic_auth_credentials 'username', 'password'
end
Loading

0 comments on commit 57c099f

Please sign in to comment.