This is a Rails API for a chatroom application, including routes for sessions, registrations, chatroom and message controller. You can find the deployed link on render here: https://podclub-backend.onrender.com/
To use this API, you can clone the repository from GitHub and follow the instructions below.
This API was built with Ruby on Rails, version 6.1. You will need to have Ruby and Rails installed on your machine to use it. You can check if you have them installed by running the following commands in your terminal:
ruby -v
rails -v
If you don't have them installed, you can follow the instructions on the Ruby and Rails websites to install them.
-
Clone the repository:
git@github.com:e-nk/pod-backend.git
-
Navigate to the project directory:
cd pod-backend
-
Install the dependencies:
bundle install
-
Set up the database:
rails db:create db:migrate
-
Start the server:
rails server
-
You should now be able to make requests to the API at
http://localhost:3000
.
POST /sessions
: Authenticate a user.
POST /registrations
: Create a new user.
GET /chatroom
: Show all chatrooms.GET /chatroom/:id
: Show a specific chatroom.POST /chatroom
: Create a new chatroom.PATCH /chatroom/:id
: Update a specific chatroom.DELETE /chatroom/:id
: Delete a specific chatroom.
POST /message
: Create a new message.
DELETE /logout
: Log out a user.GET /logged_in
: Check if a user is logged in.GET /
: Show the home page.
To use this API, you can make HTTP requests to the various routes described above. For example, to create a new user, you could make a POST request to /registrations
with the user's email and password in the request body.
To authenticate a user and create a session, you can make a POST request to /sessions
with the user's email and password in the request body. This will return an authentication token that you can use for subsequent requests that require authentication.
This API was built with Ruby on Rails, version 6.1. It uses the following gems:
bcrypt
for password encryptionrack-cors
for handling Cross-Origin Resource Sharing (CORS)
If you would like to contribute to this project, please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.