github.com/PygmalionAI/paphos-backend
master / published Apr 8, 2023 / repository
The official service back-end.
paphos-backend
This is the core backend for the official Pygmalion service.
Very early work-in-progress, not usable in any capacity.
Contributing
If you wish to contribute, this section contains some relevant information.
The stack is:
- Crystal as the language of choice
- Lucky as the web framework
- PostgreSQL as the main database
To get started, you need all of the above installed and functional on your machine.
For development, the default configuration expects a postgres user with password postgres to be available. You can then create the databases manually, or use lucky db.setup to create them automatically I believe.
With PostgreSQL up and running and the development database created, you can boot up the development server:
$ lucky dev
The API should then be reachable at http://localhost:3000/. Routes are under /api/v1 but are undocumented as of now, you'll need to trek through the code to figure them out.
Useful links
- Lucky's official guides: contains tutorials about the usual stuff (installation, route setup, handling data in the database, etc.)
API
- Api
- ApiAction
Include modules and add methods that are for all API requests
- AppDatabase
- AppServer
- BaseEmail
Learn about sending emails https://luckyframework.org/guides/emails/sending-emails-with-carbon
- BaseModel
- BaseSerializer
- Character
- CharacterQuery
- Chat
- ChatParticipant
- ChatQuery
- ChatSerializer
- CheckCurrentUser
- DeleteCharacter
- ErrorSerializer
This is the default error serializer generated by Lucky.
- Errors
- FullCharacterSerializer
- Home
- LogInUser
- MinimalCharacterSerializer
Minimal serializer for the Character model.
- PasswordValidations
- RegisterUser
- RequestPasswordReset
- ResetPassword
- SaveCharacter
- SaveChat
- SaveChatParticipant
- UpdateChat
- User
- UserFromEmail
- UserQuery
- UserSerializer
- UserToken
Generates and decodes JSON Web Tokens for Authenticating users.