Skip to content

Commit 609b02c

Browse files
committed
Initial commit
0 parents  commit 609b02c

File tree

616 files changed

+211423
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

616 files changed

+211423
-0
lines changed

.dockerignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.pyc
2+
*.swp
3+
*.swo
4+
i.*.swp
5+
.*.swo
6+
.webassets-cache
7+
.sass-cache/
8+
private
9+
delete_db.py
10+
env/
11+
.env
12+
node_modules/
13+
.DS_Store

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.pyc
2+
*.swp
3+
*.swo
4+
i.*.swp
5+
.*.swo
6+
.webassets-cache
7+
.sass-cache/
8+
private
9+
delete_db.py
10+
env/
11+
test_db
12+
.env
13+
node_modules/
14+
.DS_Store
15+
__pycache__
16+
.cache/
17+
Cog
18+
.vscode/

CONTRIBUTING.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Contributing
2+
============
3+
4+
All kinds of contributions to Cog are greatly appreciated. For someone
5+
unfamiliar with the code base, the most efficient way to contribute is usually
6+
to submit a [feature request](#feature-requests) or [bug report](#bug-reports).
7+
8+
If you want to dive into the source code, you can submit a [patch](#patches) as
9+
well. Working on [existing issues][issues] is super helpful!
10+
11+
Feature Requests
12+
----------------
13+
14+
Do you have an idea for an awesome new feature for Cog? Please [submit a
15+
feature request][issue]. It's great to hear about new ideas.
16+
17+
If you are inclined to do so, you're welcome to [fork][fork] Cog, work on
18+
implementing the feature yourself, and submit a patch. In this case, it's
19+
*highly recommended* that you first [open an issue][issue] describing your
20+
enhancement to get early feedback on the new feature that you are implementing.
21+
This will help avoid wasted efforts and ensure that your work is incorporated
22+
into the code base.
23+
24+
Bug Reports
25+
-----------
26+
27+
Did something go wrong with Cog? Sorry about that! Bug reports are greatly
28+
appreciated!
29+
30+
When you [submit a bug report][issue], please include relevant information such
31+
as Cog version, operating system, configuration, error messages, and steps to
32+
reproduce the bug. The more details you can include, the easier it is to find
33+
and fix the bug.
34+
35+
Patches
36+
-------
37+
38+
Want to hack on Cog? Awesome!
39+
40+
If there are [open issues][issues], you're more than welcome to work on those -
41+
this is probably the best way to contribute to Cog. If you have your own
42+
ideas, that's great too! In that case, before working on substantial changes to
43+
the code base, it is *highly recommended* that you first [open an issue][issue]
44+
describing what you intend to work on.
45+
46+
Patches should be submitted as Github pull requests.
47+
48+
Any changes to the code base should follow the style and coding conventions
49+
used in the rest of the project. The version history should be clean, and
50+
commit messages should be descriptive. Please run the included tests to ensure
51+
that nothing has broken, and, if applicable, we recommend writing tests for
52+
any new features you add!
53+
54+
---
55+
56+
If you have any questions about anything, feel free to [ask][email]!
57+
58+
_Thanks to Anish Athalye for letting us borrow this contribution guide from [Gavel](https://github.com/anishathalye/gavel)._
59+
60+
[issue]: https://github.com/techx/cog/issues/new
61+
[issues]: https://github.com/techx/cog/issues
62+
[fork]: https://github.com/techx/cog/fork
63+
[email]: mailto:[email protected]
64+
[gavel]: https://github.com/anishathalye/gavel

DEVELOPMENT.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Development
2+
3+
## Setup
4+
- Set up a Python2
5+
[virtualenv](http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/)
6+
to manage Python dependencies
7+
- Source your virtualenv
8+
- Run `pip install -r requirements.txt` to install all dependencies
9+
- Install [PostgreSQL](https://www.postgresql.org/download/) to run a database locally
10+
- If you're using Mac, install *Postgres.app* from
11+
[here](https://www.postgresql.org/download/)
12+
- Set three environment variables:
13+
- `DATABASE_URL` points to the URL of a development database,
14+
which has to be set up using Postgres on your system. A sample `DATABASE_URL`
15+
could look like `postgres://username:password@localhost/cog`.
16+
- `QUILL` is the URL to your Quill instance for auth.
17+
- `SECRET` needs to be the same JWT secret used in your Quill instance.
18+
- Run `python initialize.py`
19+
- This initializes the database - run it if you make any changes to the models and
20+
are fine with overwriting data.
21+
22+
## Running
23+
- Run `make run`
24+
- The site will be visible at `localhost:8000`
25+
26+
## Tests
27+
- Run `make test` to run all tests

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:2
2+
3+
ARG APP_PATH=/hardware-checkout
4+
5+
WORKDIR $APP_PATH
6+
7+
ADD requirements.txt $APP_PATH
8+
RUN pip install -r requirements.txt
9+
10+
ADD . $APP_PATH
11+
12+
EXPOSE 8000
13+
CMD ["gunicorn", "--bind", ":8000", "-k", "geventwebsocket.gunicorn.workers.GeventWebSocketWorker", "hardwarecheckout:app"]
14+

0 commit comments

Comments
 (0)