A Rust-based REST API for a scheduling and calendar management system, similar to Calendly. Built with Actix-web and MongoDB.
-
👤 User Management
- Registration with email verification
- Login with JWT authentication
- Password reset functionality
- Token refresh mechanism
-
📅 Calendar Management
- Create and manage calendar settings
- Customize working hours
- Set buffer times between meetings
- Configure timezone and time format preferences
- Framework: Actix-web
- Database: MongoDB
- Authentication: JWT (JSON Web Tokens)
- Email Service: SMTP
- Validation: Validator
- Password Hashing: Bcrypt
src/
├── app.rs # Application setup and configuration
├── config/ # Configuration management
├── errors/ # Error handling
├── middleware/ # Custom middleware (auth, etc.)
├── modules/ # Feature modules
│ ├── user/ # User management
│ └── calendar/ # Calendar management
├── services/ # External services (email, etc.)
└── utils/ # Utility functions
- Rust (latest stable version)
- MongoDB
- SMTP email service
Create a .env
file in the root directory with the following variables:
MONGODB_URI=your_mongodb_connection_string
DATABASE_NAME=your_database_name
PORT=8080
RUST_LOG=debug
EMAIL_USER=your_email@example.com
EMAIL_PASSWORD=your_email_app_password
JWT_SECRET=your_jwt_secret
- Clone the repository:
git clone <repository-url>
cd calendly
- Build the project:
cargo build
- Run the server:
cargo run
POST /api/users/register
- Register new userPOST /api/users/login
- User loginPOST /api/users/verify-email
- Verify emailPOST /api/users/refresh-token
- Refresh access tokenPOST /api/users/forgot-password
- Request password resetPOST /api/users/reset-password
- Reset password
POST /api/calendar/settings
- Create calendar settingsPUT /api/calendar/settings
- Update calendar settingsDELETE /api/calendar/settings
- Delete calendar settings
The API uses JWT for authentication. Include the token in the Authorization header:
Authorization: Bearer <your_access_token>
Access tokens are valid for 7 days. Refresh tokens can be used to obtain new access tokens.
cargo test
cargo fmt
cargo clippy
- JWT secrets should be strong and kept secure
- Email passwords should be app-specific passwords
- MongoDB connection strings should be properly secured
- All sensitive information should be stored in environment variables
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- Actix-web framework
- MongoDB Rust driver
- All other open-source contributors
Abraham Anavheoba - wisdomabraham92@gmail.com
Project Link: https://github.com/anavheoba/calendly