The main goals for this exercise are:
- Implement a connection between a Ruby on Rails back-end and ReactJS front-end.
- Understand the pros and cons of different approaches of connecting Ruby on Rails back-end with ReactJS front-end.
In this project, only the Ruby on Rails back-end part was implemented. The front-end part of the project can be found in this repo.
- Ruby on Rails
- RSpec
- PostgreSQL
- JWT
- Cloudinary
- VisualStudio Code, Git, & GitHub
- Ruby (v. 3.0.1)
- Rails (v. 6.1.4)
- NodeJs (v. 14.17)
- YarnJs (v. 1.22.10)
- PostgreSQL (v. 12.8)
- Git
- In your terminal, in the folder of your preference, type the following bash command to clone this repository:
git clone git@github.com:aristides1000/awesome-events-back-end.git
- Now that you have already cloned the repo run the following commands to get the project up and running:
cd awesome-events-back-end
bundle
rails db:create
rails db:migrate
- Now, on your terminal, run:
rails server
This should start your local server in http://localhost:3000/. Now, you can open the REST API client of your choice (Thunder Client extension for VScode is recommended) to fetch the data from the API.
https://awesome-events-back-end.herokuapp.com/
Description | Endpoint | Method | Header | Body |
---|---|---|---|---|
Sign Up | /users |
POST | { "Accept": "application/json", "Content-Type": "application/json" } | {"user": {"name": "Daniel", "email": "daniel@mail.com", "password": "123456", "password_confirmation": "123456"}} |
Sign In | /users/sign_in |
POST | { "Accept": "application/json", "Content-Type": "application/json" } | {"user": {"email": "daniel@mail.com", "password": "123456"}} |
Sign Out | /users/sign_out |
DELETE | { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer " } | |
Fetch User Properties from Token | /logged_user |
GET | { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer " } | |
Fetch all available events | /events |
GET | { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer " } | |
Create a new Event | /events |
POST | { "Accept": "application/json", "Authorization": "Bearer " } | FormData(name: 'Event Title', description: 'Event Description', image: )) |
Delete an Event (Only the Event Creator can perform this action) | /events/:event_id |
DELETE | { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer " } | |
Reserve an Event | /attendances |
POST | { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer " } | { "attendance": { "event_id": 1, "date": "2025-01-01", "city": "Caracas" } } |
Fetch all user's Reservations | /attendances |
GET | { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer " } | |
Cancel a Reservation (Only the Attendee can perform this action) | /attendances/:reservation_id |
DELETE | { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer " } |
To stop the server, hit <CTRL> + C
on your keyboard.
You can also find an API-consumer built with ReactJS in this repo that will display one random greeting message in your browser.
👨💻 Daniel Samuel
👨💻 Arístides José Molina Pérez
- GitHub: @aristides1000
- Twitter: @aristides_1000
- LinkedIn: aristides jose molina perez
👨💻 Ênio Neves de Souza
- GitHub: @enionsouza
- Twitter: @enionsouza
- LinkedIn: Enio Neves de Souza
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Hat tip to anyone whose code was used 🔰
- Inspiration 💘
- Microverse program ⚡
- Our standup team 🏹
- Our family's support 🙌
This project is MIT licensed.