WordNest Online Dictionary is a personal project aimed at creating bilingual dictionaries to help with language learning and translation. I believe that language learning should be a personalized and engaging experience, and the Wordnest is designed to provide the tools and resources you need to succeed.
- Purpose
- UX Design
- Wireframes
- Agile Development
- Design
- Features
- Database Schema
- Testing
- Technologies
- Environment Variables
- Deployment
- Bugs
- Credits
Table of contents generated with markdown-toc
The WordNest Online Dictionary is built using the Django framework, which provides robust backend functionality, including user authentication, data management, and routing. The frontend is enhanced by Django's templating system to deliver a seamless and interactive user experience. Additionally, the integration of htmx allows for dynamic content updates without the need for full page reloads, further enhancing the user experience by making interactions smoother and more responsive.
Key features of the platform include personalized dictionary creation, custom translations, instant translations, and quick word searches. These features are designed to provide an engaging and efficient tool for language learners and enthusiasts.
Target audiences:
- Language Learners and Enthusiasts: Individuals passionate about learning new languages and expanding their vocabulary. These users can benefit from the personalized dictionary and custom translation features.
- Students and Educators: Students looking for a tool to aid their language studies and educators seeking a resource to support their teaching. WordNest can be a valuable addition to their learning and teaching toolkit.
- Bilingual and Multilingual Individuals: People who speak or are learning multiple languages and need a reliable tool to manage and translate vocabulary across languages.
To craft an epic logic on GitHub, I begin by creating an issue and assigning it the "Epic" label. Within this issue, I meticulously compile a list of both user and developer stories that are integral to the epic's completion.
You can find all the epics here
-
User stories: To describe features for my project I used this user stories. My user stories are follow this template
-
Developer stories: To describe features for my project I used this developer stories. My developer stories are follow the same template as the user stories the same template as the user stories but with different title.
All wireframes were created using figma. The wireframes are designed to provide a visual representation of the website's layout and functionality across different screen sizes.
In this project, we use Agile methodology to manage and track development tasks. Here's a breakdown of how we apply Agile practices:
- Issues: Each task is represented by an issue in our GitHub repository.
- Labels: Issues are categorized using labels to indicate their priority and importance:
Could HaveMust HaveShould HaveWould Have
- Milestones:
- Product Backlog: This milestone includes all issues that have been identified but not yet assigned to a specific iteration. Issues in this milestone do not have time constraints.
- Iteration #number: Each iteration has a specific duration (one week) and is assigned a milestone. Issues are moved to this milestone as they are scheduled for the current iteration.
- GitHub Kanban Board: We use a GitHub Kanban board to represent the current iteration's state and to track progress. Each iteration has its own project board.
- Iteration Planning: For each new iteration, a new project board is created. Each iteration consists of a specific number of issues that are planned for completion within the week.
- New Issues: All new issues are added to the
Product Backlogmilestone by default. - Iteration Setup: When a new iteration begins, a new project board is created, and issues from the
Product Backlogare selected and moved to the correspondingIteration #numbermilestone. - Execution: During the iteration, the team works on issues as per the priority labels and tracks progress on the GitHub Kanban board.
- Review: At the end of each iteration, completed issues are reviewed, and a new iteration is planned with updated priorities and tasks.
This structured approach ensures clear task prioritization and efficient tracking of progress throughout the development cycle.
This color scheme was chosen to create a clean and modern look for the website.
This project uses the following Google Font:
- Inter - for all text content.
This project utilizes the Django allauth library to handle user registration, authentication, and account management, including social account integration.
- Registration and Authentication with Social Accounts: Allows users to sign up and log in using social accounts.
- User Registration: Enables new users to create an account with their details.
- User Login: Provides users with the ability to log in using their credentials.
- User Logout: Allows users to log out from their accounts.
- Reset Password: Facilitates the process for users to reset their forgotten passwords.
- Change Password: Allows users to change their account passwords.
- Set Password: Allows users to set a password for their account if they sign up with their social account.
- Email Confirmation: Sends a confirmation link to the user's email to verify that the email address belongs to the user.
- User Account Deletion: Allows users to permanently delete their accounts.
- Admin Model Registration: Registers models in the Django Admin interface for administrative purposes.
- Add Word to Dictionary: Users can add new words to their personal dictionaries.
- Delete Dictionary: Provides functionality for users to delete entire dictionaries.
- Delete Word from Dictionary: Allows users to remove specific words from their dictionaries.
- Create User Dictionaries: Enables users to create and manage their own custom dictionaries.
- Look Up Words on the Fly: Users can perform real-time lookups for words within the dictionary.
- Create Own Translation: Allows users to create and store their own translations for words.
- API Translations Added to Database: Ensures that translations retrieved from external APIs are stored in the application's database.
- Search Database Before API: Searches for translations in the database before querying external APIs for efficiency.
- Distinguish API and User Translations: Differentiates between translations sourced from APIs and those created by users.
- API Translations with AZURE Translation API: Implements translation features using the AZURE Translation API to provide accurate and reliable translations.
- User Profile: Provides users with a profile page where they can view and update their personal information.
- Success and Error Toast Notifications: Displays toast messages to inform users of success or errors during interactions.
- Infinite Word Scroll in User Dictionary: Implements infinite scrolling for viewing words in the user's dictionary, enhancing navigation.
- Dynamic Word Management with HTMX: Allows users to delete, create, and search for words within their dictionaries without a full page refresh. Utilizes HTMX for seamless, real-time updates to the dictionary interface.
The first schema is for the dictionary app, which includes models for dictionaries, words, and translations. The second schema is for the entire project, which includes models for user profiles, user dictionaries, and user translations.
- ✔️ Navbar layout displays correctly on different screen sizes.
- ✔️ All links are working correctly.
- ✔️ The burger menu functions correctly on mobile devices.
- ✔️ Anonymous users do not see links that are only for authenticated users.
- ✔️ Footer layout displays correctly on different screen sizes.
- ✔️ All links are working correctly.
- ✔️ The link to the GitHub repo opens in a new tab.
-
For anonymous users:
- ✔️ The home page displays correctly on different screen sizes.
- ✔️ All links are working correctly.
- ✔️ Shows Sign Up button.
- ✔️ Shows Sign up with Google and Facebook icons.
- ✔️ Shows "Features" section.
-
For authenticated users:
- ✔️ All links are working correctly.
- ✔️ Shows dictionaries list.
- ✔️ Shows Create dictionary button.
- ✔️ Shows Delete dictionary icon near each dictionary.
-
For anonymous users:
- ✔️ Get redirect to the welcome page.
-
For authenticated users:
- ✔️ All links are working correctly.
- ✔️ The dictionary page displays correctly on different screen sizes.
- ✔️ User can add, delete and search words.
-
For anonymous users:
- ✔️ Get redirect to the welcome page.
-
For authenticated users:
- ✔️ All links are working correctly.
- ✔️ The dictionary page displays correctly on different screen sizes..
- ✔️ User can change the password.
- ✔️ User can delete the account.
- ✔️ User can seen general information about his account.
- ✔️ User can see amount of his dictionaries and delete them.
All forms were created using one template so that they have the same styles and functionality. An anonymous user can see all forms except Set Password, Change Password, and Create Dictionary forms.
- For all users:
- ✔️ All forms are displayed correctly on different screen sizes.
- ✔️ All form fields, buttons, and hints work correctly.
Unit tests was create with django built-in django test functionality. To run the tests, run the following command in the terminal:
python manage.py testJS unit testing was performed through Jest. To run the tests, run the following command in the terminal:
npm test wordnest/static/js/__tests__/To validate the HTML code, I use the W3C HTML Markup Validator. Since I use htmx in my project, the validator will show some errors related to the htmx attributes, but these can be ignored.
-
✔️ Welcome page
-
✔️ Home page
-
✔️ Profile page
-
✔️ Login page
To validate the CSS code, I use the W3 Jigsaw validator.
To validate the Python code I use Ruff VScode extension.
- ✔️ No errors found.
To validate the JS code I use [ESLint] VScode extension(https://eslint.org/).
- ✔️ No errors found.
-
✔️ Welcome page
- Python+Django, JavaScript, HTML, CSS
- Django for backend and frontend functionality.
- PostgreSQL relational database.
- Psycopg PostgreSQL adapter for Python.
- Google Fonts for typography.
- GitHub to host the source code.
- Heroku to deploy and host the live app.
- Jest for JS unit-testing.
- Unittest for Python unit-testing.
- W3C HTML Markup Validator to validate HTML code.
- W3C Jigsaw CSS Validator to validate CSS code.
- django-livereload-server - automatically reload django server when a static file was changed.
- django-allauth - help to set up social authentication.
- dj-database-url - allows to use URLs to connect to DB
- js-cookie - JavaScript API for handling cookies
- Tippy.js is the complete tooltip, popover, dropdown, and menu solution for the web
- django-htmx - make using htmx in Django easier.
To run this project locally, you will need to create a .env file in the root directory of the project and add the following environment variables:
SECRET_KEY=your_django_secret_key
DEBUG=True
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
AZURE_TRANSLATOR_KEY=GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, FACEBOOK_CLIENT_ID, FACEBOOK_CLIENT_SECRET used for user social authentication.
AZURE_TRANSLATOR_KEY used to translate words with API.
The WordNest project was deployed on a Heroku hosting server. The following steps outline the process of deploying the WordNest project and can be applied to deploy another Django project with minor adjustments:
-
Navigate to your Heroku dashboard and create a new app with a unique name.
-
Install decouple to manage environment variables.
pip install python-decoupleNote: Decouple is a useful library that allows you to separate local and production settings for Django projects.
-
Create a
.envfile in the root directory of your project. -
Add the following text to
.gitignorefile. This makesgitignore.envfile..env -
Add
DEBUG=Trueto the.envfile. -
Import
decouplein thesettings.py.from decouple import config
-
Replace
DEBUGvariable in thesettings.pywith the following code:DEBUG = config("DEBUG", default=False, cast=bool)
-
Install
gunicornas a production-ready webserver for Heroku with command.pip install gunicorn -
Create a file named
Procfileat the root directory of the project. -
Add following command to
Procfileto run your server in production.web: gunicorn wordnest.wsgiNote: Replace
wordnestwith your project name -
In the
settings.pyfile update theALLOWED_HOSTSvariable.ALLOWED_HOSTS = ['127.0.0.1', '.herokuapp.com']
-
Install dj-database-url.
pip install dj-database-url -
Import
dj-database-urlinsettings.py.import dj_database_url
-
Install psycopg2 to connect to PostgreSQL database.
pip install psycopg2 -
In the
settings.pyreplaceDATABASESwith the following code:if DEBUG: DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": config("DB_NAME"), "USER": config("DB_USER"), "PASSWORD": config("DB_PASSWORD"), "HOST": config("DB_HOST"), "PORT": config("DB_PORT"), } } else: DATABASES = { 'default': dj_database_url.parse(config('DATABASE_URL')) }
Note: Replace
ifclause with your own database for local development -
In the
.envfile update theDEBUGenvironment variable and addDATABASE_URLnew one.DEBUG=False DATABASE_URL=add_URL_of_a_remote_databaseNote: For the WordNest I used database URL provided by
Code Institutebut you can use other database hosting services< such as Amazon RDS for PostgreSQL/sub> -
Reload your terminal and run the following command in terminal to migrate remote database.
python manage.py migrate -
Replace
DEBUG=FalsetoDEBUG=Truein the.envfile. -
Return to the Heroku dashboard navigate to the Settings tab and click on Reveal Config Var and add
DATABASE_URLenvironment variable. -
Install whitenoise to manage static files on production server.
pip install whitenoise -
Add
whitenoiseto theMIDDLEWARElist in thesettings.py.MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", 'whitenoise.middleware.WhiteNoiseMiddleware', ]
Note: The WhiteNoise middleware must be placed directly after the Django
SecurityMiddleware -
Add
STATIC_ROOTandSTORAGESvariables to thesettings.py.STORAGES = { "staticfiles": { "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", }, } STATIC_ROOT = BASE_DIR.joinpath("staticfiles")
-
Run the following command in terminal to collect static files.
python manage.py collectstatic -
From the terminal, check the Python version used in your IDE.
python --version -
Look up the supported runtimes here and copy the runtime closest to the one used in your IDE.
-
Add a
runtime.txtfile to your app's root directory. -
Paste the copied runtime into the
runtime.txtfile. -
Update
requirements.txt.pip freeze > requirements.txt -
Add and commit all changes to the repository.
git add . git commit -m "Deploying to Heroku" -
Push the changes to your remote branch that you intend to deploy.
git push -
On the Heroku dashboard, and in your app, click on the Deploy tab.
-
In the Deployment method section enable GitHub integration by clicking on Connect to GitHub.
-
Start typing your project repo name into the search box and click Search. A list of repositories from your GitHub account should appear. Click on the GitHub repo you want to deploy from.
-
Scroll to the bottom of the page in the Manual deploy section, choose branch you want to deploy and click Deploy Branch to start a manual deployment of the branch.
-
Open the Resources tab and choose an eco dyno. This dyno is a lightweight container to run your project.
-
Verify there is no existing Postgres database add-on. if there is a database add-on select Delete Add-on to remove it.
-
Click on Open app to view your deployed project.
- Log into your account on GitHub
- Go to the repository of this project WordNest
- Click on the code button, and copy your preferred clone link.
- Open the terminal in your code editor and change the current working directory to the location you want to use for the cloned directory.
- Type
git cloneinto the terminal, paste the link you copied in step 3 and press enter.
- icons from Font Awesome
I want to convey my immense gratitude to my mentor, Luke Buchanan, for pinpointing my mistakes and providing advice on how to rectify them. Special thanks to my friends who assisted in testing the application, and to the Slack community, always ready to offer valuable tips at any time.











