MiguelMarcelino / Somnus

This repository hosts the front- and backend for Somnus, a website aimed at publishing articles.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Somnus

This is the GitHub repository for the Somnus website. Head over to our website to see more of our content.


Dependencies

  • Java 17
  • Angular 15
  • Node 19
  • npm 9.6

Running the backend locally

You will need to create a application-dev.properties to run Somnus. Here is a sample of what you need:

## Datasource
spring.datasource.url=<db_link>
spring.datasource.username=<db_user>
spring.datasource.password=<password>

## Firebase Config
firebase.database.url=<your_firebase_url>
firebase.service.account.file.path=<path_to_key>

## Minecraft API link
minecraft.api.link=https://api.mcsrvstat.us/2/somnus.ddns.net

# Github Info
github.auth.token=<git_token>
github.api.url=https://api.github.com/repos/MiguelMarcelino/Somnus

## Mail
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=<your_test_email>
spring.mail.password=<email_password>
spring.mail.properties.mail.transport.protocol=smtp
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true

#Pusher
pusher.config.appid=<app_id>
pusher.config.key=<app_key>
pusher.config.secret=<app_secret>
pusher.config.cluster=<app_cluster>

#Jpa
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.javax.persistence.schema-generation.create-database-schemas=true

# Restart server
spring.devtools.restart.enabled=true

To create this file, you will need the following:

  • Create a local database, supplying it your username and password
  • Create your own firebase app using the firebase console
  • Configure Pusher with the required data (although pusher is still in testing, so no need to create it just yet)
  • Configure an email for testing
  • Get a github token to test the github functionalities.

Running the frontend locally

To test the frontend, just jun npm start to start the server locally. This will open the server on port 4200. To deploy the frontend you can run the exp_frontend_prod script to build the angular project for production. This will create a /SomnusFrontEnd/dist folder containing all the necessary files for deployment.


Testing environment

Using Database (MySQL)

  • Create a new user on the mysql database: CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'yourpassword';
  • Give permissions to new user: GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'localhost' WITH GRANT OPTION;
  • Flush mysql privileges: FLUSH PRIVILEGES;
  • Create Database: CREATE DB somnustestdb;
  • Dont forget to change the password in the application-dev.properties file

Running Backend

  • You can run the Java backend using the created bash script file: run_backend_testing.sh

The Somnus Team

About

This repository hosts the front- and backend for Somnus, a website aimed at publishing articles.


Languages

Language:TypeScript 39.1%Language:Java 38.2%Language:HTML 12.8%Language:SCSS 8.3%Language:Shell 0.9%Language:JavaScript 0.5%Language:CSS 0.2%