DEV Community

Discussion on: Reminder β€” Join the DigitalOcean App Platform Hackathon on DEV ⏰

Collapse
 
arnu515 profile image
arnu515

Check my submission out here πŸ‘‡

Check the code out here

Code Reviewers

A website for developers to upload and review code. Check it out!

Quickstart

Make sure to have deployed/ran the backend first

Deploy with DigitalOcean

Deploy to DO

You will also need a Redis Database, which is available on DigitalOcean. Create a DigitalOcean Database and add it to your app as a component. Then, create an environment variable called REDIS_URL and set it to the connection string of your database. Format of a connection string should be:

redis://user:password@url:port/databasenumber

Manually deploy

Set your environment variables:

API_URL=url_of_the_backend_you_deployed_earlier
REDIS_URL=url_of_the_redis_instance
SECRET=a_secret_key_used_to_encrypt_the_user_session

Deploy with docker

To make deployment easier, there's Docker support. Make sure that docker and docker-compose are installed on your system.

$ docker --version
Docker version XX.XX.X, build XXXXXXX
$ docker-compose --version
docker-compose version X.XX.X, build XXXXXXXX
Enter fullscreen mode Exit fullscreen mode

Then, use docker-compose to run the app.

$ git clone https://github.com/arnu515/code-reviewers.git code-reviewers
$ cd code-reviewers
$ docker-compose up
Enter fullscreen mode Exit fullscreen mode

You can also use the normal Dockerfile, but you'll…

Code Reviewers (BACKEND)

A website for developers to upload and review code. Check it out!
This is the backend. For the frontend, click here

Quickstart

You will need a DigitalOcean Spaces Space with an API Key configured. This will be used to store the code that users submit. Add these environment variables:

SPACES_ACCESS_KEY=accesskey
SPACES_SECRET_KEY=secretkey
SPACES_SPACE_REGION=region
SPACES_SPACE_NAME=bucketname
FLASK_ENV=production

Additionally, also set some fernet keys (obtainable with this command):

python3 -c "from cryptograhpy.fernet import Fernet; print(Fernet.generate_key().decode())"
Enter fullscreen mode Exit fullscreen mode

and generate 3 keys and put them as environment variables like so:

FERNET_KEY_1=key
FERNET_KEY_2=key
FERNET_KEY_3=key

Deploy with DigitalOcean

Deploy to DO

You will also need a Redis and PostgreSQL Database, which is available on DigitalOcean. Create a DigitalOcean Database and add it to your app as a component. Then, create an environment variable called REDIS_URL and set it to the connection string of your database. Format of a connection string should be:

redis://user:password@url:port/databasenumber

Do the same…