DEV Community

Daniel Mayo
Daniel Mayo

Posted on • Edited on

Building a Social Platform with FastAPI & Neo4j: Lessons from a Side Project

Firstly let me introduce the side project that I started, but never finished. Because I have a day job and a busy life. The lessons learned were interesting though.

I wanted to build a simple social network. I was thinking of implementing Mastodon integration, but I never did get around to that. It had one user - me 😂

1. Agentic coding

There's a lot of split opinions on how good GenAI agents are at coding.

Initially I used ChatGPT for brainstorming and planning. It came up with the initial name and concept, and helped me get started with the most basic version. Honestly I would have been too lazy / busy to start this project otherwise.

I used it for some initial coding help, before switching to Zed and Claude later on. Copilot is my other side kick for inline code suggestions / completion.

I will henceforth refer to AI assistants and I as "we" 😁

2. Database: Neo4j

First decision that I made was to use Neo4j for the database.

Why not just use a relational database I hear you cry?

Well, first of all a disclaimer: I work for Neo4j.

Secondly, a graph database is tailor made for storing and querying social connections. Not that I have any users to connect 😂

Thirdly, why not? For me it's more fun and easier to use. I do have an appreciation for Postgres, but I just find Neo4j more fun and freeing to work with.

Oh and there's a free managed version you can spin up very easily (that I helped build). This was the biggest thing for me on this project: cheap and easy.

Anyway, I'm not really here to promote Neo4j. That's just what I'm using. On to the next choice.

3. Backend: FastAPI

Since I'm working a lot with Python these days and I find it quite pleasant and easy to use, it was quite natural for ChatGPT to suggest a Python backend, specifically FastAPI.

I've not used it before, only Flask (which I'm not the biggest fan of).

ChatGPT created the initial version along with Poetry for dependency management and I gave it a spin.

I was instantly impressed. This is a very nice framework to use for getting started with. You can get something up and running super fast, while also supporting async requests, background tasks, and websockets for scalability.

Sold!

Why not Node.js or something like that? Well, I've used it before and honestly I wasn't a fan. I prefer JS/TS on the front-end. Just my preference.

I could have also used Go or Java or something else, but that sounds much less fun for getting started quickly on a new project.

4. Frontend: vanilla JS

So, by this point in the story I had a working API that stores data in Neo4j. A headless social network if you will.

Now I could create an Android/iOS client, but that's not my thing. So web app it is.

I ask ChatGPT to knock up a quick front-end. We decide to avoid any heavy dependencies at the moment, so vanilla JS it is. No React etc.

We decide to use Tailwind for CSS styling. No Bootstrap, no component lib. A very natural and solid choice for quick iteration.

No Vite build or whatever. Just pure untransformed static files. The lack of build time or ceremony is very refreshing!

The first version looked terrible of course. But it worked!

5. Auth

Okay, so it's time to add login capabilities.

I don't want to roll my own, I don't want anything heavy. I want easy, and free.

I decide to integrate Auth0 with Google OIDC as the one initial login method for now.

Not as easy as I'd hoped, but eventually after a lot of back and forth I got it to work.

6. Deployment Pt. 1: Render

We arrived on using Render.io to deploy to the world. It was quick, easy, and best of all free to get started.

It was pretty great for testing at first.

But there's a catch: it suspends when not in use and the cold start times can be 50 seconds plus!

I mean I don't blame them. You can upgrade to solve that problem.

But it bugged me enough that I wanted to look at other options. Which led me to...

7. Deployment Pt. 2: D.O.

I switched to Digital Oceans App Platform. For a relatively low monthly fee, it solved what I was looking for.

Compared to Render it was an absolute pain to set up.

Eventually I got it working though and now it's set up it's easy to use. I just git push to deploy.

8. Custom Domain

Okay, so I wanted a custom domain now. I wanted to use a .social TLD.

Of course my working title up until this point was already taken: ripple.social

However, rpl.social was free. ChatGPT encouraged me to search for existing Trademarks. This was a pain, but eventually I found a clash. No go.

Future app / start up idea: make trademark search easier. It could really use an app that brings it into the 21st Century.

Next up: ChatGPT suggested relay.social

Not bad I guess. But taken. Next it suggested RelayHub.social and RelayChat.social

Neither were amazing but they were free. I went with the latter. Only after registering did I realise it sounds like Internet Relay Chat (IRC!)

Oh well, it's not great but it worked as a stopgap.

Naming things is really hard!!

Edit: as of Jan 2026 I've shut down the app and I have disabled auto renewal for the domain. It's just wasting money at this point!

9. Analytics: Swetrix

Now, I had no users. No big surprise 😂

I was half heartedly trying to get some, but without some kind of analytics I wouldn't know whether anyone is visiting or dropping off.

I wanted something cheap while being GDPR compliant and privacy respecting. Swetrix ticked this box and is pleasantly simple to use. It tracks stats anonymously, without cookies or PII.

As a bonus it comes with anonymous error reporting as well. Nice.

10: Current Status

In conclusion, I learned some new things and set up a project from scratch on a budget.

If I start another project, I'd do things differently. The no. 1 thing I'd change is investing in strong guard rails to help guide agentic coding. I'm thinking plenty of automated tests, code formatting, linting, etc. The kind of things you'd set up for a professional team project, only with AI it's even more important because it makes dumb decisions all the time unless there's something there to stop it.

In particular I would want to look into Cucumber BDD and Playwright testing.

Thanks for reading, well if you make it this far I'm impressed.

I'd love to hear about your own side projects.

What would you have done differently to me if you were in my shoes? Any tips or suggestions?

Any thoughts or questions about what I did?

Top comments (0)