- Jbuilder - Default JSON rendering gem that ships with Rails, used for making reusable templates for JSON output.
- JWT - For generating and validating JWTs for authentication
app/models
- Contains the database models for the application where we can define methods, validations, queries, and relations to other models.app/views
- Contains templates for generating the JSON output for the APIapp/controllers
- Contains the controllers where requests are routed to their actions, where we find and manipulate our models and return them for the views to render.config
- Contains configuration files for our Rails application and for our database, along with aninitializers
folder for scripts that get run on boot.db
- Contains the migrations needed to create our database schema.Mailer
- Contains the mailer functions that send details to users and vendors.
get '/*a'
- Endpoint for not found.
get '/meals'
- Lists out all meals
resources :users, param: :_user_id
get '/users/:_user_id
- Returns user profile datapost '/users/:_user_id
- Creates a userdelete '/users/:_user_id
- Deletes a userpost '/user/login
- Authenticates User and generates and returns JWTget '/orders'
- Returns all orders for current userpost '/orders'
- Creates and order for the current userget '/orders/:order_id'
- Return a specified order, cannot return order that does not belong to the current user
resources :orders
get '/vendors
- Returns all vendors profilesget '/vendors/:_vendor_id
- Returns vendor profile datapost '/vendors/:_vendor_id
- Creates a vendordelete '/vendors/:_vendor_id
- Deletes a vendorpost '/vendor/login
- Authenticates vendor and generates and returns JWTpost '/vendor/:_vendorname/meals/new'
- Create meal for the current vendorget 'vendor/:_vendorname/orders'
- Get all orders for the current vendorget 'vendor/:_vendorname/orders/incomplete'
- Get all uncompleted orders for the current vendorget 'vendor/:_vendorname/orders/complete'
- Get all completed orders for the current vendorget 'vendor/:_vendorname/orders/dispatched'
- Sets dispatched on a vendors order to !dispatchedget 'vendor/:_vendorname/orders/paid'
- Sets paid on a vendors order to !paidget 'vendor/:_vendorname/orders/delivered'
- Sets delivered on a vendors order to !delivered
post '/password/forgot'
- Initiates the recover password mechanismpost '/password/reset'
- Resets consumers password