This project consists of a web application that uses the Twitter API to create tweets based on a given text, using the OpenAI API to generate the images from a provided text.
Project's landing page, having options to login, register in the plataform and contact links.
Log in screen, similar to register and password reset screen.
System's main screen, where it is possible to see past publications and scheduled ones.
Post creation screen with options for post description, image generation and scheduling.
Use the package manager npm to install dependencies in the root of the project.
npm install
It is necessary to include some data in the server/appsettings.json.example file, adding the following values:
"PORT" : "The server port where the api will work"
"BEARER_TOKEN" : "Value avaliable from twitter developer account's api"
"APP_KEY" : "Value avaliable from twitter developer account's api"
"APP_SECRET" : "Value avaliable from twitter developer account's api"
"OAUTH2_ID" : "Value avaliable from twitter developer account's api"
"OAUTH2_SECRET" : "Value avaliable from twitter developer account's api"
"ACCESS_TOKEN" : "Value avaliable from twitter developer account's api"
"ACCESS_SECRET" : "Value avaliable from twitter developer account's api"
"CALLBACK_URL" : "Value setted in twitter developer account's api"
"REACT_SERVER" : "Url to the front end server, in this case, the frontend server is the same as the backend server"
"JWT_KEY" : "Random key used for security purposes"
"SESSION_SECRET" : "Random key used for session security"
"OPENAI_KEY" : "Value avaliable from OpenAI developer account's api"
"OPENAI_ORG" : "Value avaliable from OpenAI developer account's api"
After that, just rename the file from appsettings.json.example to appsettings.json
It is important to remember to update your twitter developer page, to set teh callback url and to generate your tokens,
Be aware that the Access Token and Secret
, that gives access to v1.1 of the api, necessary for image upload, must be created with read and write
access or higher, regenerate the key if necessary.
It is necessary to include some data in the clent/.env.example file, adding the server api value (REACT_APP_API_URL) to the server url.
In this case, the api url is the same as the front end url.
For this project, the frontend server is the same as the backend server, so the value of REACT_APP_API_URL is the same as the value of the server where both them are hosted.
After that, rename the file from /client/.env.example to .env
It is necessary to run a build script in the client folder.
For that, navigate to the client folder and run:
npm run build
Finally, rename the database, from TG_Zanardi_Gleison.db.example to TG_Zanardi_Gleison.db
Run "npm start" in the root of the project to start the server.