https://cs-370-project-x41n.vercel.app/
- When you first go to Pomodoro+, sign up and make an account! Navigate to the sign up button on the top right and click sign up with email and password
- After making an account, login and check out our Pomodoro page where you will find a timer, study sessions, and a to-do list
- When you are ready, download the chrome extention, block the websites that distract, and begin your study session!
Welcome to Pomodoro+, a safe space where you can study using the versatile Pomodoro studying technique, join study groups, and install our chrome extension to block distracting websites on your computer to get the most out of your study session.
To run a local copy of this project, follow the steps below depending on your operating system.
-
Install Homebrew
Open the Terminal and run the following command to install Homebrew (if it's not already installed):/bin/bash -c "$(curl -fsSL -o install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install Node.js
After installing Homebrew, install Node.js using this command:brew install node
-
Clone the repository
git clone https://github.com/raphaelpalacio/CS370Project.git
3a. After cloning the repository download package.json and package-lock.json from this link. After you have downloaded them, please put it in the root folder of the repository https://drive.google.com/drive/folders/1v0PrW5etrfCxgw0iECQ4WVbgJ9lj7CT8?usp=drive_link
-
Navigate to the directory and install dependencies
cd CS370Project npm install
-
Start the development server
npm start
Alternatively, if you are using React:
npm install react-scripts npm run start
-
View your local frontend Open a browser and go to: http://localhost:3000
- Navigate to chrome://extensions
- Toggle on developer mode on the top right
- Click load unpacked
- Navigate to the repository folder
- Select the chrome extension folder
- Click on the 'Pomodoro Blocker' folder
- Then click select on at the bottom of the Finder/Files view finder
- After it is loaded, navigate to your chrome extensions and scroll until you see 'Pomodoro Blocker'
Our website is crafted using React, JavaScript, HTML, CSS, and Tailwind CSS. React helps us build dynamic and reusable UI components, while JavaScript enables interactive elements. HTML structures our content, CSS adds styling, and Tailwind CSS facilitates rapid, utility-first design. This combination ensures a responsive and visually appealing user experience across all devices
For more details and insights into the architecture, refer to the ./src sub-directory
The Pomodoro API is a Flask-based RESTful API designed for managing tasks, sessions, and user interactions in a study-oriented application. The API includes user authentication via Auth0, session management, task tracking, and supports a CORS configuration to allow requests from a specific origin.
- Flask App Initialization: The API uses Flask for server setup and SQLAlchemy for ORM.
- CORS: Cross-Origin Resource Sharing is enabled for all routes, allowing access from
http://localhost:3000
. - Database Configuration: Connects to a PostgreSQL database. SQLAlchemy is used to handle database operations.
- Migration: Flask-Migrate is used for handling database migrations. (This is alembic)
- Authentication: Utilizes Auth0 for handling user authentication with JWTs.
- Requirements.txt: All of the python dependencies are kept in
requriments.txt
and is up to date to the latest versions - Python Virtual Environment: For ease of use, we have set up a virtual python environment with all of the dependencies installed properly
- .env File: To run the API properly you need to add these two variables within a
.env
file:AUTH0_DOMAIN = 'dev-otrfj0d3n15cdjdz.us.auth0.com' API_AUDIENCE = 'https://dev-otrfj0d3n15cdjdz.us.auth0.com/api/v2/'
AUTH0_DOMAIN
andAPI_AUDIENCE
must be set in your environment variables for JWT verification.
- User: Represents a user with fields like username, email, password, and associated roles.
- ToDo: Tasks that users can create, update, or delete.
- Session: Represents a study session with fields like start and end times, duration, and status.
- Playlist: User-created playlists for managing study music or sounds.
- Channel: Communication channels for users within study groups.
- Message: Messages within channels.
- StudyGroup: Groups for users to study together, linked to channels and users.
- StudyGroupMember: Links users to study groups.
- StudyGroupChannel: Links channels to study groups.
- ChannelMessage: Links messages to channels.
- Base Route (
/
): Welcomes users to the API. - Todo Management (
/todos
,/todos/<int:todo_id>
): Endpoints for retrieving, adding, and updating todos. - Session Management (
/sessions/start
,/sessions/stop
,/sessions/history
): Manage study sessions. - User Management (
/users/register
,/users/login
,/users/logout
,/users/profile
,/users/delete
): User registration, login, logout, profile management, and deletion.
- Token Handling: Includes functions to extract and verify JWT tokens, with error handling for expired or invalid tokens.
- Cross-Origin Requests: Handles cross-origin requests with proper headers.
get_token_auth_header()
: Extracts the authorization token from the header.verify_decode_jwt()
: Verifies and decodes the JWT using the public keys fetched from Auth0.current_user()
: Identifies the current user based on the session or JWT token.
- Passwords are hashed using Flask-Bcrypt.
- Sensitive routes require JWT authentication.
- Add a ToDo:
curl -X POST http://localhost:5000/todos -H 'Content-Type: application/json' -d '{"title": "New Task", "description": "Complete the task"}'
- Start a session:
curl -X POST http://localhost:5000/sessions/start -H 'Content-Type: application/json' -d '{"uID": 1, "duration": 120}'
- To run our API in a developer setting you would just need to type this command in the terminal
python3 app.py
or
flask run
For our application we used POSTGRESQL. For database hosting we used AWS RDS, for our API with use AWS EC2, and for our frontend, we hosted with Vercel