DEV Community

Cover image for My Failed Student Housing App
Steve Frank
Steve Frank

Posted on

My Failed Student Housing App

tldr; I have a moderate sized PoC elixir code base collecting dust that will never be used again, and hopefully it has something someone will need.

Background

I've been looking into different markets for my next startup. One that stood out was Student Housing software for colleges and universities. What intrigued me initially was that the #1 company bought #2 and #3 in 2022, so the options for colleges dwindled to just a few. And the #1 can now charge 4-5x resulting in 6 figure yearly bills!

Certainly I can build something that I could charge significantly less that would benefit the few thousand smaller colleges that couldn't afford that price gouging.

While I was deep in customer discovery, I figured I would also build out a PoC to show directors at the school to let them know I deeply understood the problems they faced. If they could see that, then maybe they would give me a shot.

The Stack

  • Elixir
  • Phoenix + LiveView
  • TailwindCSS (with Flowbite)
  • Postgres
  • Ash (2.0, 3.0 wasn't out yet)

I always need to be learning, so I took the chance to finally learn Ash. Something about it screamed "Yes!" to me.

My previous passion project was ClickDuel and I used that to really dive into Elixir and LiveView. Take a look, my kids and I still love using it. So the housing app was my chance to take a deep dive into Ash.

Ash

As with any new tool, there is a ramp up period. Ash was no different. During the 4 months I worked on this project, as I struggled with doing some basic stuff (like Phoenix Forms using Ash) I kept asking myself, "Is Ash really gonna make me faster in the long run?" Now that I am on 2 other new projects, both using the same stack as above, I can confidently say yes. I am glad I had the time to learn Ash. The speed at which I got the new stuff up was crazy fast. And 3.0 introduces domains, which encapsulate code so much better.

I have used ORMs in PHP, C#, Ruby, and NodeJS, so I am well versed in the problems of figuring out your domain and data structures and mapping that to the tool du jour. Ash is not an ORM, but it serves the problem, and I like Ash's approach so much better than others.

The team is really responsive answering questions in their forum.

For my deployment model, every school would need to be isolated in the database, and Ash's multi-tenancy approach made this dead-a$$ simple to implement. Like, a few lines of code.

Ash also has a powerful policy system to enforce access to data, but it was just too much to learn, so I constantly just disabled it.

User Defined Schemas

The thing with Student Housing is that an immense amount of it is based on dozens of forms. A form to request housing, a form for your profile, a form to be an RA, a form to switch rooms, a form to submit a maintenance ticket. You get the picture.

But the problem is that every single school has their own fields and structure and workflow for these forms. So I went with our buddy, JSON Schema. There is a decent chunk of code dealing with that. Chances are, I ran into the same problem as you, if you're using JSON Schema...

Forms

Other tools

Don't reinvent the wheel!

Flowbite

One of the things that I am happy to drop $ on are good looking UI components. Flowbite does a great job with theirs. Dark mode just works. Finally got a good looking sidebar to quickly view an item; always wanted to implement that. Though I will say their dropdown logic is flaky.

AG Grid

I made extensive use of AG Grid. There are LiveView hooks and whatnot showing how I loaded data, and stylized different types like bools, links, and status.

JSON Editor

This provided a simple drop-in to edit JSON Schemas. Visual drag n drop was out of scope for the PoC, though I did try some out. O' lord did I try them out. Days of my life I want back.

Profile fields

ExJsonSchema

Great JSON schema validator.

SortableJS

This allowed me to provide a way to sort items in the UI.

Sorting

react-querybuilder

There is no chance I am using this properly. I don't understand React at all (I'm a Vue dev). But I needed to allow users to build complex queries, and this is a no-brainer tool to use for that purpose. The challenge was using it in LiveView.

JSX

I think it was just changing to --target=es2020 and I was able to use .jsx files alongside .js which made some of the Javascript work easier.

Finally, the code

Please keep in mind that this was implemented as a proof of concept. I just needed to get some stuff working, and not necessarily working well, and certainly not with any tests.

Many times, I went with whatever approach worked, and moved on with life, so please be mindful of that if you browse the code. Though, if I did something stupid, please let me know so I can fix it in future projects I work on.

https://github.com/lardcanoe/housing-app

If I get 10 likes, or some comments, I'll take the time to document how to get it running locally. It's should be pretty typical for an elixir app though...

I am more than happy to expand on any topic above, or others. Just leave a comment.

Example of Settings

Top comments (10)

Collapse
 
twistin456 profile image
Abhishek Tripathi

Great repo.

With Ash, I am taking a similar bet. - after 2-3 months, it should give me the speed πŸš„.

Currently struggling with phoenix forms. Any suggestions/ tips from your end on those?

P.S. will dig more in the repo in upcoming week

Collapse
 
lardcanoe profile image
Steve Frank

Of course! I had a bunch of tabs open to numerous repos, and I would just hunt for usage of an Ash function I needed, and looked at how they did it.

And hopefully my repo can now be one someone else hunts in. Though, keep in mind I think most of those are Ash 2.0, including mine. With 3.0, you now need to make your attributes in the form public.

My biggest issue was using embedded resources, with inputs_for and it turns out most of my problems were because I failed to include the relation in the list of accepts of the action. This would result in some cryptic message, and lead me down the wrong path. Once I fixed it, I could just use forms: [auto?: true]

That being said, the Ash docs are MUCH better now.

Collapse
 
zachdaniel profile image
Zach Daniel

We've added hints in said cryptic error message about no form being configured. like "did you mean to accept this attribute?", to help mitigate these issues. Was definitely very confusing, and TBH I had no idea it was causing so much confusion before it was brought to my attention πŸ˜‚

Thread Thread
 
zachdaniel profile image
Zach Daniel

oh, I just realized it was you who originally brought it to my attention πŸ˜‚

Collapse
 
spacebat profile image
Andrew Kirkpatrick

I've spent the last few months working on an Ash project, looking forward to 3.0

Collapse
 
lardcanoe profile image
Steve Frank

See a discussion at elixirforum.com/t/ash-framework-3-... for 3.0

I left my notes in the tread as well.

Collapse
 
abrookewood profile image
Antony Brooke-Wood

Hey Steve,
The app itself looks really good - what happened with the pitch?

Collapse
 
lardcanoe profile image
Steve Frank

A few notes:

  • The core functionality they need is surprisingly complex. And I couldn't narrow in on a simpler one to get my foot in the door. For instance, I would need something like appmixer.com/ from the start.
  • Most schools won't even consider changing tools for MANY years (5+ at least). And even if they will consider, it is 9-18 month sales cycle.
  • Most schools don't have the technical staff to help, so it would be on me to do a large portion of the transition.
  • Onboarding staff for a tool is a huge PITA since there is so much turnover
  • I couldn't find a co-founder for this one
  • Ultimately, I just didn't have the stamina to continue finding people to interview for the discovery phase. I had someone help load up 700+ contacts into HubSpot for schools that should have been an ideal fit, and I ran multiple email campaigns with different messaging, and got nowhere. Calling got nowhere. It was a slog, as that part usually is.

I have an obscene amount of notes for all this, but I won't be making that public.

Collapse
 
abrookewood profile image
Antony Brooke-Wood

Yes, that sounds fairly brutal.

Collapse
 
credentialedrss profile image
Steve Nordquist of C fix ambition

So did the #1 app maker buy you out of serving the category as an organization, convince you that small colleges need to bleed $111k at a time at student housing to-do, or just fall over?