FocusNest is a simple web app designed to help you stay focused and get more work done. It combined useful tools in one place:
- β±οΈPomodoro timer to manage your work/break time
- π AI-powered flashcard maker
- π΅ Lofi music to help you concentrate
- Easy login or try as a guest
- Clean, simple design
- Timer: Custom work/break sessions
- Flashcards: Turn notes into study cards instantly
- Music: Relaxing background sounds - fetched from one of nine lofi girl's stream
- To-do List: Keep track of what you need to do
- Streaks to keep you engaged
- Mobile-friendly UI
-
Clone the repository:
git clone https://github.com/c2y5/focusnest.git cd focusnest -
Install dependencies (use virtual env if needed)
pip install -r requirements.txt
-
Setup
.envSECRET_KEY=your_flask_secret_key # PLEASE UPDATE FOR SECURITY # Auth0 configuration AUTH0_CLIENT_ID=your_auth0_client_id AUTH0_CLIENT_SECRET=your_auth0_client_secret AUTH0_DOMAIN=your-auth0-domain.auth0.com AUTH0_CALLBACK_URL=your_auth0_callback_url (localhost:5000/callback for login) AUTH0_LINK_CALLBACK_URL=your_auth0_link_callback_url (localhost:5000/link-callback for linking accounts) MONGO_URI=mongodb+srv://user:pass@xxx.xxx.mongodb.net/focusnest?retryWrites=true&w=majority&appName=xxx AI_API_URL=https://ai.example.com/chat/completions AI_API_KEY=your_api_key_here GUEST_MODE_CUSTOMIZABLE=False # True/False
- Login to Auth0
- Create an application like the following
-
Update your
.env- Copy the
Client Id,Client SecretandDomainand set them in.env - If you are NOT using custom domain, your
Auth0 audience domainshould be the same as the normal domain - If you ARE using custom domain, the audience domain should be the default auth0 provided one
Callback URLs
- Your
AUTH0_CALLBACK_URLshould be the url you are self-hosting from +/callback. E.G. http://localhost:5000/callback AUTH0_LINK_CALLBACK_URLwould be similar to above except add/link-callback
- Copy the
-
Let's update our Auth0 settings
- Go to the application you created
- Go to settings
- Scroll down until you find
Application URIs- For
Allowed Callback URLsadd your link fromAUTH0_CALLBACK_URLANDAUTH0_LINK_CALLBACK_URL
- For
- Set
Allowed Logout URLsto just the website E.G. http://localhost:5000/ - Do the same for
Allowed Web Origins
Social Logins
- This app is designed for 4 social logins: Google, GitHub, Slack and Spotify
- On the left side go to Authentication -> Social
- Create Connection
- Add the 4 socials (follow the guide on website on how to setup each)
- Make sure you have them enabled for your application
Custom login page/domain
- If you want to customise your login page, on the left go to
Branding -> Universal Login - For domain go to
Branding -> Custom Domains
- Login to MongoDB
- Create a cluster if you havn't already
- Find your cluster and click
connect
- Click
Drivers
- Set these as your settings
-
Scroll down until you find
Add your connection string into your application code -
Copy the link, would be something like
-
mongodb+srv://mongodb:<db_password>@<CLUSTERNAME>.<CLUSTERID>.mongodb.net/?retryWrites=true&w=majority&appName=<CLUSTERNAME> -
In your
.envupdateMONGO_URIto the above, make sure to put in yourdb_password -
For me I added a
/focusnestafter the url:@<name>.<id>.mongodb.net/focusnest? -
You don't have to but I keep it like that for better view
- Make sure to set your AI configs for flashcards!
- Set
AI_API_URLto the completion url. E.G. https://ai.example.com/chat/completions - Don't forget to put your API key in
AI_API_KEY, leave it asyour_api_key_hereif there is none
- If you want your own live counter please change the url
- You can find it in
app/static/js/liveCounter.jsinline 8 - Change
focusnestinto another one e.g. selfhosted_focusnest_abc123
-
Either run
python app.py
-
or
bash setup.sh [PORT]
- To update the max file upload size change the value in
config.pyinlin 10 - Update
MAX_CONTENT_LENGTHto the size you want - e.g.
5 * 1024 * 1024for 5MB or10 * 1024 * 1024for 10MB - To allow guests to access settings change
GUEST_MODE_CUSTOMIZABLEin.envtoTrue
FocusNest/
β
βββ app/
β βββ api/
β β βββ __init__.py
β β βββ routes.py
β βββ auth/
β β βββ __init__.py
β β βββ routes.py
β βββ dashboard/
β β βββ __init__.py
β β βββ routes.py
β βββ flashcards/
β β βββ __init__.py
β β βββ routes.py
β βββ guest/
β β βββ __init__.py
β β βββ routes.py
β βββ music/
β β βββ __init__.py
β β βββ routes.py
β βββ settings/
β β βββ __init__.py
β β βββ routes.py
β βββ static/
β β βββ avatars/
β β βββ css/
β β β βββ flashcardsPage.css
β β β βββ hamburgerMenu.css
β β β βββ musicPage.css
β β β βββ popup.css
β β β βββ settingsPage.css
β β β βββ style.css.css
β β βββ img/
| | | βββ dashboard-preview.jpg
| | | βββ default-profile.png
| | | βββ favicon.png
| | | βββ logo.png
| | | βββ music-placeholder.jpg
β β βββ js/
| | | βββ cardHover.js
| | | βββ dashGreeting.js
| | | βββ emotionLogger.js
| | | βββ flashcardsHandler.js
| | | βββ hamburgerMenu.js
| | | βββ linkingHandler.js
| | | βββ liveCounter.js
| | | βββ musicHandler.js
| | | βββ notices.js # You can safely remove, this is just for notices on focusnest.amsky.xyz
| | | βββ pomodoroTimer.js
| | | βββ popupHandler.js
| | | βββ quote.js
| | | βββ settingsHandler.js
| | | βββ streakHandler.js
| | | βββ tasksHandler.js
| | | βββ timerBase.js
| | | βββ timerSettings.js
β β βββ sounds/
| | | βββ complete.mp3
β β βββ robots.txt
β βββ templates/
β β βββ base.html
β β βββ dashboard.html
β β βββ error.html
β β βββ flashcards.html
β β βββ index.html
β β βββ music.html
β β βββ settings.html
β β βββ settingsGuest.html
β β βββ settingsLocked.html
β β βββ timer.html
β βββ timer/
β β βββ __init__.py
β β βββ routes.py
β βββ __init__.py
βββ img/
β βββ Auth0CreateApp.png
β βββ ClusterConnect.png
β βββ ClusterConnectDrivers.png
β βββ ClusterConnectSettings.png
β βββ FlashcardsPreview.png
β βββ FocusNestBanner.png
β βββ LiveCounter.png
β βββ MusicPreview.png
β βββ PomodoroTimerPreview.png
| βββ SettingsPreview.png
βββ .env
βββ .env.example
βββ .gitignore
βββ .gitattributes
βββ app.py
βββ config.py
βββ LICENSE
βββ README.md
βββ requirements.txt
βββ setup.sh
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to submit issues or pull requests! Suggestions to improve FocusNest are very welcome.










