https://github.com/zerdicorp/cppscrolls__server
A platform where you can solve problems in C++, as well as create your own.
https://github.com/zerdicorp/cppscrolls__server
api cpp cppscrolls server
Last synced: 4 months ago
JSON representation
A platform where you can solve problems in C++, as well as create your own.
- Host: GitHub
- URL: https://github.com/zerdicorp/cppscrolls__server
- Owner: ZERDICORP
- License: mit
- Created: 2022-02-08T09:10:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-27T07:20:40.000Z (over 3 years ago)
- Last Synced: 2025-04-02T20:48:50.338Z (6 months ago)
- Topics: api, cpp, cppscrolls, server
- Language: Java
- Homepage:
- Size: 1.18 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cppscrolls__server :star2:
#### A platform where you can solve problems in C++, as well as create your own.
## Deployment Guide :speaker:
> All work will be done on arch linux.
#### 1. Clone the repository
```
$ git clone https://github.com/ZERDICORP/cppscrolls__server.git
```
#### 2. Check dependencies
```
$ java --version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment (build 17.0.3+3)
OpenJDK 64-Bit Server VM (build 17.0.3+3, mixed mode)
$ jar --version
jar 17.0.3
$ docker --version
Docker version 20.10.13, build a224086349
$ nginx -version
nginx version: nginx/1.20.2
$ mariadb --version
mariadb Ver 15.1 Distrib 10.7.3-MariaDB, for Linux (x86_64) using readline 5.1
```
#### 3. Application configuration setting
> Replace all values between <>.
```
$ cd /path/to/cppscrolls__server/src
$ vi resources/app.cfg
PORT=8080API_PREFIX=/api
SECRET=IMAGES_FOLDER_PATH=images/
SOLUTIONS_FOLDER_PATH=solutions/EMAIL_SENDER=
EMAIL_SENDER_PASSWORD=DATABASE_USER=
DATABASE_PASSWORD=
SQL_DRIVER=org.mariadb.jdbc.Driver
SQL_CONNECTION_STRING=jdbc:mariadb://localhost:3306/?autoReconnect=trueDOCKER_RUN_COMMAND=docker run --rm --volume ?:/workspace/main.cpp solution
```
#### 4. Nginx configuration setting
> Replace `` with your linux user.
> Replace `/path/to/images/` with `/path/to/cppscrolls__server/build/images/`.
```
$ sudo vim /etc/nginx/nginx.conf
user ;worker_processes 1;
events {
worker_connections 1024;
}http {
include mime.types;default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;server {
listen 80;
server_name localhost;location /images/ {
index default.jpg;
alias /path/to/images/;
}location /api/ {
proxy_pass http://127.0.0.1:8080;
}
}
}
```
#### 5. Creating a docker image
```
$ cd resources/docker/ && docker build -t solution . && cd ../../
```
#### 6. MySQL setup
```
$ mysql -u root -p
MariaDB> create database cppscrolls;
MariaDB> exit;
$ mysql -u root -p cppscrolls < resources/mysql/cppscrolls.sql
```
#### 7. Server start
```
$ ./build && cd ../build/ && ./run
```
#### ~ 8. Delete everything except `build` folder
```
$ rm -rf /path/to/cppscrolls__server/{,.[!.],..?}!(build)
```