A calming typing experience with server-side authentication and data persistence, optimized for Render deployment.
π Try Calm Typing Live
Experience the full typing application with user authentication, data persistence, and all features!
- Main App: https://calm-typing-backend.onrender.com
- Admin Dashboard: https://calm-typing-backend.onrender.com/api/admin/users
- Health Check: https://calm-typing-backend.onrender.com/api/health
- User Authentication: Sign up, sign in, or continue as guest
- Data Persistence: Typing history and settings saved to server
- Guest Sessions: Temporary sessions for users who don't want to register
- Auto-correction: AI-powered word correction using DeepSeek API
- Customizable Interface: Fonts, colors, backgrounds, and audio
- Responsive Design: Works on desktop and mobile devices
npm installCopy the example environment file and update the values:
cp env.example .envUpdate the .env file with your configuration:
PORT=3000
NODE_ENV=production
SESSION_SECRET=your-super-secret-session-key
JWT_SECRET=your-super-secret-jwt-key
CORS_ORIGIN=https://your-app-name.onrender.comnpm startFor development with auto-restart:
npm run dev- Push your code to GitHub
- Connect your GitHub repository to Render
- Create a new Web Service
Use these settings in Render:
- Build Command:
npm install - Start Command:
npm start - Environment:
Node - Plan: Free (or higher for production)
Set these environment variables in Render:
NODE_ENV=production
SESSION_SECRET=your-super-secret-session-key
JWT_SECRET=your-super-secret-jwt-key
CORS_ORIGIN=https://your-app-name.onrender.com
The render.yaml file is included for automatic deployment configuration.
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/guest- Create guest session
GET /api/user/data/:dataType- Get user data (requires authentication)POST /api/user/data/:dataType- Save user data (requires authentication)
GET /api/guest/data/:dataType- Get guest dataPOST /api/guest/data/:dataType- Save guest data
GET /api/health- Server health status
typing_history- User's typing historysettings- User preferences (font, color, volume, etc.)audio_tracks- Custom audio track assignments
The application uses SQLite for data storage. The database file (calm-typing.db) is automatically created on first run.
users- User accountsuser_data- User-specific data storageguest_sessions- Temporary guest sessions
- Helmet.js - Security headers
- Rate Limiting - API request limiting
- CORS - Cross-origin resource sharing
- JWT Tokens - Secure authentication
- Password Hashing - bcrypt with salt rounds
- Session Management - Secure session handling
The application includes:
- Authentication Modal (integrated in
index.html) - Sign in/up interface - Main App (
index.html) - Typing interface with server integration - Responsive Design - Works on all devices
- Install dependencies:
npm install - Set up environment variables
- Run with auto-restart:
npm run dev - Access at
http://localhost:3000
The application includes health check endpoints for monitoring:
GET /api/health- Returns server status
βββ server.js # Main server file
βββ package.json # Dependencies and scripts
βββ render.yaml # Render deployment config
βββ env.example # Environment variables template
βββ index.html # Main app with integrated authentication modal
βββ config.js # DeepSeek API configuration
βββ script.js # Additional client-side logic
βββ styles.css # Styling
βββ fish.js # Fish animation effects
βββ Audios/ # Audio files directory
- Database Connection: Ensure SQLite is properly installed
- CORS Errors: Check CORS_ORIGIN environment variable
- Authentication: Verify JWT_SECRET is set
- Rate Limiting: Adjust rate limit settings if needed
- Build Failures: Check Node.js version compatibility
- Environment Variables: Ensure all required vars are set
- Database: SQLite files persist on Render's filesystem
- Logs: Check Render logs for debugging
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details.
For issues and questions:
- Check the troubleshooting section
- Review Render documentation
- Open an issue on GitHub
- Check server logs in Render dashboard