A web-based mental health AI assistant that provides empathetic conversations and support.
- User authentication (login/register)
- Real-time chat with AI assistant
- Message history persistence
- Responsive design for all devices
- Secure token-based authentication
- Node.js 18+ and npm
- PostgreSQL database
- OpenAI API key
- Install dependencies:
npm install- Create a
.envfile in the root directory with the following content:
# Database configuration
DATABASE_URL=postgres://postgres:postgres@localhost:5432/serenio
# OpenAI configuration
OPENAI_API_KEY=your_openai_api_key_here
# JWT configuration
JWT_SECRET=your_jwt_secret_here
# Node environment
NODE_ENV=development
# Server port
PORT=3000- Initialize the database:
npm run init-dbRun both frontend and backend in development mode:
npm run devThis will start:
- Frontend at http://localhost:3000
- Backend API at http://localhost:3000/api
- Build the frontend:
npm run build- Start the production server:
NODE_ENV=production npm run dev:backendweb-version/
├── src/ # Frontend source code
│ ├── views/ # Vue components for each route
│ ├── router/ # Vue Router configuration
│ └── assets/ # Static assets
├── server/ # Backend source code
│ ├── routes/ # API route handlers
│ ├── database/ # Database setup and migrations
│ └── types.d.ts # TypeScript type definitions
└── public/ # Static files served directly
- POST
/api/auth/register- Register a new user - POST
/api/auth/login- Login user
- GET
/api/chat/messages- Get message history - POST
/api/chat- Send message and get AI response
- Passwords are hashed using bcrypt
- JWT tokens for authentication
- CORS protection
- Environment variables for sensitive data
- SQL injection protection with parameterized queries
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request