An AI SaaS base app template made with NextJS, FastAPI, MongoDB & Gemini
GPL-3.0 License
Everyone has ideas. And we decided to make that initial phase of bringing your ideas to life much easier.
Now, if you want to build an MVP of an AI-powered SaaS, you don't have to spend several days just setting up the landing, auth logic, database, API server and so on. Simply clone this repo and go straight to the implementation of your idea.
This codebase includes the following:
Follow these steps to use the repository:
MONGODB_URL - Add a MongoDB URL here. You can obtain this URL from MongoDB Atlas. (You will need to create a MongoDB Atlas Account for this step) Check this tutorial.
NEXTAUTH_URL - NextAuth Configuration (URL) Check this tutorial
NEXTAUTH_SECRET - NextAuth Configuration (SECRET) Check this tutorial
GOOGLE_CLIENT_ID - Google OAuth Client ID. You can obtain this from the Google Cloud Console. You must first create a Google Cloud Project. (Google Account required) Check this tutorial
GOOGLE_CLIENT_SECRET - Google OAuth Client Secret. You can obtain this from the Google Cloud Console. You must first create a Google Cloud Project. (Google Account required) Check this tutorial
EMAIL_USER - This is the email ID of the Gmail account that will be used to send the waitlist signup email. (Google Account required) Check this to know more about how to set this up.
EMAIL_PASS - This is the generated "App Password" that will be used to login to the Gmail account for sending waitlist signup emails. (Google Account required) Same tutorial as previous
GEMINI_API - This is your Gemini API key. (Google Account required) Get your key here
npm i
pip install -r requirements.txt
First, navigate to the interface folder in your terminal and run the following command
npm run dev
Then, navigate to the model folder in another terminal window and run the following command
python app.py
We used FastAPI since we wanted to provide a hybrid backend that uses Python as well. We could have made function calls to the Gemini API from the NextJS app itself - but the reason we went with FastAPI is because a Python backend allows flexibility and even gives options for future expansions like adding custom LLMs, fine-tuned models and more. You can also use this Python backend to run analytics, ML algorithms, web scrapers and more.
Because it just made everything simple. NextAuth is currently undergoing a huge update - so this repo might have some issues in the future. 🥶
We left the UI for this very minimal on purpose. If we had customized it to a certain style too much, there would have been extra work required for you to undo everything we have done and then work on the UI again. Leaving it barebones allows you to mould the app into whatever you want.
Since the database will be hosted on MongoDB Atlas, you don't need to worry about deploying that. When it comes to the website itself, you can deploy the NextJS interface on Vercel - their Hobby plans are great and allow you to launch your site for free. As for the FastAPI server, you can use a service like Render to deploy the Python server. Be sure to change the URL of the Python server in all NextJS API calls to make calls to the deployed server instead of the localhost server in production deployments.
We can't guarantee that. There may be certain deprecated packages added and other bugs in the codebase - we would love your help in resolving these as they pop up. This will make the experience for future users of this repo much better. That being said, everything has been tested and works right out of the box, as of now.
Feel free to reach out to @Kabeer2004, @varaddeshpande15 or @itsskofficial