The core features are laid out here, as mentioned, it'll be an API which we'll build that
allows users to create and share events and sign up for events shared by others.
And as a first step, I now want to use ChatGPT here in my case.
Of course, you could also use Cloud or Google Gemini or whichever AI chatbot you prefer,
but I want to use such an external AI service to plan the application or to take my core
requirements and get some help regarding the general application structure and the core
features so that I don't forget anything.
In the next steps, we'll then use AI tools like Cursor to build the actual application
and write code.
Therefore, the prompt I'm sending to ChatGPT here is a prompt where I assign a role to
give ChatGPT some extra context.
And then I describe what I want to build, that it's a REST API that uses Node and Express
and that it's a REST API that should have user authentication and that authenticated
users can then manage events, that authenticated users can register for events and unregister,
that I plan on adding this authorization and that events are made up of a title, description,
date and location.
I did not have that on the slide, but that's how I plan on building this and an image which
is uploaded.
Now, I don't want ChatGPT to generate any code at this point.
I'll do that from inside the code editor from inside Cursor with Cursor, for example,
but I want to get some help regarding the key building blocks and the general project
structure.
So, I'll send this prompt to ChatGPT and see what I'll get.
And for example, here I get one possible project structure I could use.
Now, I don't have to use that structure, of course, there might be parts I don't like.
For example, I already see that I won't like this uploads folder in the source folder.
That should instead be some folder that's publicly available when the app is running.
It's not really part of my source code, but other parts are fine like controllers, models
and so on.
It also tells me that I might want to use JSON Web Tokens for authentication.
That's what I had in mind too.
It tells me that I'll need routes like this and that I'll need a user model in the end,
which could be made up of a username, email and password field.
That the password should be hashed, that's very important so that we don't store the
plain text password in the database, which would be a security problem.
That we could have created and updated add fields and that we could use the bcrypt package
for password hashing.
That I'll need these possible endpoints to implement authentication and that then thereafter
I also need an event model with all the fields I specified.
It also tells me, and that's important and that shows that AI is really helping me here,
that I'll need a creator ID or a user ID field in my event model to link an event to a user.
I did not specify this here when I described how an event should look like, but the AI
tells me that I need this.
And I knew this too, but it's great to have this extra confirmation here so that I don't
forget it when I actually use AI tools to generate the code later.
It tells me which endpoints, which paths I might want to set up to manage events, to
get all events, a single event and so on.
And that I need some paths for event registration, including one route, which I did not specify
in my requirements to fetch all registrations for a specific event.
And again, that's nice to have.
It is something I might have forgotten and ultimately during building the app at some
point I probably would stumble across that and add this feature.
But it's nice to have it here right from the start, thanks to AI, that it tells me that
this is another route I might consider adding.
It tells me that I can use the malter library to implement image upload.
That's what I planned to, but again, nice to see this here.
Or if I had a different library in mind, it would be nice to get an alternative suggested
here where I could then do some research to find out which option I prefer.
And then it tells me about some files I might want to add to, well, implement or to hold
the code for all these things.
Though we'll do that code generation and also some of the file generation from inside
Cursor and with help of GitHub Copilot later on.
And I also won't add all these files it's suggesting here, because these are of course
just some suggestions, not what you have to do.
Basically it's you who's in the driver's seat and therefore you decide which structure
you want to have, which filenames you want to have and where you want to put which code.
And I will definitely deviate from what's suggested here.
But it's nice to have these extra suggestions.
I also won't use Mongoose for database management, also not SQLite, instead I'll use a different
approach, but again, nice to have these suggestions.
And with that, we have a plan and as a next step, I'll now switch to Cursor to actually
get started building this application.