/socketio-restapi

Primary LanguageTypeScriptMIT LicenseMIT

Node.js + Typescript + Mongoose REST API Template 🚀

Stars Forks Contributors Issues MIT License

Quick and easy setup for creating a REST API using Node.js, Express, TypeScript and Mongoose.

🌟 Features

  • 🔒 JWT tokens for user authentication and routes protection
  • 📚 Ready-to-go user model, controller, sign up, and sign in routes
  • ⚡ Optional websockets built with Socket.io
  • 🖼️ Image uploads with Multer
  • 🔧 Environment variables management with dotenv
  • 💡 Error handling
  • 📝 Asynchronous logging with Pino
  • ☁️ Ready-to-go access to AWS Parameter Store

🚀 Getting Started

  1. Clone the repository: git clone https://github.com/olegkron/node-ts-api-template.git
  2. Install dependencies: npm install
  3. Create a .env file with your configurations.
  4. Start the development server with npm start.
  5. The API will be running on the port specified in the .env file

📚 Usage

The template includes a basic user model and routes for sign up and sign in. You can easily add more models and routes as needed.

Authentication

All routes are protected by default and require a valid JWT token to be included in the Authorization header of the request.

Websockets

The template includes an optional implementation of websockets using Socket.io.

🛠️ Built With

📝 To-do's

  • Nodemailer for easy email sending
  • Twilio for SMS verification
  • Rate limiting
  • Password reset functionality
  • Support for different database types (PostgreSQL, MySQL)
  • Caching (Redis)
  • Password hashing with Argon

🙌 Contributing

If you have any suggestions for improvements or find any bugs, feel free to open a pull request or an issue.

👥 Authors

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.