Skip to content
/ FocusNest Public

A productivity-based application designed to help students to study and stay organised.

License

Notifications You must be signed in to change notification settings

c2y5/FocusNest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

121 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FocusNest (v1) πŸͺΉ

Table of Contents

What is FocusNest?

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

Try it out yourself here!


Banner


Key Features

Quick StartπŸš€

  • Easy login or try as a guest
  • Clean, simple design

Helpful Toolsβš’οΈ

  • 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

Extras✨

  • Streaks to keep you engaged
  • Mobile-friendly UI

Preview

Dashboard

DashboardPreview

Pomodoro Timer

PomodoroTimerPreview

Music

MusicPreview

Flashcards

FlashcardsPreview

Settings

SettingsPreview


Self-host

Installation

  1. Clone the repository:

    git clone https://github.com/c2y5/focusnest.git
    cd focusnest
  2. Install dependencies (use virtual env if needed)

    pip install -r requirements.txt
  3. Setup .env

    SECRET_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
    

Setup Auth0

  1. Login to Auth0
  2. Create an application like the following

Auth0CreateApp

  1. Update your .env

    • Copy the Client Id, Client Secret and Domain and set them in .env
    • If you are NOT using custom domain, your Auth0 audience domain should 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_URL should be the url you are self-hosting from + /callback. E.G. http://localhost:5000/callback
    • AUTH0_LINK_CALLBACK_URL would be similar to above except add /link-callback
  2. 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 URLs add your link from AUTH0_CALLBACK_URL AND AUTH0_LINK_CALLBACK_URL
    • Set Allowed Logout URLs to 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

Setup MongoDB

  • Login to MongoDB
  • Create a cluster if you havn't already
  • Find your cluster and click connect

ClusterConnect

  • Click Drivers

ClusterConnectDrivers

  • Set these as your settings

ClusterConnectSettings

  • 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 .env update MONGO_URI to the above, make sure to put in your db_password

  • For me I added a /focusnest after the url: @<name>.<id>.mongodb.net/focusnest?

  • You don't have to but I keep it like that for better view

Setup AI configs

  • Make sure to set your AI configs for flashcards!
  • Set AI_API_URL to 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 as your_api_key_here if there is none

Live counter

  • If you want your own live counter please change the url

LiveCounter

  • You can find it in app/static/js/liveCounter.js in line 8
  • Change focusnest into another one e.g. selfhosted_focusnest_abc123

Usage

  • Either run

    python app.py
  • or

    bash setup.sh [PORT]

Misc

  • To update the max file upload size change the value in config.py in lin 10
  • Update MAX_CONTENT_LENGTH to the size you want
  • e.g. 5 * 1024 * 1024 for 5MB or 10 * 1024 * 1024 for 10MB
  • To allow guests to access settings change GUEST_MODE_CUSTOMIZABLE in .env to True

Project Strcture

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

License πŸ“„

This project is licensed under the MIT License - see the LICENSE file for details.


Contributing 🀝

Feel free to submit issues or pull requests! Suggestions to improve FocusNest are very welcome.


About

A productivity-based application designed to help students to study and stay organised.

Resources

License

Stars

Watchers

Forks