From c75021197ea96b3988a4eafbc39260b478a971bb Mon Sep 17 00:00:00 2001 From: Happy Felix Chukwuma Date: Tue, 20 Aug 2024 01:02:08 +0100 Subject: [PATCH 1/2] doc: Updated readme file --- README.md | 42 ++++++++++++++++++++++++++---------------- server/.env.example | 7 +++++++ 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 64bf321..3b2f69e 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Before running the application, ensure you have the following: 4. Setup Environment Variables: Create a .env file in the root directory using the .env.example template and add all required variables: + ```env DJANGO_SETTINGS_MODULE='core.config.local' #for Dev environment @@ -65,7 +66,14 @@ Before running the application, ensure you have the following: DB_USER= DB_PASS= DB_HOST=localhost - DB_PORT=5432 + DB_PORT=5432 + + SITE_URL='http://localhost:8000' + + # Django smtp + EMAIL_HOST = 'smtp.gmail.com' # Example using Gmail + EMAIL_HOST_USER = 'enter your email' + EMAIL_HOST_PASSWORD = 'enter password' #for Gmail, generate app password ``` 5. Run the application in development mode: @@ -76,34 +84,36 @@ Before running the application, ensure you have the following: python3 manage.py makemigrations # To compile the migrations python3 manage.py migrate # To migrate the changes in Database python3 manage.py runserver # To run the API server + redis-server # to start redis-server + celery -A core worker -l info # to run celery + celery -A core beat -l info # to run celery beat ``` -- Start Client: +- Start Research Client: ```bash - cd client # enter the client directory - npm install - npm install react-scripts@latest --legacy-peer-deps #to resolve dependency issues - npm run build - npm start # To run the the client server + cd research # enter the research directory + npm install pnpm # do this if you dont have pnpm installed + pnpm install + pnpm start # To run the the research server ``` 6. API Testing: `http://127.0.0.1:8000/api/` - | Method | Route | Description | - | :----: | :---------------: | :-----------------: | - | GET | articles/ | List all articles | - | POST | articles/ | Add an article | + | Method | Route | Description | + | :----: | :----------------: | :-----------------: | + | GET | articles/ | List all articles | + | POST | articles/ | Add an article | | GET | articles/ | Retrieve an article | | PATCH | articles/ | Update an article | | DELETE | articles/ | Delete an article | -7. Client Testing: `http://localhost:3000/` +7. Client Testing: `http://localhost:4321` - | Method | Route | Description | - | :----: | :---------------: | :-----------------: | - | GET | articles/ | List all articles | - | GET | articles/ | Retrieve an article | + | Method | Route | Description | + | :----: | :-------: | :-----------------: | + | GET | / | List all articles | + | GET | | Retrieve an article | 8. Model Testing: run `python manage.py test` diff --git a/server/.env.example b/server/.env.example index 1ace904..07a571f 100644 --- a/server/.env.example +++ b/server/.env.example @@ -12,3 +12,10 @@ DB_USER= DB_PASS= DB_HOST=localhost DB_PORT=5432 + +SITE_URL='http://localhost:8000' + +# Django smtp +EMAIL_HOST = 'smtp.gmail.com' # Example using Gmail +EMAIL_HOST_USER = 'enter your email' +EMAIL_HOST_PASSWORD = 'enter password' #for Gmail, generate app password \ No newline at end of file From bfc6d4e07d5959b825d9ee0d8337377fd1968dd8 Mon Sep 17 00:00:00 2001 From: Happy Felix Chukwuma Date: Tue, 20 Aug 2024 01:55:04 +0100 Subject: [PATCH 2/2] feat: Reconfigured the Subscribe Action --- research/src/layouts/Footer.astro | 104 +++++++++++++++++++++++++----- server/apps/newsletter/views.py | 27 ++++---- server/core/config/base.py | 4 +- server/core/config/local.py | 9 ++- 4 files changed, 113 insertions(+), 31 deletions(-) diff --git a/research/src/layouts/Footer.astro b/research/src/layouts/Footer.astro index d7f7243..a4e36d9 100644 --- a/research/src/layouts/Footer.astro +++ b/research/src/layouts/Footer.astro @@ -99,23 +99,97 @@ -
+
-
-

Your Ethereum Edge

- Get first-hand research delivered by our team of experts. -

-
- -
+
+

Your Ethereum Edge

+

+ Get first-hand research delivered by our team of experts. +

+
+
+ + + +
+
-
+ + +
+