Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Issue #99: Improved UI alignment on the dashboard #192

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
frontend/node_modules
frontend/npm-debug.log
venv/
116 changes: 21 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,102 +4,28 @@

## How to Setup

1. Install [git](https://git-scm.com/downloads), [postgresql](https://www.postgresql.org/download/) version >= 9.4, [virtualenv](https://virtualenv.pypa.io/) and [Node.js](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps) version >= 6 in your computer, if you don't have it already.
*Please check that the python version you are using for the project is 2.7.x*.
*If you are having trouble with postgresql on Windows check this link [postgresqlhelp](http://bobbyong.com/blog/installing-postgresql-on-windoes/).*
2. Get the source code on your machine via git
```
git clone [email protected]:Cloud-CV/CloudCV.git cloudcv
```
If you have not added `ssh` keys to your GitHub account then get the source code by running the following command
```
git clone https://github.com/Cloud-CV/CloudCV.git cloudcv
```
3. Create a python virtual environment and install python dependencies.
```
cd cloudcv
virtualenv venv
source venv/bin/activate # run this command everytime before working on project
pip install -r requirements/dev.txt
```
4. Rename `settings/dev/settings.sample.py` as `settings/dev/settings.py` and change credentials in `settings/dev/settings.py`
```
cp settings/dev/settings.sample.py settings/dev/settings.py
```
Use your postgres username and password for fields `USER` and `PASSWORD` in `settings/dev/settings.py` file.
5. Create an empty postgres database and run database migration.
```
sudo -i -u (username)
createdb cloudcv
python manage.py migrate --settings=settings.dev.settings
```
6. That's it. Now you can run development server at [http://127.0.0.1:8000](http://127.0.0.1:8000) (for serving backend)
```
python manage.py runserver --settings=settings.dev.settings
```
7. Open a new terminal window with node(>=6) and ruby(gem) install on your machine and type
```
cd frontend
sudo npm install -g yarn
yarn install
```
If you running npm install behind a proxy server, use
```
npm config set proxy http://proxy:port
```
8. Now to connect to dev server at [http://127.0.0.1:6003](http://127.0.0.1:6003) (for serving frontend)
```
yarn run dev
```
*(Existing manual installation steps remain unchanged here.)*

## How to Setup on Windows
---

1. Install [git](https://git-scm.com/downloads), [postgresql](https://www.postgresql.org/download/windows); tested with [postgresql installer by bigsql](https://www.openscg.com/bigsql/postgresql/installers.jsp/) version >= 9.4, and [Node.js](https://nodejs.org/en/download/) version >= 6 in your computer & [python 2.7.x](https://www.python.org/downloads/windows/) , if you don't have it already.
2. Get the source code on your machine via git
```
git clone [email protected]:Cloud-CV/CloudCV.git cloudcv
```
If you have not added `ssh` keys to your GitHub account then get the source code by running the following command
```
git clone https://github.com/Cloud-CV/CloudCV.git cloudcv
```
3. Open a command prompt and Install python dependencies.
```
cd cloudcv
pip install -r requirements\dev.txt
```
4. Rename `settings/dev/settings.sample.py` as `settings/dev/settings.py` and change credentials in `settings/dev/settings.py`
```
copy settings\dev\settings.sample.py settings\dev\settings.py
```
Use your postgres username and password for fields `USER` and `PASSWORD` in `settings/dev/settings.py` file.
5. Create an empty postgres database and run database migration.
```
Start Postgresql server
Open psql prompt
createdb cloudcv
In the command prompt,
python manage.py migrate --settings=settings.dev.settings
```
6. That's it. Now you can run development server at [http://127.0.0.1:8000](http://127.0.0.1:8000) (for serving backend),
```
python manage.py runserver --settings=settings.dev.settings
```
7. Open a new terminal window with node(>=6) and ruby(gem) install on your machine and type
```
cd frontend
npm install -g yarn
yarn install
```
If you running npm install behind a proxy server, use
```
npm config set proxy http://proxy:port
```
8. Now to connect to dev server at [http://127.0.0.1:6003](http://127.0.0.1:6003) (for serving frontend)
```
yarn run dev
```
## Running CloudCV using Docker

## Contribution guidelines
### Prerequisites
- Install [Docker](https://docs.docker.com/get-docker/)
- Install [Docker Compose](https://docs.docker.com/compose/install/)

If you are interested in contributing to CloudCV, follow our [contribution guidelines](https://github.com/Cloud-CV/CloudCV/blob/master/.github/CONTRIBUTING.md).
### Steps to Run
1. Clone the repository:
```sh
git clone https://github.com/Cloud-CV/CloudCV.git
cd CloudCV

### **What Changed?**
1. **Added "Running CloudCV using Docker" Section**
- Placed **after** the "How to Setup" section since it's an alternative installation method.
2. **Kept the Original Manual Installation Steps**
- No changes to existing **manual setup instructions**.
3. **Clear and Minimal Docker Setup**
- Simple instructions to run the project using `docker-compose`.

Now, **update the `README.md` file** with this content, commit, and push it. Then, create a Pull Request (PR) referencing **Issue #99**. Let me know if you need any help!
26 changes: 10 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@ version: "2"
services:
db:
image: postgres
environment:
POSTGRES_USER: cloudcv
POSTGRES_PASSWORD: mysecurepassword # Change this to a strong password
POSTGRES_DB: cloudcvdb

django:
container_name: django
hostname: django
build:
context: ./
dockerfile: docker/prod/django/Dockerfile
command: /code/docker/prod/django/container-start.sh
context: docker/production/django
dockerfile: Dockerfile
command: /code/docker/production/django/container-start.sh
ports:
- "8000:8000"
- "8000:8000"
depends_on:
- db
nodejs:
container_name: nodejs
hostname: nodejs
build:
context: ./
dockerfile: docker/prod/nodejs/Dockerfile
environment:
NODE_ENV: development
ports:
- "6003:6003"
depends_on:
- django

25 changes: 25 additions & 0 deletions docker-compose.yml.save
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "2"
services:
db:
image: postgres
django:
container_name: django
hostname: django
build:
context: ./
dockerfile: docker/prod/django/Dockerfile
command: /code/docker/prod/django/container-start.sh
ports:
- "8000:8000"
depends_on:
- db
nodejs:
container_name: nodejs
hostname: nodejs context: ./
dockerfile: docker/prod/nodejs/Dockerfile
environment:
NODE_ENV: development
ports:
- "6003:6003"
depends_on:
- django
11 changes: 7 additions & 4 deletions docker/production/django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:2.7
MAINTAINER CloudCV Team
FROM python:3.11
LABEL maintainer="CloudCV Team"
ENV PYTHONUNBUFFERED 1

ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -17,8 +17,11 @@ RUN mkdir -p /var/run/cloudcv/ && chown -R cloudcv /var/run/cloudcv/ && chmod -R

WORKDIR /code

COPY /requirements /code/requirements
RUN pip install -r requirements/prod.txt
COPY container-start.sh /code/docker/production/django/container-start.sh
RUN chmod +x /code/docker/production/django/container-start.sh
COPY requirements.txt /code/requirements.txt
RUN pip install -r /code/requirements.txt


COPY ./ /code/

Expand Down
Empty file modified docker/production/django/container-start.sh
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions docker/production/django/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Django>=3.2,<4.0
djangorestframework
psycopg2
gunicorn
11 changes: 11 additions & 0 deletions docker/production/nodejs/frontend/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": ["react", "es2015"],
"env": {
"development": {
"presets": ["react-hmre"]
}
},
"plugins": [
["import", { libraryName: "antd", style: true }] // `style: true` for less
]
}
2 changes: 2 additions & 0 deletions docker/production/nodejs/frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
13 changes: 13 additions & 0 deletions docker/production/nodejs/frontend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions docker/production/nodejs/frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

87 changes: 87 additions & 0 deletions docker/production/nodejs/frontend/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": [
"react",
"prettier"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"es6": true,
"browser": true,
"node": true,
"jquery": true,
"mocha": true
},
"rules": {
"prettier/prettier": 1,
"object-curly-spacing": [1, "always"],
"no-dupe-class-members": 1,
"no-iterator": 1,
"one-var": [1, "never"],
"no-nested-ternary": 1,
"no-restricted-syntax": [1, "WithStatement"],
"no-duplicate-imports": 1,
"no-unneeded-ternary": 1,
"no-case-declarations": 1,
"dot-notation": 1,
"no-useless-constructor": 1,
"eqeqeq": 1,
"object-shorthand": 1,
"prefer-rest-params": 1,
"no-array-constructor": 1,
"array-callback-return": 0,
"no-param-reassign": 1,
"prefer-arrow-callback": 1,
"no-useless-concat": 1,
"prefer-template": 1,
"no-console": 1,
"no-debugger": 1,
"no-var": 1,
"no-trailing-spaces": 0,
"eol-last": 0,
"no-unused-vars": 0,
"no-underscore-dangle": 0,
"no-alert": 0,
"no-lone-blocks": 0,
"import/extensions": 1,
"react/display-name": [1, {"ignoreTranspilerName": false }],
"react/forbid-prop-types": [1, {"forbid": ["any"]}],
"react/jsx-boolean-value": 1,
"react/prefer-stateless-function": 1,
"react/jsx-indent-props": 0,
"react/jsx-key": 1,
"react/jsx-max-props-per-line": 0,
"react/jsx-no-bind": 0,
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-literals": 0,
"react/jsx-no-undef": 1,
"react/jsx-pascal-case": 1,
"react/jsx-sort-prop-types": 0,
"react/jsx-sort-props": 0,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-danger": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-direct-mutation-state": 1,
"react/no-multi-comp": 1,
"react/no-is-mounted": 1,
"react/no-set-state": 0,
"react/no-unknown-property": 1,
"react/prefer-es6-class": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 1
}
}
Loading