The Cycling Safe SOS API is designed to provide safety features for cyclists, allowing them to send SOS messages and handcrafted 'im safe' messages to their favorite people. The backend of the API is built using Node.js, Express, MongoDB, Twilio for SMS functionality and NodeMailer for email functionality.
- Send SOS with predefined message as text message using Twilio.
- "I'm Safe" api to send handcrafted emails to your favorite people.
- User authentication and authorization using JWT.
- User registration and login with bcrypt for password hashing.
- Ability to update user information and manage custom messages.
POST /api/auth/signup
: Register a new user.POST /api/auth/signin
: Authenticate user and generate JWT token.
GET /api/users/id/:id
: Retrieve user information by ID.GET /api/users
: Retrieve a list of all users.PUT /api/users/update/:id
: Update user information by ID.DELETE /api/users/delete/:id
: Delete user by ID.
Dont FORGET to use jwt token on Authorization header while using the SOS Route and Custom Messages Route. You will get jwt token immediately after signin.
POST /api/sos
: Send SOS messages to emergency contacts.
Screenshot
POST /api/imsafe:/relationship
: Send a custom email to your favorite people while cycling.
- Clone the repository:
git clone https://github.com/adarsh-2425/cycling-safe.git
- Install dependencies:
npm install
- Set environment variables: Create a
.env
file with necessary configurations.
- Start the server:
npm start
- Access the API via
http://localhost:3000/api/
Contributions are welcome! Feel free to fork the repository, make changes, and submit pull requests.
This project is licensed under the MIT License.