Skip to content

Commit

Permalink
Update the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Jan 15, 2025
1 parent ee68e04 commit 0a1e92e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
29 changes: 16 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
############################################

# Valid choices: "development", "debug", "debugwait"; anything else will cause it to run in production mode
ENVIRONMENT="development"

ENVIRONMENT=development
DEBUG=True

ALLOWED_HOSTS=*
APEX_DOMAIN=localhost:8000
SECRET_KEY="replace-this-example-key"
SENTRY_DSN=""

SECRET_KEY="replace-this-example-key"

# key used for encrypting, data; has to be exactly 32 characters long
ENCRYPT_KEY="this-key-should-be-exactly-32-ch"

Expand All @@ -32,21 +34,13 @@ CORS_ALLOW_ALL_ORIGINS=True
DJANGO_ADMIN_EMAIL=[email protected]
DJANGO_ADMIN_PASSWORD=a

# Regular admin account
SEED_ADMIN_EMAIL=[email protected]
SEED_ADMIN_PASSWORD=a

# back-end start-up
RUN_MIGRATIONS=True
RUN_COLLECT_STATIC=True
RUN_SEED_GROUPS=True
RUN_SEED_LOCATIONS=True
RUN_CREATE_SUPER_USER=True

# database
# change DATABASE_ENGINE to "mysql" if you want to use MySQL or "postgres" for PostgreSQL
DATABASE_ENGINE=postgres
# these are only used if DATABASE_ENGINE is mysql or postgres
DATABASE_NAME=redirect
DATABASE_USER=user
DATABASE_PASSWORD=password
Expand Down Expand Up @@ -77,8 +71,9 @@ DONATIONS_XML_LIMIT_PER_FILE=100
DONATIONS_LIMIT_DAY=25
DONATIONS_LIMIT_MONTH=5

# Background tasks
BACKGROUND_WORKERS_COUNT=1
# Vite server settings, necessary for development
DJANGO_VITE_DEV_MODE=True
DJANGO_VITE_DEV_SERVER_PORT=3000

# Recaptcha is disabled if no public key is provided
## Use the following keys for testing
Expand All @@ -96,3 +91,11 @@ AWS_COGNITO_CLIENT_SECRET=
# NGOHub API credentials
NGOHUB_API_ACCOUNT=
NGOHUB_API_KEY=

# NGO Hub sites
NGOHUB_HOME_HOST=ngohub.ro
NGOHUB_APP_HOST=app.ngohub.ro
NGOHUB_API_HOST=api.ngohub.ro

# The link checked to verify the NGO Hub app
BASE_WEBSITE="https://redirectioneaza.ro"
59 changes: 28 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@

[See the project live][link-production]

Give a short introduction of your project. Let this section explain the objectives or the motivation behind this
project.

[Contributing](#contributing) | [Built with](#built-with) | [Deployment](#deployment) | [Feedback](#feedback) | [License](#license) | [About Code for Romania](#about-code-for-romania)
[Contributing](#contributing) | [Built with](#built-with) | [Feedback](#feedback) | [License](#license) | [About Code for Romania](#about-code-for-romania)

## Contributing

Expand All @@ -29,7 +27,7 @@ happening_ in detail.

If you would like to suggest new functionality, open an Issue and mark it as a __[Feature request]__. Please be specific
about why you think this functionality will be of use. If you can, please include some visual description of what you
would like the UI to look like if you are suggesting new UI elements.
would like the UI to look like if you’re suggesting new UI elements.

## Built With

Expand All @@ -55,46 +53,45 @@ would like the UI to look like if you are suggesting new UI elements.
The project has been configured to work with the following databases:

- [PostgreSQL](https://www.postgresql.org/)
- [MySQL](https://www.mysql.com/)
- [SQLite](https://www.sqlite.org/index.html)

## Development

### Compiling the CSS with less
### Deployment without Docker

Go to the `backend/` folder and run the following commands:
#### Prerequisites

```bash
nvm use --lts || nvm install --lts
- Python 3.12
- [NVM](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating)
- a PostgreSQL 16.2 database (can be run with Docker)

npm i -g [email protected] [email protected] [email protected]

bower install

cp -r bower_components/ static_extras/

pushd static_extras/

lessc css/main.less > css/main.css --clean-css="--s1 --advanced --compatibility=ie8"

rm -rf bower_components/

popd
```
1. Go to the root of the project
2. Run `cp .env.example .env` to create the environment file
3. Set up the Node.js environment
1. Go to the `backend` directory
2. Run `nvm use || nvm install` to install the Node.js version specified in the `.nvmrc` file
3. Run `npm install` to install the Node.js dependencies
4. Set up the Python environment
1. Create a virtual environment and activate it with `python3 -m venv venv && source venv/bin/activate`
2. Go to the `backend` directory
3. Run `pip install -r requirements-dev.txt` to install the Python dependencies

or, in a one-liner:
#### Running the project

```bash
pushd backend/ && nvm use --lts || nvm install --lts && npm i -g [email protected] [email protected] && cp -r bower_components/ static_extras/ && pushd static_extras/ && lessc css/main.less > css/main.css --clean-css="--s1 --advanced --compatibility=ie8" && rm -rf bower_components/ && popd && popd
```
1. Run the Django project in one terminal
1. Go to the `backend` directory
2. Run `source venv/bin/activate` to activate the Python virtual environment
3. Run `django-admin runserver localhost:8000` to start the Django development server
2. Run the frontend in another terminal
1. Go to the `backend` directory
2. Run `nvm use` to use the Node.js version specified in the `.nvmrc` file
3. Run `npm run dev` to start the frontend development server

## Deployment

### With Docker
### Deployment With Docker

1. Go to the root of the project
2. Run `cp .env.example .env` to create the environment file
3. Run `make run` to start the containers with an SQLite database
3. Run `make run` to start the containers with an PostgreSQL database
4. Open http://localhost:8080 in your browser

## Feedback
Expand Down

0 comments on commit 0a1e92e

Please sign in to comment.