This project is an AI-powered note application that meets all the specified task requirements:
- Authentication with JWT: Secure user authentication.
- CRUD Operations for Notes: Create, read, update, and delete notes.
- Note History: View historical versions of notes.
- Summarization: Summarize notes using the OpenAI API.
- Analytical Endpoints: Calculate various statistics such as:
- Total word count across all notes.
- Average note length.
- Most common words or phrases.
- Top 3 longest and shortest notes.
- Testing: Unit and integration tests with 80% coverage.
- Authentication: Implemented using JWT for secure access.
- Database & Models:
- Two main models:
UserandNote, linked via a foreign key. - Versioning is handled with SQLAlchemy-Continuum to track note history.
- Two main models:
- Performance:
- Pagination is implemented in endpoints (e.g., retrieving all notes and note history) to reduce database load.
- AI Integration:
- Utilizes an asynchronous OpenAI client since the API is completely asynchronous.
- Uses an async SQLAlchemy driver for database communications.
- Analytics:
- Provides a separate asynchronous endpoint for data analysis.
- Uses synchronous utilities with Pandas and NLTK to calculate statistics and clean stop words.
- Testing:
- Testing is performed using an SQLite environment with asynchronous tests ensuring 80% coverage.
- Environment Setup:
- Configuration details are provided in the
.envfile. Ensure you set yourOPENAI_API_KEY.
- Configuration details are provided in the
- Development:
- Build and run the application using Docker Compose:
docker-compose --build
- Build and run the application using Docker Compose:
- Testing:
- Run tests with (docker-compose must be run as well):
pytest -v -s
- Run tests with (docker-compose must be run as well):