Skip to content

AdamZWinter/fakegpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fakegpt

The Dockerfile builds from the latest Node image. In that build, the file watchers limit is increased so that your IDE (VS Code, or other) can watch the files you are working on, while Nodemon can as well. The same thing may have to be done for the host server, if you find that you are getting file-watcher-limit errors. Per usual, you will need to build the container image before you can deploy it.

The docker-compose.yml file is configured with six services. As mentioned earlier we have team members by the names Winter, Wise and Stewart. We also have a fourth member; Jeconiah. There is one service for each team member. You will want to change the names of these to match your team and usernames. Each of these services runs the same container, but on a different port. The port configured for each team member needs to match the parameter that is provided when you setup your virtual hosts (vhosts setup). That is, each team member will have their own container running that serves their app, from their own home directory, on their own port, and their Nginx virtual host will route their hostname to their container on that port. Since everyone's home directories will need to be readable, "docker-compose up" needs to be run as root.

Note that the volume paths say "agile". This is because that is the directory where this project first started. The repo was later named "fakegpt". So, your required volume path will look something like "/home/username/fakegpt/app:/app:Z" Also, note that the entry point command is specified in this docker-compose.yml file, not the Dockerfile.

The fifth and sixth services are MongoDB (the database), and Mongo-Express (a web UI for the database). Mongo-Express is not configured with any kind of security. Anyone-at-all can simply go to the website for the UI and access / change anything/everything. This is probably something that should be worked on sooner, rather than later. Also, you'll note that there is only one database. So, you'll have to figure if you want all team members to share that database, or give each member their own.

The html directory can be ignored completely. This was from an early version of the project where the frontend was in the same repo. The files have been left there for reference or testing. You can delete this directory if you want.

Within the app directory, you will need to run "npm install" to have the required dependencies installed. A helloworld.js file is there for troubleshooting, if needed, but is not part of the project otherwise. server.js is the main file with all relevant work in the project. In server.js there are various routes with all of the backend logic contained within them. None of that logic has been moved to separate files. Also, you'll see that most of the prompt engineering is hardcoded here, rather than being specific to each lesson. One of the next steps should be moving this part to the database, and retrieving systemRole and iniitialContent that is specific to the lesson from the database. Currently, the only thing the database is used for is dumping all prompts and responses into it.

The config.js.template file is just like the run.template file, in that it needs to be copied to "config.js" which will be ignored by Git, and the configuration needs to be changed for the specific user. This file is where you will put your OpenAI API keys. The org key may or may not be necessary, but you definitely need the API key. In order to get this code working, you will need to create an account with OpenAI and request API access. With your api key you will be able to authenticate your connection to OpenAI and continue work on this project..

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors