Skip to content

Latest commit

 

History

History
104 lines (65 loc) · 5.81 KB

README.md

File metadata and controls

104 lines (65 loc) · 5.81 KB

TRUCKERJOBS4U

This is a working landing page concept for TRUCKERJOBS4U. Built in Rails 7 with Ruby 3. Using postgresql for database, tailwindcss for style, and devise for auth. I used elements from flowbite to get the design together quickly as there was no initial design concept. The page needs to accomplish a few things.

  • One it needs to gather the bare minimum information from a driver who is job hunting,
  • Two it needs to collect email address of drivers job hunting.
  • Third it needs to send notifications to the admin and driver. The admin needs to get the info from the contact form. The driver needs a thank you. Notified through email.
  • Fourth, there needs to be a admin section that shows the gathered information with functionality to search, sort by date created, verify icon that emails were sent, delete option, and comment field for adding notes.

Some functionality previously working has been removed.

  • The create user was removed for now, until the app is up as well.
  • PP check is no an option. If false the info is lost and return to page with alert message.
  • Thank you to driver does not link to app, until app is ready.

This page is one way to get to the app and is used to gather information.

Devise is used but users can not register. Use console to create admin with role of 1 or "admin" so emails can be sent. WIll error is no admin present.

Admin

The admin dashboard has two parts. Small column for a list of newsletter emails and a large column for the leads - (landings), information. The leads have pagination through the pagy gem.

Here is the Hero section of the landing page. The header is minimal and stuck to the top. Logo links to it's self. CTA links to contact form at end of page.

Screenshot of Hero on landing page

Under the hero section is the newsletter sign up. This collects the email and a response email is sent. No account created. The Privacy Policy must be checked. Still working on sending notification of on checked. Default is true, refresh of page set to true.

Screenshot of the Newsletter section on landing page

About section gives a brief introduction to TRUCKERJOBS4U.

Screenshot of the About section on landing page

Meet the team section includes cards to introduce who work for the driver.

Screenshot of the team section on the landing page

Contact form at the bottom of the page. This gathers the drivers name, email, phone, and location. Also includes the Privacy Policy check. On submit needs to send emails and create initial account. The mail controller searches for and gets the admin email as the from to send the email. A user with the role admin must be available and the email must reference mailersend.

Screenshot of the contact form on the landing page

Admin Dashboard The admin shows all the emails from the newsletter and the contact information. Can sort name and location columns. Can search any of the fields in search box. Can update notes for contact record and delete records.

Screenshot of the admin dashboard

This README would normally document whatever steps are necessary to get the application up and running.

  • Ruby version

    • 3.1.4
  • System dependencies

    • Needed to set up 2 client servers on DigitalOcean. Memory usage is high. Will update.
    • Mailersend using SMTP relay for dev. Need username and password from setting up relay user, in env. Run (EDITOR="code --wait" bin/rails credentials:edit) in terminal at root of app to set env variables. Use the email used here to create, for creating admin user.
    • Using pagy gem for pagination in admin.
    • Using ransack gem for sort and search in admin.
    • Using meta-tags for seo.
  • Configuration

    • Can not register users for landing page. Use console to add one user with role of admin. email: "mailersend@reference", password: "secure-password", role: 1 - (role: "admin")

    • Postgresql - pg

    • Tailwindcss

    • Devise

    • Mailersend

    • Pagy

    • Ransack

    • Meta-Tags

  • Database creation

    • bin/rails db:create
      • typical rails config for dev, test, prod.
        • landings table - contact form. (did not think that through)
        • newsletter_emails
        • users - for admin only currently
  • Database initialization

    • I run linux, Pop Os, so linux gem is in place.
    • My system has no sudo user so I use the default for pg. Hence the extra config in the database.yml. The password and user are hard coded, also default for pg.
  • How to run the test suite

    • Testing soon.
  • Services (job queues, cache servers, search engines, etc.) *Setting up on render is straight forward. Nothing special about the landing page. No seed currently so need ssh to access to create admin. Admin is user with role admin. Two roles currently 0 = user, 1 = admin. Possible 3rd role of recruiter.

    UPDATE

    • Render does not have SMTP ports open. Switched to DigitalOcean. Using Mailersend for SMTP service and works fine on DigitalOcean. No users can be created. Use console to create admin. Admin required for email to work.
  • Deployment instructions

    • Render pulls from github. Need to create the rails master key but really that is about it. Spin up a pg server on Render, grab the db internal url and slap it in the environment area of the web app and it is up.

    update

    • See update in services. Switched to DigitalOcean because Render does not support SMTP through port 587. Will ask for SECRET_KEY_BASE env variable for production run. I used the master key for it. Worked fine.

See the associated project for updates.