|
1 | 1 | # CodeWe |
2 | 2 |
|
3 | | -CodeWe is an open-source live code-sharing website developed in python with flask. |
| 3 | +CodeWe is an open-source live code-sharing website developed in Javascript with [express](https://expressjs.com/) and [MongoDB](https://www.mongodb.com/). |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +<img src="https://github.com/allEyezOnCode/CodeWe/blob/dev/imgs/codewe.png?raw=True " height="300"/> |
4 | 8 |
|
5 | 9 | ## Installation |
6 | 10 |
|
7 | 11 | ### Classic installation |
8 | 12 |
|
9 | 13 | #### Requirements |
10 | 14 |
|
11 | | -* [python](https://www.python.org/downloads/) 3.7 or newer (this project is developed in python 3.8.3 and up) |
12 | | -* pip |
| 15 | +* [Node.js](https://nodejs.org/en/download/) 14.15.1 or newer (this project is developed with the 14.15.1v) |
13 | 16 | * [git](https://git-scm.com/downloads) |
14 | | -* MySQL, MariaDB or sqlite (include in python standard library) |
| 17 | +* [MongoDB](https://www.mongodb.com/) |
| 18 | + |
| 19 | +The first step is to clone this repository. |
15 | 20 |
|
16 | | -The first step is to clone this repository, so open a terminal and run: |
| 21 | +Open a terminal and run: |
17 | 22 |
|
18 | 23 | ```bash |
19 | 24 | git clone https://github.com/allEyezOnCode/CodeWe.git |
20 | 25 | ``` |
21 | 26 |
|
22 | | -Install project requirements and dependencies |
| 27 | +Next step is to install depedencies |
23 | 28 |
|
24 | 29 | ```bash |
25 | 30 | cd CodeWe |
26 | | -pip install -Ur requirements.txt |
27 | | -# or on debian |
28 | | -pip3 install -Ur requirements.txt |
| 31 | +npm install |
29 | 32 | ``` |
30 | 33 |
|
31 | 34 | #### Databases |
32 | 35 |
|
33 | | -CodeWe runs by default with a mysql database, so you need to host one, but if you do not have such a database, fear not my friend! You can use Sqlite. |
| 36 | +Codewe uses MongoDB to store the documents. So install it from the official [MongoDB](https://www.mongodb.com/) site |
34 | 37 |
|
35 | | -#### Mysql or MariaDB |
36 | | - |
37 | | -Should you have a MySQL or MariaDB database server, execute the following in your sql shell to create the database. |
38 | | - |
39 | | -```mysql |
40 | | -mysql> source /src/db/sql_files/create_db.sql; |
41 | | -``` |
| 38 | +### Configuration file |
42 | 39 |
|
43 | | -Fill out (chage `[**redacted**]` to real passwords (do not share)) and then run `/src/db/sql_files/users.sql` in your sql shell to create the users. |
| 40 | +Before running the project you need to create the configuration file `config/config.json` from the `config/config dist.json` with your informations, like the host, the port, your database credentials, etc. |
44 | 41 |
|
45 | | -The last step is to modify the /src/config/db_config.dist.py, with your credentials |
46 | | - |
47 | | -Using `cp /src/config/db_config.dist.py /src/config/db_config.py`, copy the database configuration file and fill it with the info needed. |
48 | | - |
49 | | -#### Sqlite |
50 | | - |
51 | | -(skip this if you use mysql/MariaDB) |
52 | | - |
53 | | -Simply execute |
54 | | - |
55 | | -```shell |
56 | | -python[3] /src/db/create_sqlite_db.py |
57 | | -``` |
58 | | - |
59 | | - and change `DB_TYPE` to `"sqlite"` in `/src/config/config.py`. |
60 | | - |
61 | | -### Build with docker *(instable)* |
62 | | - |
63 | | -```bash |
64 | | -sudo docker-compose up -d --no-deps --build |
65 | | -``` |
66 | | - |
67 | | -Help wanted configuring it correctly! |
68 | | - |
69 | | -## Rununing `CodeWe` |
| 42 | +## Running `CodeWe` |
70 | 43 |
|
71 | 44 | ### With classic installation |
72 | 45 |
|
73 | 46 | To run the server, run a shell in the `CodeWe/src` folder and run: |
74 | 47 |
|
75 | 48 | ```bash |
76 | | -python main.py [ip [port]] |
77 | | -# or on debian |
78 | | -python3 main.py [ip [port]] |
| 49 | +node ./src/server.js |
79 | 50 | ``` |
80 | 51 |
|
81 | | -## Plan vor V2 |
| 52 | +## Next features |
| 53 | + |
| 54 | +* Document with privileges (anon auth, and jwt usage) |
| 55 | +* New programming langages |
| 56 | +* More options |
| 57 | +* Server montioring with prometheus and grafana |
| 58 | + |
| 59 | +## Contribution |
82 | 60 |
|
83 | | -* Migration to Nodejs (instead of flask) |
84 | | -* Store document as json or an array in Database |
| 61 | +Feel free to contribute, open an issue, then fork the repo and submit a PR. |
85 | 62 |
|
86 | 63 | ## Licence |
87 | 64 |
|
|
0 commit comments