This is the backend of the DailyTip full-stack web application. It handles user authentication, scheduled email delivery, and Dev.to integration. Built using Node.js, Express, and MongoDB.
- JWT-based Authentication (Access + Refresh tokens)
- Password hashing with bcrypt
- HttpOnly cookie handling for refresh token
- Scheduled email delivery using Dev.to API
- Nodemailer setup for transactional emails
- RESTful API endpoints for user registration, login, and tip scheduling
- Node.js
- Express
- MongoDB (Mongoose)
- JWT
- bcrypt
- Nodemailer
- node-cron
- Render(for deployment)
src/
├── controllers/
├── routes/
├── middleware/
├── utils/
├── models/
├── config/
├── server.js
-
Clone the repo:
git clone https://github.com/your-username/dailytips-backend.git
-
Install dependencies:
npm install
-
Create a
.envfile:PORT=5000 MONGO_URI=your_mongo_db_uri ACCESS_TOKEN_SECRET=your_access_token_secret REFRESH_TOKEN_SECRET=your_refresh_token_secret SMTP_EMAIL=your_email SMTP_PASS=your_email_password -
Run the server:
npm start
- Frontend Repo: dailytips-frontend
POST /api/signupPOST /api/loginGET /api/tip/send(cron job route)
Made with ❤️ by Om Singh