A clone of the ChatGPT UI.
The Docker Compose setup includes PostgreSQL, Redis, and pgAdmin. Run the following command to start everything:
docker-compose up -dCopy .env.example to a .env file and fill it with your credentials.
If you want to mock the AI integration, make sure to set the STUB_AI="true" environment variable. Otherwise, it will try to connect to OpenAI.
This repository uses next-auth to handle login with Google SSO. You need to create your credentials. Check the Google Docs for more information.
We use Redis to handle the users allowed to log in to the platform. Set up the REDIS_URL environment variable with your local Redis instance.
Since this app only allows specific emails to log in, you will need to connect to the Redis instance and add these emails to a specific key.
Connect to the Docker instance:
redis-cli -h localhost -p 6379Add a user:
SADD allowed_users "[email protected]"Check the set of allowed users:
SMEMBERS allowed_usersInstall dependencies
npm installIf you have all the environment variables in place, create a schema and run the database migrations:
npm run db:migrateRun the development server:
npm run devOpen http://localhost:3000 in your browser to see the result.
Make sure you have your local server running.
npm run test:e2e:opennpm run test:e2e-
Use the event stream OpenAI API to improve the UX and response time, instead of a normal HTTP request.
-
Change the flow of new chat. We should create a chat with the initial message (user), redirect to the chat/:id, and then send the message to the AI. This new flow will improve the UX because the user will not need to wait for the entire response of the AI to change the view.