A project implementing a simple AI startup idea to help businesses achieve GDPR compliance. Used for my talk on startup building.
Before you begin, ensure you have met the following requirements:
- Node.js installed on your machine. The project has been developed and tested with Node.js version 18.6.0. You can download the latest version of Node.js from https://nodejs.org/.
To check if Node.js is installed, open a command prompt or terminal window and run the following commands:
node --version
This should display the installed Node.js version. Additionally, you can check the npm version:
npm --version
Make sure both commands return valid version numbers.
Visual Studio Code is the recommended code editor for this project. Follow these steps to install it:
- Visit the Visual Studio Code website.
- Download the installer for your operating system (Windows, macOS, or Linux).
- Run the installer and follow the on-screen instructions.
- After installation, open Visual Studio Code.
Once Node.js is installed, navigate to the project's root directory using the command line and run the following command to install the project dependencies:
npm install
This will download and install the necessary packages specified in the package.json
file.
Your app needs to be able to connect to a database as well as the OpenAI API in order to function. If you're in class, your teacher can provide these to you if you don't have them to hand. Otherwise you'll need to set up a database (e.g. using Railway) and register your own OpenAI API key.
-
Database Connection (DATABASE_URL):
-
Copy the file called
.env.example
a new file named.env
in the root directory of your project. -
Inside the
.env
file, add the following line and replace<YOUR_DATABASE_URL>
with the actual connection URL for your database:DATABASE_URL="<YOUR_DATABASE_URL>"
-
Save the
.env
file.
-
-
OpenAI API Key (OPENAI_API_KEY):
-
This project makes use of the OpenAI API, which requires an API key. To install it, add another line to your
.env
file:OPENAI_API_KEY="<YOUR_API_KEY>"
-
Replace
<YOUR_API_KEY>
with your actual OpenAI API key. -
Save the
.env
file.
-
After installing the dependencies, you can run the project using the following command:
npm start
This will start the application, and you can access it by navigating to http://localhost:3000 in your web browser.
Included in this project is quickstart.py
, a script that will allow you to customise the app to your chosen problem domain quickly and easily. To get started, run:
python3 quickstart.py
The script will guide you through the rest of the process.
If you wish to deploy your project on Vercel, an easy-to-use platform for hosting web applications, follow this Vercel deployment tutorial. If you're in class, there's no need to do this unless you actually want to take things further outside the classroom by opening your app up to real users!
This app is built on the awesome T3 stack.
Copyright 2023 Saul Johnson. Code released under the MIT license.