The DeepFocus Backend API is an Express.js-based service designed to handle user authentication, activity tracking, and email notifications. It provides endpoints for user sign-up and login, daily and weekly activity data persistence, and backend email functionality. The service is secured with JWT-based authentication and supports cross-origin requests (CORS) for integration with frontend applications. The API also includes health check and database connectivity endpoints for monitoring and diagnostics.
Authentication: JWT-based user authentication and authorization via /api/v1/auth. Activity Tracking: Enables tracking and persistence of daily and weekly user activity at /api/v1/activity. Email Notifications: Provides email-related functionalities at /api/v1/emails. Health Check: A simple endpoint (/api/v1/health) to monitor the server’s health. Database Connectivity: Verifies connection to the MongoDB database via /api/v1/test-db.
- Node.js LTS >=v20.12.2
- npm v10.5.0 or pnpm
- MongoDB instance
-
Install dependencies:
npm install
-
Create a
.env
file with your MongoDB URI:MONGO_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret RESEND_API_KEY=your_resend_api
-
Start the backend server:
npm start
- Set up CI/CD pipeline and automatic releases
- Implement changelog using conventional commits
- Add integration and automated tests
- Implement user authentication and cloud-based data persistence using MongoDB and JWT
- Migrate from electron-storage to SQLite for improved data handling