Welcome to the AtomHabit Django RESTful API!
This project utilizes the following technologies and frameworks:
- Django
- Django Rest Framework (DRF)
- PostgreSQL
- Celery
- Celery Beat
- Redis
- Telegram Bot API
- Unit Testing
- Swagger
- CORS
- JWT AUTH
Enjoy tracking your habits and achieving your goals!
-
Make sure you have Docker installed on your system. If not, you can download and install it from the Docker website.
-
Clone the repository in your local machine and open it with IDE for example -> PYCharm or VSCode
-
Open a terminal and navigate to the directory where your Dockerfile is located.
-
Configure Your Environment: Create a
.env
file by copying the provided.env-example
. This file should contain sensitive information such as database settings, email configurations, and any required API keys..env-example -> .env
-
Build the Docker image using the following command:
docker-compose -f docker-compose-local.yml up
-
Done you can open localhost.
Follow these steps to run the API on your local machine:
-
Clone the Repository: Begin by cloning this repository to your local environment.
git clone https://github.com/yourusername/atomic-habit-api.git cd atomic-habit-api
-
Create a Virtual Environment: Before configuring the environment, it's a good practice to create a virtual environment using tools like Poetry or venv to isolate your project dependencies.
-
Configure Your Environment: Create a
.env
file by copying the provided.env-example
. This file should contain sensitive information such as database settings, email configurations, and any required API keys..env-example -> .env
Edit the
.env
file and fill in the necessary values. -
Database Migration: Migrate the database to create the required tables.
./manage.py migrate
-
Start the Telegram Bot: Run the Telegram bot to receive habit reminders. You can access the Telegram bot here.
./manage.py runtelegrambot
-
Start Celery and Celery Beat: Start Celery and Celery Beat for background task processing.
celery -A config worker --loglevel=info celery -A config beat --loglevel=info
Replace
yourprojectname
with the name of your Django project. -
Start the Server: Finally, start the development server.
./manage.py runserver
You can now access the API at
http://localhost:8000
in your web browser or use a tool like Postman to interact with it.