A beautiful sleep-themed podcast app that helps you fall asleep with boring podcasts. Built with React Native and MongoDB.
- Beautiful Sleep-Themed UI - Calming design with custom illustrations
- User Authentication - Secure signup/signin with JWT tokens
- MongoDB Database - Persistent user data and listening history
- Sleep Preferences - Customize your sleep schedule and podcast preferences
- Listening History - Track your sleep podcast sessions
- Node.js (v16 or higher)
- MongoDB (local or MongoDB Atlas)
- Expo CLI
- React Native development environment
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Set up environment variables:
cp env.example .env
Edit
.envfile with your configuration:MONGODB_URI=mongodb://localhost:27017/sno-cast JWT_SECRET=your-super-secret-jwt-key-here JWT_EXPIRE=7d PORT=5000 NODE_ENV=development CLIENT_URL=http://localhost:19006
-
Start the backend server:
npm run dev
The API will be available at
http://localhost:5000
-
Install dependencies:
npm install
-
Start the Expo development server:
npm start
-
Run on your device:
- Install Expo Go app on your phone
- Scan the QR code from the terminal
- Or run on simulator:
npm run iosornpm run android
{
username: String (unique, required)
email: String (unique, required)
password: String (hashed, required)
profile: {
firstName: String
lastName: String
avatar: String
sleepPreferences: {
preferredSleepTime: String
wakeUpTime: String
favoritePodcastCategories: [String]
}
}
subscription: {
plan: String (free/premium)
startDate: Date
endDate: Date
}
listeningHistory: [{
podcastId: String
podcastTitle: String
listenedAt: Date
duration: Number
completed: Boolean
}]
isActive: Boolean
lastLogin: Date
}POST /api/auth/signup- Register new userPOST /api/auth/signin- Login userPOST /api/auth/logout- Logout userGET /api/auth/me- Get current userPOST /api/auth/refresh- Refresh JWT token
GET /api/user/profile- Get user profilePUT /api/user/profile- Update user profileGET /api/user/listening-history- Get listening historyPOST /api/user/listening-history- Add to listening historyDELETE /api/user/account- Deactivate account
- React Native
- Expo
- AsyncStorage
- Axios
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT (jsonwebtoken)
- bcryptjs
- express-validator
- Landing Page - Beautiful sleep-themed welcome screen
- Sign In - User authentication
- Sign Up - User registration
- Home - Main app interface (when authenticated)
- Password hashing with bcrypt
- JWT token authentication
- Input validation and sanitization
- Rate limiting
- CORS protection
- Helmet security headers
- Custom sleep-themed illustrations
- Gradient backgrounds
- Smooth animations
- Responsive design
- Beautiful typography
- Consistent color scheme
sno-cast/
├── backend/
│ ├── models/
│ │ └── User.js
│ ├── routes/
│ │ ├── auth.js
│ │ └── user.js
│ ├── middleware/
│ │ └── auth.js
│ ├── server.js
│ └── package.json
├── screens/
│ ├── SignInScreen.js
│ └── SignUpScreen.js
├── services/
│ ├── api.js
│ └── authService.js
├── assets/
│ ├── girl.png
│ └── sleeping.png
├── App.js
└── package.json
- Set up MongoDB Atlas
- Configure environment variables
- Deploy backend to your preferred platform
- Build for production:
expo build - Submit to app stores or use Expo Go
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details
If you encounter any issues:
- Check the console for error messages
- Ensure MongoDB is running
- Verify environment variables are set correctly
- Check network connectivity
Sweet dreams! 🌙✨