- Introduction
- Features
- Tech Stack
- Setup and Installation
- Usage
- API Documentation
- Deployment
- License
- Contact
This website provides users with daily inspirational quotes. Users can register or log in to receive a new quote every day at 9:00 AM.
- User registration and login
- Daily inspirational quotes sent at 9:00 AM
- Secure authentication
- Responsive design
- React
- Tailwind CSS
- Express.js
- MongoDB Atlas
- Postman (for API testing)
- Frontend: Netlify
- Backend: Render.com
- Node.js
- MongoDB Atlas account
- Netlify account
- Render.com account
-
Clone the repository:
git clone https://github.com/laxmi01345/inspirational-gmail-quotes.git cd inspirational-gmail-quotes -
Backend setup:
cd backend npm install- Create a
.envfile in thebackenddirectory and add your MongoDB connection string and other environment variables:
MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret PORT=4000
- Set up the scheduled job for sending daily emails. Add the following code in your backend setup:
const schedule = require('node-schedule'); const { User } = require('./models/User'); // Adjust the path as necessary const { sendMail } = require('./utils/sendMail'); // Adjust the path as necessary schedule.scheduleJob('0 9 * * *', async () => { try { const users = await User.find(); await sendMail(users); } catch (error) { console.error('Error sending daily emails:', error); } });
- Start the backend server:
npm start
- Create a
-
Frontend setup:
cd frontend npm install- Start the frontend development server:
npm start
- Visit your deployed frontend URL.
- Register or log in to your account.
- Receive daily inspirational quotes at 9:00 AM.
- The API documentation can be tested using Postman.
- The base URL for the backend is hosted on Render.com.
- POST /register: Register a new user
- POST /login: Log in an existing user
- GET /quote: Get the daily inspirational quote (protected route)
- GET /user: Get the user details
- POST /logout: Log out from the account
- Deploy the frontend application on Netlify.
- Ensure the frontend environment variables are set correctly in the Netlify dashboard.
- Deploy the backend application on Render.com.
- Ensure the backend environment variables are set correctly in the Render.com dashboard.
- GitHub: https://github.com/laxmi01345