View the live website here.
Welcome to the LangCorrect repository! This community-driven platform is designed to help users master writing in foreign languages. Ideal for language learners in search of practice and native speakers willing to lend a hand, LangCorrect offers a friendly, engaging environment where you can connect, share, and learn.
This repository houses the source code for the LangCorrect web application, developed using Django for the backend and the Django templating engine for the frontend. Additionally, a React client is currently in development; you can access its repository by clicking on LangCorrect React Client.
Interested in the features we offer or looking to contribute? Read on to find out more.
Note: This is not an exhaustive list of features. LangCorrect is continually evolving, and new features are being added regularly.
langcorrect/ - Project-specific code
constants/ - Project-wide constants
helpers/ - Project-wide helpers
templates/ - All project templates
static/ - All project static files
<app>/ - Specific app folders
constants/ - App-specific constants
helpers/ - App-specific helpers
api/ - wip App-specific API files
git clone git@github.com:LangCorrect/server.git
python3 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
We use Fugashi and NLTK for text parsing. Fugashi parses Japanese text and NLTK parses text in various languages.
python -m unidic download
python -m nltk.downloader popular
psql
CREATE DATABASE langcorrect;
python manage.py migrate
Make sure to setup pre-commit, otherwise there will be a bunch of CI and Linter errors.
pre-commit install
python manage.py loaddata fixtures/languages.json
python manage.py loaddata fixtures/correction_types.json
python manage.py runserver
The site will be accessible via http://localhost:8000.
Note: User registrations require email confirmations. Check your terminal for this link!
celery -A config.celery_app worker --loglevel=info
stripe listen --forward-to localhost:8000/subscriptions/webhook/
This project was started with Cookiecutter Django. To see a table of configurable settings visit settings.
This project uses several tools to maintain code quality. Below are the commands to run these tools.
We use flake8
for checking Python code for style and syntax errors and pylint
for additional code analysis.
flake8
to check the entire project for PEP8 compliancepylint <python files that you wish to lint>
to perform static code analysisThis project uses the Pytest, a framework for easily building simple and scalable tests.
python manage.py pytest #runs all tests
python manage.py pytest langcorrect/<app> #test specific app
You should build your tests to provide the highest level of code coverage. You can run the pytest with code coverage by typing in the following command:
python manage.py coverage run -m pytest
python manage.py coverage report
python manage.py test
stripe listen --forward-to localhost:8000/subscriptions/webhook/
This app utilizes Celery as an asynchronous task queue to efficiently manage background tasks, such as updating user rankings and running periodic tasks via the Beat scheduler.
To run a celery worker:
cd langcorrect
celery -A config.celery_app worker -l info
Please note: For Celery's import magic to work, it is important where the celery commands are run. If you are in the same folder with manage.py, you should be right.
To run periodic tasks, you'll need to start the celery beat scheduler service. You can start it as a standalone process:
cd langcorrect
celery -A config.celery_app beat
or you can embed the beat service inside a worker with the -B
option (not recommended for production use):
cd langcorrect
celery -A config.celery_app worker -B -l info
Sentry is an error logging aggregator service. You can sign up for a free account at https://sentry.io/signup/?code=cookiecutter or download and host it yourself. The system is set up with reasonable defaults, including 404 logging and integration with the WSGI application.
You must set the DSN url in production.
We welcome contributions from everyone, whether you are a seasoned programmer or a first-timer. Below are the steps and guidelines you should follow to contribute to this project.
Please make sure that you have:
Contribution Workflow:
git checkout -b 154-fixing-some-issue
.pre-commit
.git commit -m "Add meaningful description here (#154)"
If you have any questions or need further clarification on any of the steps, feel free to reach out to our Discord: https://discord.gg/Vk7KcV26Fe.
We look forward to your contributions!